TL;DROverfitting vs underfitting is the bias–variance trade-off — the central modeling tension.
Underfitting (high bias): the model is too simple, missing real patterns — poor on both train and test. Overfitting (high variance): too complex, memorizing noise — great on train, poor on test. The goal is the middle: enough capacity to learn the signal, enough regularization/data to generalize. Watch the gap between training and validation performance to diagnose which you have.
Key points
Underfit (high bias): too simple, poor everywhere
Overfit (high variance): memorizes, poor on test
Goal: capacity + generalization balance
Train–validation gap diagnoses it
Common mistakes
Adding complexity to an underfit-by-data problem
Ignoring the train/validation gap
Chasing train accuracy instead of validation
Try it: From a train/validation gap, decide whether you’re over- or underfitting.
Example code
<!doctype html><html><head><meta charset="utf-8"></head>
<body style="background:#06040d;color:#e6e0ff;font-family:monospace;padding:20px"><pre>train 99% / val 70% → overfit (variance)
train 65% / val 64% → underfit (bias)
goal: high on both, small gap</pre></body></html>