CONCEPT 21 / Generalization / Model complexity
Underfitting and overfitting.
Fit polynomial curves to noisy training points, then reveal untouched test points. Compare how training and test error change with complexity.
The curve can fit too little or too much
A small training sample is loaded. Choose flexibility before revealing the test set.
01 / Interactive visualLoaded example
Training data and fitted curve
Training error vs unseen-data error
Pale points are training examples. The test points and test-error curve remain sealed until you reveal them.
Error on seen and unseen data
Why it matters
A lower training error does not guarantee a better prediction on unseen points.