Guided Starter Example
d=1 (linear): J_train=15%, J_cv=16% โ high bias (both high). d=4 (degree 4): J_train=1%, J_cv=18% โ high variance (big gap). d=2 (quadratic): J_train=5%, J_cv=6% โ just right.
The two fundamental failure modes of ML models โ high bias underfits, high variance overfits.
Bias and variance are the two fundamental failure modes. Diagnosing which you have tells you exactly what to try next.
High bias (underfitting):
High variance (overfitting):
Just right:
Plotting J_train and J_cv as a function of model complexity (polynomial degree): J_train decreases monotonically with complexity. J_cv is U-shaped โ high for simple models (high bias), low in the middle (just right), high again for complex models (high variance).
In rare cases, especially neural networks: both high bias AND high variance simultaneously. J_train is high AND J_cv >> J_train. Happens when a model overfits part of the input space but underfits another part.
Source-backed reinforcement: these points add detail beyond short-duration UI hints and emphasize production tradeoffs.
First-time learner note: Read each model as a dataflow system: inputs become representations, representations become scores, and scores become decisions through a chosen loss and thresholding policy.
Production note: Track three things relentlessly in ML systems: data shape contracts, evaluation methodology, and the operational meaning of the model's errors. Most expensive failures come from one of those three.
Bias and variance are action-guiding labels, not abstract theory words. High bias means the model cannot fit the training data well enough. High variance means it fits training behavior but fails to generalize. Those two diagnoses suggest very different fixes, which is why getting them right matters.
Quick heuristic: training error high relative to a reasonable target suggests bias. Cross-validation error much worse than training suggests variance. This is one of the highest-leverage mental models in practical ML work.
Exhaustive coverage points to ensure complete topic understanding without missing core concepts.
d=1 (linear): J_train=15%, J_cv=16% โ high bias (both high). d=4 (degree 4): J_train=1%, J_cv=18% โ high variance (big gap). d=2 (quadratic): J_train=5%, J_cv=6% โ just right.
Guided Starter Example
d=1 (linear): J_train=15%, J_cv=16% โ high bias (both high). d=4 (degree 4): J_train=1%, J_cv=18% โ high variance (big gap). d=2 (quadratic): J_train=5%, J_cv=6% โ just right.
Source-grounded Practical Scenario
The two fundamental failure modes of ML models โ high bias underfits, high variance overfits.
Source-grounded Practical Scenario
Bias and variance are the two fundamental failure modes.
Concept-to-code walkthrough checklist for this topic.
Questions an interviewer is likely to ask about this topic. Think through your answer before reading the senior angle.
Test yourself before moving on. Flip each card to check your understanding โ great for quick revision before an interview.
Drag to reorder the architecture flow for Diagnosing Bias and Variance. This is designed as an interview rehearsal for explaining end-to-end execution.
This workbench turns bias and variance into an engineering decision tool. Compare baseline, training, and cross-validation behavior, then map the gaps to the next action instead of guessing randomly.
Training performance is acceptable relative to the baseline, but cross-validation falls behind. More data, stronger regularization, or simpler modeling choices are more likely to help.
This workbench turns bias and variance into an engineering decision tool. Compare baseline, training, and cross-validation behavior, then map the gaps to the next action instead of guessing randomly.
Training performance is acceptable relative to the baseline, but cross-validation falls behind. More data, stronger regularization, or simpler modeling choices are more likely to help.
Start flipping cards to track your progress
Signature of high bias (underfitting)?
tap to reveal โJ_train is high. J_cv โ J_train (both high). Model too simple to capture the pattern.