intermediatemachine-learning

Bias-Variance Tradeoff

Every model has two sources of error: being too rigid (bias) or being too jumpy (variance). You cannot eliminate both.

Key Points

What it is

Bias is the error from wrong assumptions in the model. A linear model trying to fit a curve has high bias – it will never fit well no matter how much data you give it. Variance is the error from being too sensitive to small changes in the training data. A deep decision tree has high variance – if you change a few training examples, the tree looks completely different. The tradeoff says that decreasing bias often increases variance, and vice versa. The best model balances the two.

Why it exists

The tradeoff exists because of a simple fact: any model that is flexible enough to fit many different patterns will also be easily misled by random noise. A simple model is stable but might miss the pattern. You have to choose where on this spectrum you want to be. More data helps reduce variance without increasing bias, but bias can only be reduced by changing the model family.

What it measures

Bias is the difference between the average prediction of your model (over many different training sets) and the true value. High bias means the model consistently misses the target. Variance is how much your model's predictions vary from one training set to another. High variance means small changes in training data cause big changes in predictions. You cannot directly measure bias and variance from a single training run – you need to train many models on different subsets of data.

Intuition

Imagine shooting arrows at a target. Bias is how far your average shot is from the bullseye. If all arrows cluster to the left, you have high bias. Variance is how spread out your arrows are. If they are all over the place, you have high variance. Low bias and low variance means all arrows hit the bullseye in a tight cluster – perfect. Low bias but high variance means the average is bullseye but arrows are scattered. High bias low variance means all arrows are tight but off target (e.g., all high and left). High bias high variance means arrows are everywhere and off target. You want to minimize both, but often fixing one worsens the other.

Formulas

Expected test error

Error=Bias2+Variance+σ2\text{Error} = \text{Bias}^2 + \text{Variance} + \sigma^2
  • Bias² — how far the model's average prediction is from the truth, squared
  • Variance — how much predictions change across different training sets
  • σ² — irreducible noise in the data – you cannot remove it

When to use

When not to use

Common mistakes

In practice

When you debug a model, think: is the error due to high bias (underfitting) or high variance (overfitting)? Learning curves tell you. If both training and validation error are high and flat, it is bias. Add features, use a more complex model. If training error is low but validation error is high, it is variance. Add regularization, get more data, or simplify. In practice, you often trade off by tuning hyperparameters like tree depth or regularization strength.

Was this concept helpful?

Spot an error or gap? Suggest an edit →

Related concepts

underfitting-overfittingcross-validationregularizationensemble-methods
Chirp at me!