The Lab · Learn
How AI actually works
Small pages that run on this device. Read the plain version, move the sliders, watch what changes, then say what you saw. Tap any word you do not know.
Lesson 10
Underfitting and overfitting
A model can be too simple to see the pattern, or so eager that it memorizes every quirk and mistake as if it mattered.
- It is like
- Like a student who crams last year’s exact exam answers. Perfect on that paper, lost on a new one.
- Why it matters at work
- A tool that looks perfect in the demo can fall apart on your real data. Always try it on cases it was not shown.
The exact idea
A model that is too simple misses the pattern, and one that is too flexible learns the noise as if it were pattern.
Words on this page
Try this
- Start at degree 1. The straight line misses the curve. That is underfitting.
- Move to degree 11. The curve passes through every point and the error on the points falls to almost zero.
- Turn on the real pattern at degree 11 and compare the two errors.
Change it
Ask for a button that adds fresh noisy points from the same pattern, drawn in a different shape.
Field notes
Reading the notes.