Machine Learning Fundamentals interview question · Most asked
Explain the bias-variance trade-off.
How it works Asked in Machine Learning Engineer interviews
Summary
A model's error on new data comes from bias (too simple to capture the pattern: underfitting), variance (too sensitive to the training data: overfitting) and irreducible noise. Making a model more flexible lowers bias but raises variance; the goal is the complexity where validation error is lowest.
Longer Answer
- High bias: training and validation error both high. Fix with more features, a more flexible model, less regularisation.
- High variance: training error low, validation error much higher. Fix with more data, regularisation, simpler models, early stopping, ensembling (bagging reduces variance).
- Learning curves (error vs training-set size) show which one you have.
- Large neural networks complicate the classic U-shaped picture ("double descent"), but the diagnosis from training vs validation error still works.
Key Points
- Bias = underfitting, variance = overfitting.
- Diagnose with training vs validation error.
- More data and regularisation reduce variance.
- Learning curves show which problem you have.
Explanation
What interviewers look for
Diagnosing from train/validation gaps and choosing the right fix, not just reciting the definition.
More Machine Learning Fundamentals questions
- What is overfitting, and how do you prevent it?
- Your model scored well offline but performs badly in production. What do you check?
- What is data leakage, and how do you detect it?
- Which metrics would you use for a classification model, and when is accuracy misleading?
- How do you split data for training, validation and testing, and what is cross-validation?
- What is the difference between supervised, unsupervised and reinforcement learning?
- Compare decision trees, random forests and gradient boosting.
- Design a system that serves predictions from a trained model to a web application.