Bias–variance & CV formulas
Bias–variance trade-off and cross-validation. 15 formulas for GATE DA Machine Learning, each with when to use it. Each is explained in the topic notes.
IAE Academy: Bias–variance trade-off and cross-validation formulas (GATE DA)
All 15 Bias–variance & CV formulas
BIAS OF AN ESTIMATOR AT $X_0$
Systematic error: how far the average prediction over training sets is from the truth.
VARIANCE OF AN ESTIMATOR AT $X_0$
Sensitivity: how much the prediction changes from one training set to another.
BIAS-VARIANCE DECOMPOSITION OF EXPECTED SQUARED ERROR
Valid for squared-error loss, with zero-mean noise in the test response that is independent of the training data. The term is irreducible: no model can remove it.
RIDGE REGRESSION ESTIMATE
Convention: is with samples in its rows, holds the responses, and the weights. The bias (intercept) is not penalised: and each column of are centred first, so drops out and is recovered afterwards. For , is always invertible. gives ordinary least squares (when is invertible), the lowest-bias and highest-variance member of the ridge family. drives (high bias, low variance). The penalty depends on the scale of each feature, so features are usually standardised first.
EXPECTED SQUARED ERROR OF $K$-NN REGRESSION AT $X_0$
Holds when the training inputs are fixed and with independent zero-mean noise of variance . Here are the training inputs nearest to , and is the average of their values. The middle term is bias squared, which usually grows with as farther neighbours are averaged in. The variance falls as grows.
ERROR ON ONE FOLD (REGRESSION, SQUARED ERROR)
is the number of samples in fold , and is the prediction of the model trained without fold . For classification, is the misclassification rate on fold .
$K$-FOLD CV ESTIMATE
Assumes equal-sized folds. With unequal folds, use . Number of models trained: , each on about samples.
LEAVE-ONE-OUT (LOO) CV ESTIMATE
LOO is -fold with . is the loss, and is trained on every sample except the -th, so models are trained, each on samples.
LOO SHORTCUT FOR ORDINARY LEAST SQUARES
Valid only for linear least squares with squared error, fitted once on all the data. is the full-data fit. is the -th diagonal entry of the hat matrix , with samples in the rows of . It requires to be invertible and . If an intercept is fitted, includes a column of ones. No refitting is needed.
MODELS TRAINED IN A GRID SEARCH
With several hyperparameters, the number of candidate settings is the product of the grid sizes. The is the refit on all the data. Leave it out if the question asks only about the search.
ACCURACY
Misleading when the classes are very unbalanced.
PRECISION
Of everything predicted positive, the fraction that is truly positive. Undefined if nothing is predicted positive.
RECALL (SENSITIVITY, TRUE POSITIVE RATE)
Of everything truly positive, the fraction found.
SPECIFICITY AND FALSE POSITIVE RATE
Specificity is the fraction of true negatives correctly identified.
F1 SCORE
The harmonic mean of precision and recall . TN does not appear in it.
Where this was asked: 2026 (2). See the 2 previous-year questions on Bias–variance & CV. This shows what was asked, not what will be asked.