DoodleR28Overfitting (theaihow doodle Short #28)
Duration 01:34 · voice ElevenLabs b3LAxfqGNXNMzmX4iSAv

[00:00] Your model scores brilliantly in training and falls apart on real data. Let me draw the two ways a fit goes wrong.

[00:07] Here are your data points, and here is the true pattern underneath them, which you never get to see.

[00:13] Attempt one. A straight line. It misses the curve everywhere, on the training data as much as anywhere else.

[00:20] That is underfitting. The model is too simple to hold the shape of the thing you are teaching it.

[00:26] Attempt two. A gentle curve. It rides the pattern, and it is wrong by a little in places, which is fine.

[00:33] Attempt three. A wild line that passes exactly through every single point.

[00:38] So why is that one bad, when it is never wrong?

[00:41] Because the points are not the pattern. They carry noise, and a line that hits all of them has learned the noise as if it mattered. That is scikit-learn's own phrasing, it learns the noise of the training data.

[00:52] So on training data it looks perfect, and on the next point it has never seen, it lurches.

[00:58] Which is why training error is not the test. You check on data the model never trained on.

[01:04] The standard way is cross-validation. Hold out part of the data, fit on the rest, measure the error on the held out part, and rotate.

[01:12] So you are steering between two failures. Too simple to see the pattern, and so flexible it memorises the dots.

[01:20] So which one bit you last, too simple or too clever? Tell me in the comments. Follow for more AI concepts in drawings. And if you are building AI tools at work, we help teams do it properly. The A.I. How dot com.
