TensorTau PathToAGI Doing Machine Learning Honestly Level 05

Level 05 · Doing Machine Learning Honestly · Chapter 057

Bias-Variance Tradeoff

Why can a model be wrong because it is systematically too simple—or because it changes too much when the training sample changes?

1. Two kinds of instability

Imagine repeatedly collecting new training sets from the same world and fitting a model each time.

High bias: all fitted models miss in a similar way.

High variance: the fitted model changes dramatically from sample to sample.

high bias:      ××× far from target
high variance:  ×   ×  × scattered around target

2. Squared-error decomposition

For regression, expected prediction error can be decomposed conceptually as

error=bias2+variance+irreducible noise.\text{error}=\text{bias}^2+\text{variance}+\text{irreducible noise}.

Bias asks whether the average prediction is systematically wrong. Variance asks how sensitive the learned prediction is to the sampled training data.

3. Complexity moves the balance

A rigid model tends toward high bias and low variance. A very flexible model tends toward lower training bias but can have high variance.

This is why model selection is not “choose the most powerful model.” We want the model/training setup with the best unseen-data behaviour.

4. Ensembles revisit the idea

Random Forests average many unstable trees. Averaging can reduce variance while retaining useful nonlinear structure. Boosting often attacks bias by adding corrections. Earlier algorithms now fit into a larger statistical story.

5. Modern deep learning nuance

The classical U-shaped story is useful, but modern overparameterized networks can show more complicated phenomena such as double descent. Treat bias–variance as a diagnostic lens, not an absolute law about parameter count.

What to Remember

Bias is systematic error; variance is sensitivity to sampled data. Good generalization requires managing both.

Next → Regularization: can we deliberately discourage a flexible model from using its freedom in fragile ways?

Six ways to work the chapter, climbing from explaining it in your own words to investigating it like a researcher. Reading is not enough — this is where the chapter lands.

  1. Explain: Distinguish bias from variance using dartboards.
  2. Calculate: Given errors from several fitted models, compute mean prediction and variance.
  3. Predict: Which usually has higher variance: a depth-2 or unrestricted tree?
  4. Break: Bootstrap a small dataset and show an unstable learner changing across samples.
  5. Build: Estimate empirical bias/variance on synthetic data where the true function is known.
  6. Investigate: Compare one tree with a random forest across bootstrapped datasets.