Log inStart free
LESSON 4.14 · 6 STAGES · 3 CONTROLS · 3 CHECKSPRO · PREVIEW

The bias–variance tradeoff

Watch many fits of one curve split their error into bias and variance.


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

Go Pro · $8.25/mo
EXPLAINER · 4.14 · FIT BAYDEGREE 3 · 10 POINTS · TRAINING ERROR 0.069
01
Stage 1 of 6 · One fit
10 noisy points come from the true curve f. A degree-3 polynomial fits them by least squares.
Explain it simply

The dashed curve is the truth. In real life you never see it. Each teal point is the true value plus random noise. The blue curve is the degree-3 polynomial with the smallest squared misses on these points. Its training error is 0.069.

10 training points around the dashed true curve, and a degree 3 fit through them.

training points yfits ĝ, average fit ḡ, test errorbias² (solid), variance (light)true curve f (dashed), noise σ²training error
−1−0.500.51−2−1012xytraining set 1 · degree 3f(x)ĝ(x)0.00.20.40.60.80123456789degree derror−1−0.500.51−2−1012xytraining set 1 · degree 3f(x)ĝ(x)0.00.20.40.60.80123456789degree derror
Toy: f(x) = sin(3.5x + 0.4) · n fixed inputs · 200 noisy training sets · least squares · seeded
STAGE 1 / 6
MATH · STAGE 1HOVER A SYMBOL OR A SHAPE
g^(x)=∑j=0dwj xj,min⁡w∑i=1n(yi−g^(xi))2\sy{g}{out}{\hat g(x)} = \sum_{j=0}^{d} \sy{w}{param}{w_j}\, x^j,\qquad \min_{w} \sum_{i=1}^{n} \big(\sy{y}{data}{y_i} - \hat g(x_i)\big)^2
g^(x)=0.49+3.51x−1.10x2−4.97x3,train=0.069\hat g(x) = 0.49 + 3.51x - 1.10x^{2} - 4.97x^{3},\quad \text{train} = 0.069

The fit picks the weights that make the squared misses smallest.

Common mix-ups

MYTHMore training data cures an underfit model.

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

Predict, then reveal
3 CHECKS · PRO
Q01If the degree goes from 3 to 9, does the variance grow or shrink?

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

PRO LESSON · YOU WATCHED STAGE 1 OF 6
Unlock the full explainer
  • 5 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.