Skip to content

Beginning of the lesson

Overfitting and Underfitting: The Central Problem of Machine Learning

Every machine-learning model has one real job: to work well on data it has never seen before. That skill has a name — generalization. A model that scores 100% on its practice questions but fails the real exam has learned nothing useful. In this lesson we meet the two ways a model can fail to generalize, learn to spot each one from just two numbers, and collect a toolbox of fixes for both.

This is arguably the most important idea in the whole field. You can master every algorithm in this course, but if you cannot tell whether your model is overfitting or underfitting, you cannot fix it. By the end of this lesson you will diagnose any model like a doctor reading a chart.

What you will learn
  • What generalization means, and why we split data into a training set and a test set.
  • Underfitting — a model too simple to capture the real pattern.
  • Overfitting — a model so flexible it memorizes noise instead of the pattern.
  • The telltale signature: reading train error vs test error to diagnose which problem you have.
  • Bias and variance in plain words, and the dartboard analogy.
  • The model-complexity curve and the sweet spot.
  • Concrete remedies for both problems, including regularization, early stopping, and cross-validation.

The big idea: learning the pattern, not the noise

Continue this lesson on YourAIZone

The full lesson has the complete explanation, worked examples, common mistakes, tests with instant checking and an AI tutor. Start right away as a guest, or create an account to keep your progress.

In the full lesson

  • The complete explanation
  • Worked examples
  • Common mistakes and how to avoid them
  • Test questions: 15
  • AI tutor that answers questions about the topic
  • Progress tracking for students, parents and teachers