Overfitting and underfitting
Not met yet
A model overfits when it memorises the answers instead of learning the rule: it follows the wobbles in its training data, so its training error is tiny and its error on anything new is big. It underfits when it's too simple to follow the pattern at all, and both errors stay big. A validation curve plots both errors against how flexible the model is: training error keeps falling, while validation error falls, bottoms out, then climbs. Choose the flexibility at the bottom of the validation curve.
Try it
main.pyOutput
Press Run and what your program prints shows up here.
Easy to get wrong
- Thinks a more flexible model always predicts new data better.
- Thinks a model with zero training error is a perfect model.
- Thinks validation error keeps falling as the model gets more flexible, the way training error does.
- Thinks underfitting means gradient descent was not run for long enough, rather than the model being too simple to follow the data.