Prediction Error & Bias-Variance
Distinguish the error of one fitted model from the average performance of a learning procedure. Then separate prediction error into noise, bias, and variance.
Which Error Are We Measuring?¶
Let and let be an independent new pair.
| Quantity | Definition | What is averaged? |
|---|---|---|
| Training error | Losses on observations used to fit. | |
| Conditional generalization error | New inputs and outputs, keeping the fitted rule fixed. | |
| Average generalization error | New observations and repeated training sets of size . |
Model assessment estimates predictive performance. Model selection compares algorithms, model classes, or tuning choices. Reusing an assessment set for selection makes its reported error optimistic for the selected choice.
Train-Test Splitting¶
Split observations into disjoint training and test sets. Fit only on and compute
For an independent, representative test set and a fitting procedure chosen without inspecting it,
Increasing the test size improves precision for this fixed fitted model. The estimate does not directly assess a different model refitted on all the data.
| Data role | Permitted use |
|---|---|
| Training | Estimate coefficients and all learned preprocessing steps. |
| Validation or inner CV | Choose the algorithm, features, and tuning parameters. |
| Final test or outer CV | Assess the completed selection procedure. |
A split spends data on both fitting and evaluation. With limited data, cross-validation reuses observations across different fitting/evaluation roles while keeping each scored prediction held out.
Why Training Error Can Mislead¶
An interpolating rule can satisfy for every training observation, giving zero training error. Its behaviour between those points can still be poor. Zero residuals impose no general guarantee about loss at new inputs.
A training score is not always numerically below a realized test score. Optimism is an expectation statement under specified assumptions, not a pointwise inequality for every data split. The exact fixed-input version is developed on the next page.
Bias-Variance Decomposition¶
Compare the average fitted prediction across training sets with the true regression function. Square that difference before adding it to prediction error.
Hold the input fixed and change the training set. Prediction variance measures how much the fitted prediction moves.
Write
| Component | Interpretation | Can fitting reduce it? |
|---|---|---|
| Irreducible noise | Different responses at the same input. | Not using these inputs alone. |
| Squared bias | Distance between the average fitted prediction and the truth. | A richer suitable model may help. |
| Variance | Sensitivity of the prediction to the training sample. | More data, averaging, or constraints may help. |
Normality is unnecessary for this identity. Finite second moments and the independent new observation are the key requirements.
Derivation: Two Vanishing Cross Terms
Complexity & Prediction¶
Increasing flexibility often reduces approximation bias but increases sensitivity to the training data. This motivates a balance; it does not prove that every algorithm has a U-shaped test-error curve or monotone bias and variance.
Training squared error cannot increase when least squares is minimized exactly over nested model classes. This fact alone says nothing about their ordering on new data.
Connection to classical regression: under the Gauss-Markov assumptions, least squares is best among linear unbiased coefficient estimators. That restricted variance comparison does not establish that it has the smallest prediction error among biased or nonlinear alternatives.