How is expected mean squared prediction error decomposed into bias, variance, and noise?
Quick Overview
Derive and explain how expected squared prediction error splits into bias squared, variance and irreducible noise. Tests whether you know what the expectation is taken over, what drives each term, why the cross terms vanish, and which losses the additive form fits.
How is expected mean squared prediction error decomposed into bias, variance, and noise?
Role: Machine Learning Engineer
Category: Machine Learning
Difficulty: medium
Interview Round: Other
How is expected mean squared prediction error decomposed into bias, variance, and noise?
Assume the data come from $y = f(x) + \varepsilon$ with zero-mean noise, and a model $\hat f_D$ is fit on a random training set $D$. Write the decomposition at a fixed input $x$ and explain what each term means.
```hint Add and subtract
Write $y - \hat f_D(x)$ as a sum of three differences by adding and subtracting the average prediction over training sets, then square and take expectations.
```
```hint Watch the cross terms
Check which random quantities each cross term depends on and what their expectations are.
```
### What a Strong Answer Covers
- The data-generating assumptions and which random quantities the expectation is taken over.
- A definition of each of the three terms and what drives each one in practice.
- Why the cross terms vanish when the squared error is expanded.
- How the pointwise result extends to overall test error, and which losses the additive form applies to.
### Follow-up Questions
- With only one dataset, how would you estimate the bias and variance of a real model?
- How do bagging and L2 regularization change each of the three terms?
- What does a decomposition for 0-1 loss look like, and why does it not add up as neatly?
Overview: Derive and explain how expected squared prediction error splits into bias squared, variance and irreducible noise. Tests whether you know what the expectation is taken over, what drives each term, why the cross terms vanish, and which losses the additive form fits.
How is expected mean squared prediction error decomposed into bias, variance, and noise?
Assume the data come from y=f(x)+ε with zero-mean noise, and a model f^D is fit on a random training set D. Write the decomposition at a fixed input x and explain what each term means.
What a Strong Answer Covers Guidance
The data-generating assumptions and which random quantities the expectation is taken over.
A definition of each of the three terms and what drives each one in practice.
Why the cross terms vanish when the squared error is expanded.
How the pointwise result extends to overall test error, and which losses the additive form applies to.
Follow-up Questions Guidance
With only one dataset, how would you estimate the bias and variance of a real model?
How do bagging and L2 regularization change each of the three terms?
What does a decomposition for 0-1 loss look like, and why does it not add up as neatly?