Back to AI Math Mind Map
中文·English
📐 AI MathID: bias-variance

Bias-Variance Decomposition

偏差方差分解
🎯Core Definition
The bias-variance decomposition splits expected squared test error into three terms: EGE=Bias2+Var+σ2\text{EGE} = \text{Bias}^2 + \text{Var} + \sigma^2. Assume the true relation y=f(x)+ϵy = f^*(x) + \epsilon with E[ϵ]=0\mathbb{E}[\epsilon] = 0, Var(ϵ)=σ2\text{Var}(\epsilon) = \sigma^2, and ϵ\epsilon independent of the input; the model f^\hat f is fit on a random training set DD, and fˉ(x)=ED[f^(x)]\bar f(x) = \mathbb{E}_D[\hat f(x)]. Full proof (for fixed xx): rewrite yf^=ϵ+(ff^)y - \hat f = \epsilon + (f^* - \hat f) and expand: E[(yf^)2]=E[ϵ2]+2E[ϵ(ff^)]+E[(ff^)2]\mathbb{E}[(y - \hat f)^2] = \mathbb{E}[\epsilon^2] + 2\mathbb{E}[\epsilon(f^* - \hat f)] + \mathbb{E}[(f^* - \hat f)^2]. The cross term vanishes because ϵ\epsilon is independent of the training set DD (hence of f^\hat f) and E[ϵ]=0\mathbb{E}[\epsilon] = 0: 2E[ϵ(ff^)]=2E[ϵ]E[ff^]=02\mathbb{E}[\epsilon(f^* - \hat f)] = 2\mathbb{E}[\epsilon]\mathbb{E}[f^* - \hat f] = 0. For the third term, write ff^=(ffˉ)+(fˉf^)f^* - \hat f = (f^* - \bar f) + (\bar f - \hat f); under ED\mathbb{E}_D the cross term 2(ffˉ)ED[fˉf^]=2(ffˉ)(fˉfˉ)=02(f^* - \bar f)\mathbb{E}_D[\bar f - \hat f] = 2(f^* - \bar f)(\bar f - \bar f) = 0, so ED[(ff^)2]=(ffˉ)2+ED[(f^fˉ)2]=Bias2+Var\mathbb{E}_D[(f^* - \hat f)^2] = (f^* - \bar f)^2 + \mathbb{E}_D[(\hat f - \bar f)^2] = \text{Bias}^2 + \text{Var}. Combining: EGE=Bias2+Var+σ2\text{EGE} = \text{Bias}^2 + \text{Var} + \sigma^2, where σ2\sigma^2 is irreducible noise that no model can remove.
💡Use Cases
the standard framework for interview questions on why complex models overfit/underfit: more complexity lowers bias (hypothesis space covers the truth) but raises variance (more sensitive to the training set); it also explains bagging (reduces variance), boosting (reduces bias) and regularization (raises bias, lowers variance).
Key Problems Solved
a quantitative diagnosis for capacity selection: low training error with high test error → variance-dominated → add data / regularization / bagging; high error on both → bias-dominated → add capacity / features. Notes: the decomposition holds per fixed xx and is typically averaged over the input distribution; it does not hold for classification under 0-1 loss, where decomposable alternatives like the Brier score are used.
🎯5 High-Frequency Exam Points
1
Whiteboard-prove E[(yf^)2]=Bias2+Var+σ2\mathbb{E}[(y-\hat f)^2] = \text{Bias}^2 + \text{Var} + \sigma^2: show the expansion and both cross-term cancellations (E[ϵ]=0\mathbb{E}[\epsilon] = 0 and ED[f^]=fˉ\mathbb{E}_D[\hat f] = \bar f).
2
Why is the cross term 2E[ϵ(ff^)]2\mathbb{E}[\epsilon(f^* - \hat f)] zero? Which independence/expectation assumptions does it rely on? Why is σ2\sigma^2 irreducible?
3
As model complexity grows, how do Bias and Var change? Which term dominates in underfitting vs overfitting?
4
Explain via the decomposition: why does bagging mainly reduce variance, and boosting mainly reduce bias?
5
Why does the decomposition fail for classification with 0-1 loss? What alternative (e.g. Brier score) can be used?
Updated 2026-08-12
🎯
Test Your Knowledge: Practice Questions for "Bias-Variance Decomposition"
Single choice pitfall questions with instant feedback and mistake tracking.
🚀 Start Card Practice
Previous CardRegularization GeometryNext CardDouble Descent

🔗 More AI Math Knowledge Cards

Adam/AdamW MathBayesian InferenceBootstrapCausal Inference (Rubin)