  The sky-averaged (global) highly redshifted 21-cm spectrum from neutral
hydrogen is expected to appear in the VHF range of $\sim20-200$ MHz and its
spectral shape and strength are determined by the heating properties of the
first stars and black holes, by the nature and duration of reionization, and by
the presence or absence of exotic physics. Measurements of the global signal
would therefore provide us with a wealth of astrophysical and cosmological
knowledge. However, the signal has not yet been detected because it must be
seen through strong foregrounds weighted by a large beam, instrumental
calibration errors, and ionospheric, ground and radio-frequency-interference
effects, which we collectively refer to as "systematics". Here, we present a
signal extraction method for global signal experiments which uses Singular
Value Decomposition (SVD) of "training sets" to produce systematics basis
functions specifically suited to each observation. Instead of requiring precise
absolute knowledge of the systematics, our method effectively requires precise
knowledge of how the systematics can vary. After calculating eigenmodes for the
signal and systematics, we perform a weighted least square fit of the
corresponding coefficients and select the number of modes to include by
minimizing an information criterion. We compare the performance of the signal
extraction when minimizing various information criteria and find that
minimizing the Deviance Information Criterion (DIC) most consistently yields
unbiased fits. The methods used here are built into our widely applicable,
publicly available Python package, $\texttt{pylinex}$, which analytically
calculates constraints on signals and systematics from given data, errors, and
training sets.
