Polynomial degree 3
More wiggle room. Watch test error rise after the sweet spot.
Reg. λ 0.000
Penalty on large weights. Tames high-degree wiggle.
Train points (n) 20
More data tames overfitting at the same degree.
Noise σ 0.20
Set σ=0 and overfitting can't happen. Why?
Train MSE
-
Test MSE (held out)
-

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 test MSE. Plots both curves. Diagnostic: if train ≈ test and both high → underfitting (more capacity); if train low + test high (gap) → overfitting (more data or regularization); if both converging low → good.

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

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

Increase complexity, then compare training error, test 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 test MSE (vs train MSE) is:

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

🧪 Student response packet

Predict which model will fit training data best, compare train and test 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.