Overfitting & Underfitting

17 min read

A model can learn its training data too well and then fail on new data. This is called overfitting. In this lesson you see it happen, learn how to notice it, and learn the fixes.

New words

Training error
How wrong the model is on the data it learned from.
Test error
How wrong the model is on new data it has never seen.
Underfitting
The model is too simple, so it is wrong even on training data.
Overfitting
The model memorises the training data, noise included, and fails on new data.
Bias and variance
Bias is a too-simple model. Variance is a model that changes too much with the data.
Regularisation
A penalty that stops the model from becoming too complicated.
Validation set
A part of the data used to choose settings, before the final test.

What you will learn

  1. Why can a model be too good?
  2. What are training error and test error?
  3. What is underfitting?
  4. What is a good fit, and what is overfitting?
  5. What is the bias and variance idea?
  6. How do you notice overfitting?
  7. How do you fix overfitting?
  8. Try it: slide the flexibility
  9. Common mistakes
  10. Explain it to a friend
  11. Key takeaways

10 quiz questions at the end.

Start this lesson

The full lesson, with interactive demos and the quiz, opens after you sign in with Google. It is free.

All lessons · Back to the roadmap