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. Underfitting occurs when a prediction rule fails to capture useful structure in the target relation. A straight-line polynomial regression fitted to a genuinely quadratic noiseless target illustrates a representational limitation. Poor prediction alone does not identify the cause: compare candidate rules using cross-validation or a validation set, while keeping the final test set reserved for assessment.
