Q&A-1Explain bias, variance, and irreducible noise.
Answer
Bias is systematic error: across plausible training samples, the average fitted predictor misses important structure. Variance is sensitivity: predictions change substantially depending on which sample was fitted. Irreducible noise is outcome variability not predictable from the defined information set. For squared loss, with y = f(x) + ε, E[ε] = 0, Var(ε) = σ², and ε independent of the training set, the expected test error at a point x decomposes as:
E[(y − f̂(x))²] = (E[f̂(x)] − f(x))² + E[(f̂(x) − E[f̂(x)])²] + σ²
That is bias² + variance + noise. In an interview I would say: if train error is low and validation error is high, variance dominates; if both are high and close, bias dominates; if validation error is near the noise floor, you are done.
Worked example (hypothetical simulation, rounded). True f(x) = x² on x ∈ [−1, 1], noise ε ~ N(0, 0.2²), so σ² = 0.04. Draw 200 training sets of n = 20, fit least-squares polynomials of degree 1, 2, and 9, and evaluate at x = 1.0.
| degree | bias² | variance | noise | total |
|---|---|---|---|---|
| 1 | 0.444 | 0.008 | 0.04 | 0.492 |
| 2 | ~0 | 0.012 | 0.04 | 0.052 |
| 9 | ~0 | 0.45 | 0.04 | 0.49 |
Why those numbers: a linear fit on symmetric x has slope 0 and intercept mean(y) = mean(x²) = 1/3. At x = 1, the average prediction is 1/3, so bias = 1/3 − 1 = −2/3 and bias² = 4/9 ≈ 0.444. Degree 2 can represent x² exactly, so bias is ~0; its variance comes only from noise. Degree 9 also has ~0 bias but many degrees of freedom to chase noise, so its variance at the edge explodes. The U-shape is the trade-off: as complexity rises, bias falls and variance rises; noise stays fixed.
Failure modes and detection. High variance shows up as a large train/validation gap: train MSE = 0.01, validation MSE = 0.30, gap 0.29. High bias shows up as both high and close: train MSE = 0.25, validation MSE = 0.27. Irreducible noise shows up as validation MSE ≈ σ², e.g. 0.04 when σ² = 0.04. Learning curves separate them: a curve that converges to a high plateau is bias; a persistent gap that shrinks slowly with more data is variance. Residual plots help: structure left in residuals means bias; residuals that look like noise but predictions swing across folds means variance.
Trade-offs and alternatives. Ridge adds λ‖w‖², trading higher bias for lower variance; more data reduces variance roughly as 1/n without touching bias; a simpler model does the opposite. Deciding criteria: if variance dominates, add data or regularize; if bias dominates, add features or increase capacity. The decomposition is not directly observable in production because you do not get repeated training sets. For 0-1 loss the additive form does not hold, so use validation curves or bootstrap estimates instead. Distribution shift breaks the noise assumption: σ² is only irreducible relative to the defined information set and the training distribution.
Curated: · Written: · Reviewed:
Log in free to save your progress and keep bookmarks and notes for a quick revision before your interview.