Skip to content
GATEiit

GATE DA · Machine Learning

Bias–variance trade-off

Expected test error splits into irreducible noise, squared bias and variance; simple models underfit (high bias), flexible ones overfit (high variance), and GATE asks you to compute the parts and say how model choices move them.

Before you start

This topic comes before: Cross-validation: leave-one-out (LOO) and k-fold

Concept notes

1. The decomposition

Suppose y=f(x)+ε with E[ε]=0 and Var⁡(ε)=σ2. Train a model on a random training set D to get f^D. At a fixed point x, the expected squared error over training sets and noise is

  • Bias: how far the average prediction (over training sets) is from the truth. It comes from wrong assumptions, e.g. fitting a line to a curve.
  • Variance: how much the prediction changes from one training set to another. It comes from sensitivity to the particular sample.
  • Irreducible error σ2: noise in y itself. No model can remove it.

The proof uses the identity E[(Z−c)2]=Var⁡(Z)+(E[Z]−c)2 twice; the cross terms vanish because the noise is independent of f^D and has mean 0.

For an estimator θ^ of a parameter θ the same identity reads MSE(θ^)=Bias⁡(θ^)2+Var⁡(θ^). A slightly biased estimator can have lower MSE than an unbiased one if it cuts variance enough.

2. The trade-off and model complexity

As a model becomes more flexible, bias falls and variance rises. Test error, their sum plus noise, is U-shaped; training error keeps falling.

Symptom Training error Test error Diagnosis
Underfitting high high, close to training high bias
Overfitting low much higher than training high variance
Good fit low close to training balanced

Typical knobs (moving in the direction of more flexibility, i.e. lower bias, higher variance):

  • polynomial degree up; more features
  • kNN: smaller k (1-NN is the most flexible)
  • decision tree: deeper, smaller minimum leaf size
  • ridge / L2: smaller λ
  • SVM: larger C, larger RBF γ
  • neural network: more layers or units, fewer regularisation steps

The best complexity is at the bottom of the test-error curve, found with a validation set or cross-validation.

model complexity → error bias² variance test error noise σ² (irreducible) underfitoverfit
Bias² falls and variance rises with complexity; test error is U-shaped above the noise floor

3. Remedies for high bias and high variance

High variance (overfitting):

  • More training data: variance shrinks as n grows; bias does not change.
  • Regularisation: ridge, lasso, weight decay, dropout, pruning, early stopping.
  • Simpler model or fewer features.
  • Bagging (bootstrap aggregating) and random forests: averaging B predictors that each have variance v and pairwise correlation ρ gives variance ρv+1−ρBv, lower than v unless ρ=1. Bias stays about the same.

High bias (underfitting):

  • A more flexible model, more or better features (e.g. polynomial terms), less regularisation.
  • Boosting builds a strong model from many weak, high-bias learners and mainly reduces bias.
  • More data does not fix high bias: the error curves flatten at a high level.

Learning curves (error against training-set size) tell you which case you are in. With high bias, training and validation curves meet quickly at a high error. With high variance, there is a large gap that narrows slowly as n grows.

Example with the sample mean: Xˉ of n points with variance σ2 has bias 0 and variance σ2/n. The shrunk estimator cXˉ (0<c<1) has bias (c−1)μ and variance c2σ2/n, the textbook picture of trading bias for variance.

Formulas to remember

Bias–variance decomposition
E[(y−f^(x))2]=σ2+Bias⁡2+Var⁡
Bias
Bias⁡(x)=ED[f^D(x)]−f(x)
Variance
Var⁡(x)=ED[(f^D(x)−ED[f^D(x)])2]
Estimator MSE
MSE(θ^)=Bias⁡(θ^)2+Var⁡(θ^)
Shrunk mean estimator
Bias⁡(cXˉ)=(c−1)μ,Var⁡(cXˉ)=c2σ2n
Variance of an average of B correlated predictorsEach has variance v, pairwise correlation ρ
ρv+1−ρB v

Common mistakes

  • Adding bias instead of bias squared to the variance and noise.
  • Thinking more data fixes underfitting; it reduces variance, not bias.
  • Getting the direction of a knob wrong: larger k or larger λ means less flexibility (more bias, less variance).
  • Believing the irreducible error can be removed by a better model.
  • Assuming an unbiased estimator always has the lowest MSE.

Worked examples

Try each step yourself, then reveal the working.

Example 1: Bias and variance from repeated training

numerical

A model is trained on 4 independent training sets. At a test point where f(x0)=4, it predicts 3,5,4,6. The noise variance is σ2=1. Find bias², variance and the expected squared error.

  1. Step 1: Average the predictions.

    Try it on paper first.

Example 2: A biased estimator can win

numerical

X1,…,X4 are i.i.d. with mean μ=2 and variance σ2=16. Compare the MSE of Xˉ and of 0.5Xˉ as estimators of μ.

  1. Step 1: Sample mean.

    Try it on paper first.

Example 3: Moving the knob in kNN

conceptual

A kNN regressor uses k=1. Its training error is 0 and its validation error is high. What happens to bias and variance as k increases towards n?

  1. Step 1: Read the symptom.

    Try it on paper first.

Previous year questions

1 official GATE DA question on this topic, newest first.

Practise these 1 PYQs →

Topic test

9 questions: up to 1 official PYQs and original practice questions, with GATE marking (MCQ wrong answers lose marks). Score 60% or more to pass. A new set is drawn each time.

Mark as mastered

Loading your progress…

My revision notes

Notes written by the GATEiit team against the official GATE DA syllabus; being checked by a reviewer. Updated 2026-11-21. Spotted a mistake? Use Report an issue on any question, or contact us.