Log inStart free
LESSON 4.13 · 5 STAGES · 3 CONTROLS · 3 CHECKSPRO · PREVIEW

Overfitting and underfitting

Watch polynomials of three sizes fit the same noisy points, then face new data.


Pro lesson. Stage 1 is free to watch. Pro opens all 5 stages, 3 controls and 3 checks, in this lesson and every other.

Go Pro · $8.25/mo
EXPLAINER · 4.13 · FIT BAY10 TRAINING POINTS · NOISE 0.2 · 30 HELD OUT
01
Stage 1 of 5 · Noisy data
10 training points come from a hidden curve plus noise with σ = 0.2. The model never sees the curve.
Explain it simply

The dashed gray line is the hidden rule. Each teal dot is one training point: the rule's value plus a random nudge of about 0.2. That nudge is noise, the part of y that no model can predict. The model only sees the dots, never the line.

A plot of y against x from 0 to 1. A dashed gray curve, y = sin 2πx, rises to 1 and falls to −1. 10 teal training points scatter around it with noise σ = 0.2.

training points (filled), validation points (hollow)the fitted polynomialerrors: gaps, training and validation errordegree and noise σthe hidden curve and the noise floor σ²
00.250.50.751−2−1012xytraining pool · the first 10 of 40validation · 30 held out00.250.50.751−2−1012xytraining pool · the first 10 of 40validation · 30 held out
Toy: y = sin 2πx + noise · up to 40 training and 30 validation points
STAGE 1 / 5
MATH · STAGE 1HOVER A SYMBOL OR A SHAPE
y=sin⁡(2πx)+ε,ε∼N(0, σ2)\sy{y}{data}{y} = \sy{f}{ink}{\sin(2\pi x)} + \sy{eps}{grad}{\varepsilon},\qquad \varepsilon \sim \mathcal N(0,\ \sy{sigma}{param}{\sigma}^2)
y=sin⁡(2π⋅0.22)−0.13=0.98−0.13=0.85y = \sin(2\pi\cdot 0.22) - 0.13 = 0.98 - 0.13 = 0.85

Each point is the curve's value plus random noise of size σ.

Common mix-ups

MYTHA lower training error always means a better model.

The fix, and 1 more mix-up with the diagram to show them, come with Pro.

Predict, then reveal
3 CHECKS · PRO
Q01With 10 training points, set the degree to 9. What happens to the training error?

Make your guess, then test it in the diagram. All 3 checks come with Pro.

PRO LESSON · YOU WATCHED STAGE 1 OF 5
Unlock the full explainer
  • 4 more stages and 3 live controls
  • 2 mix-up cards and 3 predict-then-reveal checks
  • Watch it as a narrated video, in three voices
  • Every Pro lesson and capstone · 656 in total

$99 a year, or $15 a month. Cancel any time.