The bias–variance tradeoff is why a model can fail two opposite ways. Too simple, and it misses the pattern. Too flexible, and it memorises the noise. Generalisation lives in between — and the complexity dial is how you find it.
Where you meet it
- Picking polynomial degree, tree depth, or the number of layers in a network.
- Tuning a regularisation strength (
alpha,lambda, weight decay). - Reading a validation curve to decide if a model needs more capacity or less.
- Deciding whether to collect more data or simplify the model.
What it does
It splits a model's expected test error into parts you can reason about separately. Bias is error from wrong assumptions — a model too rigid to fit the true signal. Variance is error from sensitivity to the particular training set — a model so flexible it changes wildly when the data changes. You can usually trade one for the other, but rarely kill both at once.
Zero training error is not success — it's the loudest sign the model memorised the noise.
How it works
For squared-error regression, the expected test error at a point decomposes cleanly:
E[(y - f̂(x))²] = Bias[f̂(x)]² + Var[f̂(x)] + σ²
└─ underfit ─┘ └─ overfit ─┘ └ irreducible ┘
The third term, σ², is noise in the data itself — no model can beat it. The other two move against each other as you turn up complexity: more flexibility lowers bias (the fit can bend toward the truth) but raises variance (it also bends toward the noise). Training error falls monotonically, but test error is U-shaped — it drops, bottoms out at the sweet spot, then climbs as variance takes over.
Watch out
- A large train–test gap means overfitting. Near-zero training error with high test error is the signature of high variance.
- Both errors high and close together means underfitting — high bias. More data won't fix it; more capacity might.
- Never tune on the test set. Pick complexity with a validation split or cross-validation; keep the test set sealed for one honest final estimate.
- The cures differ by failure mode. For overfitting: more data, regularisation, early stopping, or a simpler model. For underfitting: more features, more capacity, less regularisation.
Go deeper
- scikit-learn — Underfitting vs. Overfitting (polynomial degrees 1 / 4 / 15)
- scikit-learn — Validation curves & learning curves: diagnosing bias vs. variance
- An Introduction to Statistical Learning (ISLR) — ch. 2, the bias–variance decomposition (free PDF)
- Stanford CS229 — main lecture notes (bias/variance, regularization)
- MIT OpenCourseWare 6.036 — Intro to Machine Learning (overfitting & generalization)
Der Bias-Varianz-Tradeoff erklärt, warum ein Modell auf zwei entgegengesetzte Arten scheitern kann. Zu einfach — es verfehlt das Muster. Zu flexibel — es lernt das Rauschen auswendig. Generalisierung liegt dazwischen, und der Komplexitäts-Regler ist der Weg dorthin.
Wo es vorkommt
- Polynom-Grad, Baumtiefe oder Anzahl der Schichten eines Netzes wählen.
- Eine Regularisierungsstärke einstellen (
alpha,lambda, Weight Decay). - Eine Validierungskurve lesen, um zu entscheiden: mehr oder weniger Kapazität?
- Abwägen, ob man mehr Daten sammelt oder das Modell vereinfacht.
Was es tut
Er zerlegt den erwarteten Testfehler in Teile, über die man getrennt nachdenken kann. Bias ist der systematische Fehler durch falsche Annahmen — ein Modell, das zu starr ist, um das echte Signal zu treffen (Underfit). Varianz ist der Fehler durch Empfindlichkeit gegenüber den konkreten Trainingsdaten — ein Modell so flexibel, dass es sich bei jeder Datenänderung stark verändert (Overfit). Meist tauscht man das eine gegen das andere; beide zugleich loszuwerden gelingt selten.
Trainingsfehler null ist kein Erfolg — es ist das lauteste Zeichen, dass das Modell das Rauschen auswendig gelernt hat.
Wie es funktioniert
Bei quadratischem Fehler zerfällt der erwartete Testfehler an einem Punkt sauber:
E[(y - f̂(x))²] = Bias[f̂(x)]² + Var[f̂(x)] + σ²
└─ Underfit ─┘ └─ Overfit ─┘ └─ Rauschen ─┘
Der dritte Term, σ², ist das Rauschen in den Daten selbst — kein Modell schlägt es (irreduzibler Fehler). Die anderen beiden bewegen sich gegenläufig, wenn man die Komplexität hochdreht: mehr Flexibilität senkt den Bias (der Fit kann sich der Wahrheit annähern), aber hebt die Varianz (er biegt sich auch ins Rauschen). Der Trainingsfehler fällt monoton, der Testfehler ist U-förmig — er sinkt, erreicht im Sweet Spot sein Minimum und steigt dann wieder, wenn die Varianz überhandnimmt.
Worauf achten
- Eine große Train-Test-Lücke heißt Overfitting. Trainingsfehler nahe null bei hohem Testfehler ist die Signatur hoher Varianz.
- Beide Fehler hoch und dicht beieinander heißt Underfitting — hoher Bias. Mehr Daten helfen nicht; mehr Kapazität vielleicht.
- Nie auf dem Test-Set tunen. Komplexität über eine Validierungs-Aufteilung oder Cross-Validation wählen; das Test-Set für eine ehrliche finale Schätzung versiegelt lassen.
- Die Gegenmittel hängen vom Fehlertyp ab. Gegen Overfit: mehr Daten, Regularisierung, Early Stopping oder ein einfacheres Modell. Gegen Underfit: mehr Features, mehr Kapazität, weniger Regularisierung.
Mehr dazu
- scikit-learn — Underfitting vs. Overfitting (Polynom-Grade 1 / 4 / 15)
- scikit-learn — Validierungs- & Lernkurven: Bias vs. Varianz diagnostizieren
- An Introduction to Statistical Learning (ISLR) — Kap. 2, die Bias-Varianz-Zerlegung (kostenloses PDF)
- Stanford CS229 — Haupt-Vorlesungsskript (Bias/Varianz, Regularisierung)
- MIT OpenCourseWare 6.036 — Intro to Machine Learning (Overfitting & Generalisierung)