Week 6 · Deep Learning

Error vs Model Complexity

Training error, test error, bias, variance, underfitting and overfitting, on one page.

Video explanation

Error vs model complexity (2 min 24 s): why the training curve only falls, why the test curve is a U, and why the far-left model is high bias / low variance.

The bias–variance tradeoff (3 min 35 s): bias and variance shown with many models trained on different datasets, the U-curve, and how loss-vs-epoch plots map onto it.

The graph

sweet spot error model complexity → test error (U) training error ↘ underfit overfit big gap = high variance
x-axis: model complexity (simple → complex). y-axis: error.
CurveShapeWhy
Training errorAlways decreasing ↘A more complex model can always fit its own training data at least as well
Test errorU-shaped ↘↗Falls at first (learns the pattern), then rises (starts fitting noise)

Bottom of the test U = sweet spot (the best model).

The two ends

PositionTrain errorTest errorGapDiagnosis
Far left (too simple)HighHighSmallUnderfit = high bias, low variance
Sweet spotLowLowestSmallGood fit = low bias, low variance
Far right (too complex)Very lowHighLargeOverfit = low bias, high variance

Bias and variance: what they mean

Bias: how far the average model is from the truth. It comes from the model being too simple.

Variance: how much the model changes when the training data changes. It comes from the model being too complex.

Tradeoff: as complexity goes up, bias ↓ and variance ↑.

Test error ≈ bias² + variance + irreducible noise

Quick rules for exams

  1. A curve that only goes down is training error.
  2. A U-shaped curve is test / validation error.
  3. Both errors high and close together → high bias (underfit).
  4. Training error low but test error high (big gap) → high variance (overfit).
  5. Loss increasing over epochs is not bias or variance. It means the learning rate is too high.
  6. More epochs ≈ more complexity, so the validation curve is the same U. Stopping at its bottom is early stopping.

Practice question (ET Jan 25)

Plot of error vs model complexity. Curve (1) is U-shaped, curve (2) keeps decreasing, point (3) is at the far left.

(1) = test error ✔  ·  (2) = training error ✔  ·  (3) = high bias, low variance ✔

Answer: options 1, 2 and 3. The other three options swap these labels.