0230
Overfitting
A model that scores perfectly on its training data is not always good. If it memorises the exact examples, including their noise, it fails on anything new. That gap is overfitting.
The dots are training data; the curve is the model. A simple curve captures the real trend but misses some points, so training error stays a little high. Crank up complexity and the curve bends through every dot, driving training error toward zero, but it now chases noise and does worse on unseen data. Watch test error fall then rise: the sweet spot is the model simple enough to generalise.
simplecomplex
train error: 28test error: 25
Check yourself
The most complex curve fits the training dots perfectly. Why does its test error get worse, not better?
Go deeper (free): Google ML Crash Course — Overfitting ↗