Overfitting: the difference between learning the rule and memorising
Be able to explain the difference between learning a rule and memorising specific examples.
Prerequisites
- AAccuracy: how good is the model?required
Everyday explanation
Two colleagues are preparing for a certification.
- Anna understands how the system works.
- Bo has memorised the exact answers from the manual: "Customer type A requires answer X", "Customer type B requires answer Y".
Both pass the exam on the examples included in the manual. But in practice, a customer type C appears — one that was not in the material. Anna can handle it. Bo is stuck.
Bo has overfitted: he knows the examples, not the rule. AI models do exactly the same thing.
Intuition
Why we test on new examples. If the model only answers questions it has been trained on, you are measuring its memory, not its competence.
| Training examples | New examples | What it means | |
|---|---|---|---|
| Good model | 92 % | 89 % | has learned the pattern |
| Overfitted | 100 % | 61 % | has memorised |
| Underfitted | 58 % | 56 % | has learned nothing at all |
The difference between the columns is the warning light.
What helps? More and more varied examples, or a simpler model that does not have room to memorise. It is roughly like Bo needing to see more different customer cases — or someone removing his cheat sheet.
Mastery means
- Distinguishes between learning the rule and memorising the examples
- Explains why we test on new examples
Sign in to do the exercises and build your mastery up.
Sources
- CS Unplugged (CC BY-SA 4.0) — CC BY-SA 4.0
- scikit-learn User Guide (BSD-3) — BSD-3-Clause