← All writing
Evaluation · 7 min read · 1 Jul 2026

The Bias-Variance Tradeoff, Explained on One Dataset

Forget the abstract diagrams for a moment. Here is what bias and variance actually look like when you fit models to the same fifty rows of data, again and again.

Why this idea keeps getting mangled

The bias-variance tradeoff is one of those concepts that everyone in machine learning can recite and almost nobody can explain with a concrete number attached. You have seen the diagram: a U-shaped curve, total error on the y-axis, model complexity on the x-axis, with bias falling and variance rising as the model grows more flexible. It is a fine cartoon. It is also useless as intuition until you have watched it happen on actual data, with actual predictions wobbling around on the page.

I want to do that here with one small, imagined dataset rather than a slide. The reason this matters beyond pedagogy is that the tradeoff is not a historical curiosity from a statistics course; it is the reason cross-validation exists, the reason regularisation exists, and the reason "just add more parameters" is not a strategy. If you cannot picture what high variance looks like in a residual plot, you will misdiagnose it in production as noisy data rather than an overfit model, and you will reach for the wrong fix.

Setting up one dataset we can actually reason about

Suppose we have fifty houses, and we are predicting price in thousands from a single feature: floor area in square metres. The true relationship in the population, which we as the analyst do not get to see, is mildly curved: price rises with area but with diminishing returns above a certain size, plus some genuine random noise from factors we have not measured, like renovation quality. Say the true expected price is roughly 50 plus 1.8 times area, minus a small penalty for very large areas, and then each observed house has noise of about plus or minus 15 thousand layered on top from unmeasured factors.

Now imagine we do not have access to the whole population; we only ever see a sample of fifty houses at a time, and critically, if we resampled fifty different houses from the same city, we would get a slightly different fifty rows, with different noise realisations. This is the whole trick of the explanation: instead of fitting one model to one dataset and stopping there, we fit the same model architecture to many different samples drawn from the same underlying reality, and we watch what the fitted models do.

This resampling idea is not exotic; it is the same logic behind bootstrapping and behind understanding why cross-validation folds disagree with each other. If your model is stable, it should not matter much which fifty houses you happened to see. If it is unstable, the fitted curve will swing wildly depending on the luck of the draw, and that instability has a name: variance.

The underfit model: a straight line

Fit a simple linear regression, price on area, to our fifty houses. Do this twenty times, each time on a fresh sample of fifty houses drawn from the same city. What you will see is that the twenty fitted lines are almost identical: similar slope, similar intercept, all clustered tightly together. That tight clustering is low variance: the model barely changes its mind depending on which particular houses it saw.

But look at where those lines sit relative to the true curved relationship. Because the true relationship bends downward for very large houses and the model is forced to be straight, the line systematically overpredicts price for the smallest houses and underpredicts for the largest ones, in roughly the same way every single time. That systematic, repeatable error, the gap between what the model can express and what reality actually looks like, is bias. It does not go away with more data from the same distribution, because the model's shape is simply wrong, and no amount of fifty-house samples will teach a straight line to bend.

In practical terms, if you evaluated this linear model on held-out houses, you would see a stable but mediocre error, say a mean absolute error sitting consistently around 22 thousand across every fold of cross-validation. Stable and mediocre is the fingerprint of high bias: your validation and training errors will look similar to each other, and both will be worse than you would like.

The overfit model: a high-degree polynomial

Now fit a ninth-degree polynomial in area to those same fifty houses, repeated across the same twenty resamples. This model has enough flexibility to snake through nearly every point in whichever fifty houses it is given, including the noisy ones. Training error will look fantastic, often near zero, because the model has essentially memorised the particular quirks of that particular sample rather than learning the underlying trend.

Here is where the resampling makes the concept vivid rather than abstract. Plot all twenty fitted curves together. Unlike the tightly clustered straight lines, these polynomial curves diverge wildly from each other, especially near the edges of the area range where data is sparse. One sample's curve might swoop upward for very large houses because it happened to include one unusually expensive outlier; another sample's curve swoops downward because its particular fifty houses did not include that outlier. The curves agree reasonably well in the dense middle of the data and disagree violently at the extremes. That spread between the twenty curves, not the gap to the truth, is variance.

The practical symptom is a large gap between training error and validation error. Training error near zero, and validation error jumping around unpredictably, say anywhere from 18 to 40 thousand mean absolute error depending on which fold you check. That instability across folds is the diagnostic signal that tells you variance, not bias, is your problem, and it is why a single train-test split can be dangerously misleading: you might get lucky and see a good validation number purely by chance.

Where the tradeoff actually lives: a quadratic in between

Fit a quadratic, degree two, to the same twenty resamples. This is roughly the true shape of the underlying relationship, and the result splits the difference in an instructive way. The twenty fitted curves cluster more tightly than the ninth-degree polynomial's chaos, but with slightly more spread than the straight lines. That is a modest amount of variance, present but manageable.

Meanwhile, the average of those twenty curves sits very close to the true underlying relationship, including the bend at large areas that the straight line could never capture. That is low bias: the model's shape can express reality reasonably well. When you add a modest, well-controlled variance to a small bias, the total expected error is lower than either the straight line's larger bias or the ninth-degree polynomial's larger variance. In our numbers, this might land at a validation mean absolute error consistently around 16 thousand across folds, better than both extremes, and importantly, stable across folds too.

This is the actual content of the tradeoff, and it is worth stating plainly because the diagram tends to obscure it: total expected error decomposes into bias squared, plus variance, plus irreducible noise from factors you can never measure. You are not trying to eliminate bias or eliminate variance; you are trying to find the point where their sum is smallest, and that point depends entirely on how much genuine signal versus noise sits in your particular data, which is precisely why it cannot be read off a generic textbook curve.

The practical takeaway

If you only remember one operational lesson from this, make it this one: a single validation score tells you almost nothing about which regime you are in, but the gap between training and validation error, checked across several folds or resamples, tells you a great deal. A small gap with mediocre absolute performance points towards bias, and the fix is more model capacity, better features, or a different architecture. A large, unstable gap points towards variance, and the fix is regularisation, more training data, simpler models, or ensembling to average away the instability.

Do this diagnosis before you reach for hyperparameter tuning as a reflex. Tuning a high-variance model harder without addressing the actual instability just moves you along the wrong part of the curve. And always run this check with a leakage-aware split: if your resamples or folds share information, duplicated rows, correlated groups, or features derived from the full dataset before splitting, you will underestimate variance and convince yourself a fragile model is stable. The tradeoff is only visible clearly when your evaluation setup is honest about what the model has and has not actually seen.

← All writing See the project case studies →