Overfitting is when a model memorizes its training data instead of learning the pattern. Crank the complexity, starve it of data, and watch it happen — then fix it with more data or regularization. Every model trains live on your device.
Every machine-learning failure story has the same villain: a model that looked brilliant on the data it was trained on and fell apart on data it hadn't seen. That's overfitting — the model memorized its homework instead of learning the subject — and it's easier to feel than to read about. This simulator lets you cause it, watch it, and cure it, with real models trained live in your browser on every slider move.
The train-vs-test error curve is the most reproduced figure in machine learning textbooks — and here it's computed live from your data. Training error only ever falls as complexity grows. Test error falls too, at first (the model is genuinely learning), then turns and climbs (now it's memorizing). The bottom of that U is the sweet spot; the gap between the curves on the right side is overfitting. Underfitting is the left side: a model too simple to capture the pattern at all, scoring badly on both sets.
The polynomial is a stand-in for every model: the same dynamics govern deep neural networks with billions of parameters. Complexity vs. data vs. regularization is the eternal triangle — it's why models are always evaluated on held-out test sets, why "it works on my training data" is the most dangerous sentence in ML, and why more data so often beats a cleverer model. Once you've watched the red curve thread the dots here, you'll recognize the pattern in every ML conversation you have.
A model memorizing its training data (including the noise) instead of learning the pattern, so it aces training and fails on new data. Crank the complexity slider here and watch training error fall while test error rises: that gap is overfitting, live.
The signature is training performance far better than validation performance. The simulator shows both errors side by side, and the U-shaped test curve reveals the complexity sweet spot between underfitting and memorization.
Noise averages out with more examples, making memorization harder and generalization easier. Drag the data-size slider up and watch the same complex model stop overfitting, which is why data beats cleverness so often.
A penalty on model complexity that discourages wild wiggles that chase individual points. Increase it here and watch an overfit curve relax toward the true pattern, trading a little training accuracy for better test accuracy.
Too simple a model misses the pattern (bias); too flexible a model chases noise (variance). The U-shaped test-error curve you generate with the sweep is the tradeoff made visible, with the best model at the bottom.