Derive the Bias-Variance Decomposition for a Shipping Cost Estimator
Last updated: November 29, 2026
Quick Overview
Derive the bias-variance decomposition of expected squared error for a model that estimates the shipping cost of a package, and use it to explain why a very deep regression tree and a constant predictor both perform poorly.
Amazon
November 29, 20260
0
0 solved
Derive the bias-variance decomposition of expected squared error for a model that estimates the shipping cost of a package, and use it to explain why a very deep regression tree and a constant predictor both perform poorly.
Amazon applied science screens often include a short derivation to test fundamentals. The interviewer checks that you can do the algebra cleanly, interpret each term, and connect the result to model choices such as tree depth and ensembling.
What the Interviewer Expects
- States the setup with noise and a random training set
- Derives the three terms with the cross terms vanishing
- Interprets irreducible noise, bias squared and variance
- Maps deep trees to high variance and constants to high bias
- Explains how bagging and regularization move along the trade-off
Key Topics to Cover
How to Approach This
- Understand the bias-variance trade-off. High training accuracy but low test accuracy signals overfitting.
- Choose evaluation metrics carefully based on the problem. Accuracy alone is often insufficient.
- Feature engineering is often more impactful than model selection.
- Know when to use tree-based models (tabular data) vs neural networks (unstructured data).
- Handle class imbalance with SMOTE, class weights, or appropriate loss functions.
Possible Follow-up Questions
- Why does bagging reduce variance but not bias?
- Does the decomposition hold for log loss?
- How would you estimate bias and variance empirically?
- What happens to the trade-off as training data grows?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Explore ML Interview PrepSample Answer
Clarify
Fix a package with features . True cost is with and (carrier surcharges and rounding we cannot predict). The model d...
Approach
Write the expected squared error over both and , add and subtract the average prediction , and show the cross terms vanish....