If you retrained the exact same model on a slightly different sample of the same data, would it come back with the same answer?
Drag degree up. At 0 or 1, the fit is too stiff to follow the true curve's bend — it's wrong in the same way no matter which noisy sample you'd trained on. By degree 4, it bends through every single point exactly, chasing this sample's specific noise instead of the shape underneath it.
Retrain that same degree on several different noisy samples of the same underlying data, and two separate error sources fall out:
- — a fixed input point, evaluated across many resampled fits.
- — the true underlying function's value at .
- — one trained model's prediction at .
- — the average prediction at , across many resampled fits.
- Bias: how wrong the average fit is
Bias is how wrong the average fit is — high when the model is too simple to represent the true shape.
- Variance: how much the fit swings
Variance is how much the fit swings from one sample to the next — high when the model is flexible enough to chase noise.
- Total error decomposes into both
Total expected error is bias² + variance (plus noise no model can remove).
Now all six resampled fits are drawn at once. At low degree they nearly overlap — consistently wrong, low variance — but sit visibly off the true dashed curve: that gap is bias. At high degree they fan out wildly from each other, each one perfectly tracing its own sample's noise: high variance, but their average lands close to the truth.
The true curve here is exactly quadratic.
- Degree 0 — too stiff
Just the mean, across the six samples:
- bias² — it structurally cannot bend, so it's consistently wrong by roughly the same amount every time
- variance is a tiny
- Degree 4 — too flexible
With exactly enough parameters to hit all five points exactly:
- bias² drops to
- variance explodes to , nearly 50 times higher
- Degree 2 — matches the true shape
- Bias²
- a modest variance of just
The lowest total error of any degree tried.
Find the degree that minimizes total error (bias² + variance) — neither the stiffest nor the most flexible model wins.
Every model choice in this book so far — tree depth, forest size, boosting rounds, polynomial degree — has secretly been tuning this same tradeoff. Too simple underfits with high bias; too flexible overfits with high variance. The next chapter looks at a direct way to fight the variance side, without giving up flexibility outright.