tezvyn:

Explain bias-variance tradeoff and how regularization or tree depth manage it

AI-drafted, machine-checkedSource: Wikipedia: Bias–variance tradeoffintermediate
Explain bias-variance tradeoff and how regularization or tree depth manage it

Tests understanding of generalization error decomposition. Define bias as underfitting and variance as sensitivity to training noise; show regularization and shallow trees trade excess variance for slightly higher bias. Red flag: claiming both can hit zero.

WHAT THIS TESTS: The interviewer wants to see if you understand that prediction error decomposes into bias squared plus variance plus irreducible noise, and that model complexity is the lever that moves these two components in opposite directions. They also want to know if you can map abstract regularization concepts to concrete techniques like L1/L2 penalties and tree depth limits.

A GOOD ANSWER COVERS: First, define bias as the error from overly rigid assumptions that cause underfitting, meaning the model misses relevant relations in the data. Second, define variance as the error from excessive sensitivity to small fluctuations in the training set, meaning the model captures noise as if it were signal. Third, explain the tradeoff: as you add parameters or depth, bias falls but variance rises, so total error follows a U-shaped curve. Fourth, connect L1/L2 regularization to variance reduction by showing that shrinking coefficients toward zero dampens the model's sensitivity to any single feature or data point. Fifth, connect max_depth to the same idea: a shallow tree cannot memorize noise, so it stabilizes across training samples at the cost of potentially missing interactions.

COMMON WRONG ANSWERS: Claiming that bias and variance are independent and that a good model simply minimizes both. Describing regularization only as a way to avoid overfitting without explaining the mechanism, which is constraining the hypothesis space so the model has less freedom to chase noise. Saying that L1 and L2 regularization reduce bias, when they intentionally increase bias to lower variance. Confusing the bias-variance tradeoff with the precision-recall tradeoff or with underfitting versus overfitting without using the formal decomposition.

LIKELY FOLLOW-UPS: How does the tradeoff change as you increase training data size? What happens to the U-shaped error curve? Can you draw the decomposition for mean squared error mathematically? When would you prefer L1 over L2, and how does sparsity relate to the tradeoff? How do ensemble methods like bagging or boosting play with bias and variance differently?

ONE CONCRETE EXAMPLE: Imagine predicting house prices with a decision tree. At max_depth equals twenty, the tree splits on tiny noise such as a single outlier square footage, so training error is near zero but validation error is high; this is high variance. At max_depth equals one, the tree predicts the average price for every house, so both training and validation error are high; this is high bias. At max_depth equals five, the tree captures neighborhood and size effects without chasing noise, giving the lowest validation error. Similarly, in linear regression with hundreds of features, L2 regularization with lambda equals one shrinks coefficients so that no single rare feature dominates the prediction, reducing variance compared to unregularized ordinary least squares.

Source: Wikipedia: Bias–variance tradeoff

Read the original → Wikipedia: Bias–variance tradeoff

Get five bites like this every day.

Tezvyn delivers a daily feed of 60-second tech bites with quizzes to lock in what you learn.