ML0040 Bias and Variance

Can you explain the bias-variance tradeoff?

Answer

The bias-variance tradeoff decomposes a model’s expected prediction error into three parts: squared bias, variance, and irreducible noise. Bias is the error from overly simplified assumptions: a high-bias model misses the real pattern and underfits. Variance is the error from sensitivity to the particular training sample: a high-variance model wiggles to fit noise and overfits. The tradeoff arises because increasing model complexity typically decreases bias but increases variance, while simplifying does the reverse: total error as a function of complexity is U-shaped, and the goal is the sweet spot that minimizes the sum. Practically, high bias shows as large training error; high variance shows as a large gap between training and validation error, and each has its own remedies (more capacity/features for bias; more data, regularization, or simpler models for variance).

(1) Bias: Error from wrong assumptions: underfitting, poor fit on both train and test data.
(2) Variance: Error from sample sensitivity: overfitting, big train/test gap.
(3) Tradeoff: Complexity trades one for the other; total error = \text{Bias}^2 + \text{Variance} + \sigma^2 is U-shaped: minimize the sum.

Bias squared decreasing, variance increasing, and U-shaped total error versus model complexity with the optimum marked

Figure 1: The classic tradeoff curve: bias² falls and variance rises as complexity grows; total error is their U-shaped sum, and the best model sits at the minimum, not at maximum complexity.

Mathematical Formulation:
\mathbb{E}\big[(y - \hat{f}(x))^2\big] = \underbrace{\big(\mathbb{E}[\hat{f}(x)] - f(x)\big)^2}_{\text{Bias}^2} + \underbrace{\mathbb{E}\big[(\hat{f}(x) - \mathbb{E}[\hat{f}(x)])^2\big]}_{\text{Variance}} + \underbrace{\sigma^2}_{\text{noise}}

Where:

  • f(x) is the true relationship and \hat{f}(x) the model’s prediction; expectations are over training sets.
  • \text{Bias}^2 measures how far the average model is from the truth; \text{Variance} how much predictions scatter around that average.
  • \sigma^2 is the irreducible error: noise in the data itself that no model can eliminate.
Three panels showing underfitting with high bias, a good balance fit, and overfitting with high variance

Figure 2: The tradeoff on real-shaped data: the high-bias model is too rigid to follow the curve (both errors high); the high-variance model chases every noisy point (train error low, test error high); the balanced model tracks the true function and minimizes test error.


Login to view more content


Log in to track your progress

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *