Polynomial degree 3
More wiggle room. Watch validation error change after the useful region in this generated sample.
Reg. λ 0.000
Penalty on large weights. Tames high-degree wiggle.
Train points (n) 20
More data can reduce variance at the same degree, but does not guarantee good generalization.
Noise σ 0.20
Set σ=0. Does the train-validation gap disappear for every target and degree?
Train MSE
-
Validation MSE (repeatedly viewed)
-

Fit on training data

MSE vs degree (this λ, this dataset)

📈 Learning curves (vary n at fixed degree)

Fixes the current degree, λ, regularizer, and noise; varies n from 5 → n_max. For each n, draws a fresh sample of n training points and computes train and validation MSE. Plots both curves. Diagnostic: if train ≈ validation and both high → possible underfitting; if train low + validation high (gap) → possible overfitting; if both converge low → better evidence of generalization on this validation sample.

150 3
(click "Run learning curves")
✨ Featured comparison
Featured comparison

Push model complexity until training error looks great, then check validation error. The best-looking fit is often the least useful model.

Increase complexity, then compare training error, validation error, and the visible curve.

🧭 Visual explanation

Live state to watch
No state captured yet. Run or adjust the applet first.
Misread to avoid

📚 Lesson tour (5 steps)
Step 1/5: -

-

📝 Worksheet (3 questions)

Q1. Set degree=20, n=20, λ=0, sine truth. The train MSE is approximately:

Q2. Same settings as Q1. The validation MSE (vs train MSE) is:

Q3. Keep degree=20. Now raise λ from 0 to 0.5. Validation MSE goes:

🧪 Quick Assign · QA-OVERFIT-01 · 10–15 min
QA-OVERFIT-01 · Level 1 · 10–15 min
Fit the training set, fail the future

Predict which model will fit training data best, compare train and validation error, then explain why generalization can fail.

State snapshot appears here.
♿ Text and keyboard support

Text and keyboard support

Keyboard path

  • Use Tab and Shift+Tab to move through controls.
  • Use Enter or Space on buttons, and arrow keys on sliders or select controls.
  • The visual region is focusable and described by the state summary below.

Text state summary

Reduced motion and non-visual support

Reduced-motion settings are honored where possible. The current state is also available as text, so the main result does not depend only on color, animation, or spatial position.

Accessibility note: this layer gives a text equivalent for the applet state. It does not replace a full human screen-reader audit.