Overfitting Created 2026-09-24 Updated 2026-10-14
Overfitting occurs when further adaptation improves training error while degrading performance on new data, for example by fitting incidental disturbances instead of a stable regression function. A gap between training error and test error alone does not prove that a simpler rule would generalize better. Compare candidates using cross-validation or a validation set; reserve the test set for assessment. Regularization and early stopping can limit adaptation. [ref]
https://web.stanford.edu/~hastie/ISLR2/Slides/Ch2_Statistical_Learning.pdf. ISLR chapter 2 slides, assessing model accuracy
Evaluate the training error example at , , none coinciding with a training input. The mean squared discrepancy is , , and for degrees 1, 2, and 7. Thus degree 7 improves training error but worsens recovery of the target relative to degree 2. Degree 1 misses the target's curvature, illustrating underfitting.
These are errors against a known noiseless target, not test errors against fresh noisy responses. In a separate noiseless control, degrees 2 and 7 both recover this target exactly; their numerical held-out errors are approximately and . The fixed-disturbance simulation illustrates a mechanism, not a universal numerical benchmark or a claim that higher polynomial degree always harms generalization.
Noisy polynomial fitting, training-only degree selection, and separate noiseless-target evaluation
. Details. Past exam of the mathematics course of the University of Cambridge 2024 iii Paper 218 2 d Solution Created 2026-09-24 Updated 2026-09-25
The solid curve is the test errorand the dashed curve is the training error . As the horizontal coordinate tends to , , so every penalized slope tends to zero and . The two limits are thereforerespectively.
As the horizontal coordinate tends to , and the fit approaches the ordinary least squares fit . Hence the solid curve tends to , which the plot shows is approximately .
Test set Created 2026-09-28 Updated 2026-10-14
A test set is held out from both parameter fitting and model selection and is used to estimate the final selected procedure's prediction error. A validation set influences the choice; a test set assesses that choice after it is fixed. The distinction concerns how observations are used, not their file names.
For a fixed rule and an independent test set of size from the target probability distribution,This test error is an estimate, with sampling uncertainty; it is not a guarantee for each future prediction. Dataset shift changes what performance the estimate represents.
In the overfitting example, all degree choices are fixed in advance, cross-validation uses only training data, and the selected degree is locked before evaluating 400 separate points. Displaying the other curves afterward explains their behavior; it does not authorize selecting by those scores. Repeatedly inspecting a test set and changing the model makes it part of model selection, introducing data leakage and potentially optimistic assessment. [ref]
https://jmlr.org/papers/v11/cawley10a.html. Cawley and Talbot, over-fitting in model selection, 2010
