Visual walkthrough — Learning curves analysis
This page rebuilds the two curves of a learning curve from absolute zero. We will not assume you know what "error", "bias", or "variance" mean as numbers. We will watch them appear, one picture at a time, until the famous shapes — one rising, one falling — fall out on their own.
Step 1 — Draw the two things we are measuring
WHAT. A model is a machine that takes an input and guesses an output. Call its guess (read " of " — the letter stands for hypothesis, our fancy word for "the model's current guess-rule"). The true answer is .
WHY. Before we can plot error, we need a single number that says "how wrong was this one guess?". That number is called a loss, written . We will use the most common one, squared error — you take the gap between guess and truth and square it:
- ::: the plain gap (stick length), positive if we guessed too high, negative if too low
- ::: squaring — kills the sign (a stick below counts the same as one above) and punishes big misses harder
If the guess equals the truth, the gap is so . Why squaring and not, say, absolute value? Because the whole variance story later (Step 5) is about averaging squared gaps — and the tidy "" law only holds for squares. Squaring is the tool that makes noise add up cleanly.
PICTURE. Below, the cyan dots are true answers; the amber line is the model's guess-rule. Each vertical stick is one gap ; the loss is that stick's length squared.

Step 2 — Two different sets: the one it studied and the one it hasn't seen
WHAT. We split our data into two piles (this is the Train-Test Split idea). The training set is what the model studies from. The validation set is a separate pile we never let it study — we only use it to test.
WHY. A student who has memorised the exam answers looks perfect on those exact questions but may know nothing. To catch that, you must test on fresh questions. Two piles ⇒ two errors:
PICTURE. Left box = training pile (the model bent itself to fit these). Right box = validation pile (never touched during learning).

Step 3 — Slide the data slider: start with almost no data
WHAT. Now the key move. We let (the training-set size) grow, and re-train the model at each size. Start tiny: or points.
WHY. A learning curve is a graph versus . So is our slider. We must understand the two extremes — tiny and huge — because the curve just connects them.
PICTURE. With only 3 points and plenty of knobs, the model can wiggle right through every one. Zero sticks ⇒ . But that same wiggly rule is nonsense elsewhere, so on the fresh box its sticks are huge.

Step 4 — Slide to lots of data: the model can no longer please everyone
WHAT. Now is large — hundreds of points, far more than the model's knobs.
WHY. We want the right edge of the curve. With many points crowding in (more points than knobs), the model cannot thread through all of them at once; it must compromise.
PICTURE. Many cyan dots, one amber rule. It can't hit them all, so training sticks appear (training error rises from ~0). But because it now respects the real trend, fresh points land close too — validation sticks shrink.

Step 5 — Where do they level off? Named ingredients of error
WHAT. As keeps growing, both curves flatten toward limits. To predict where, we split every error into named parts, and we will use one consistent symbol per part for the rest of the page.
WHY these parts. Any wrongness is either (1) a mismatch the model can never fix (), (2) noise nobody can fix (), or (3) the model being thrown off by the particular noisy sample it happened to see — an amount built from and . Only part (3) depends on how much data you have — so only part (3) moves as the slider slides.
PICTURE. A stacked bar: the two bottom blocks (bias + irreducible) are fixed height; the top block (the sample-jiggle penalty) melts down as the arrow "more data" pushes right.

Earning the law — watch the jiggle cancel
WHY a picture, not a sentence. We keep claiming "averaging noise cancels it as ". That is the hinge of the whole page, so we show it rather than assert it.
WHAT. Take one point's true value and add random noise of typical size (so its variance, the average squared wobble, is ). Now take such points and average them. The average's own wobble is smaller — and by exactly how much is the law.

Why it works, step by term. Each noisy point is (truth) + (its own jiggle). Averaging of them:
- ::: the random wobble on point , variance each, independent
- ::: we average the jiggles too
When you add independent wobbles, their squared sizes add (the ups and downs partly cancel), giving total variance ; the out front squares to :
- ::: comes from the being squared (variance squares constants)
- ::: independent variances add up
- result ::: twice the data → half the leftover jiggle
So the piece of error caused by "the sample's noise leaking into the fitted knobs" must carry a factor . That is why the moving term is and not or constant — it is literally this variance-of-an-average law. The squared-error loss from Step 1 is what let us add variances so cleanly.
Here the tool "divide by " was chosen deliberately: it is the variance-of-an-average law made visible. Bias and irreducible noise have no — that is the whole reason more data can't cure them, only the term.
Step 6 — Case A: high bias (the model is too simple)
WHAT. Make large (e.g. a straight-line model on a curvy pattern), with few knobs (small ).
WHY. We must cover every case the reader could meet. This is the "both errors high" case.
PICTURE. Both curves climb/fall and kiss at a high level. The gap between them is tiny because both share the same big floor.

Step 7 — Case B: high variance (the model is too complex)
WHAT. Make large (a very wiggly model with little data).
WHY. The opposite failure: this is the "big gap" case, and the one where the gap is your alarm bell.
PICTURE. Training curve sits near the floor (bias is tiny for a flexible model); validation curve floats far above it. The vertical amber gap is exactly — the sum of the discount below and the penalty above.

- ::: total leaked sample-noise (per-point jiggle × number of knobs)
- ::: the shrink-with-data factor
- factor ::: the same leaked noise counts twice — a discount on train plus a penalty on val
Step 8 — The degenerate edges (never leave a scenario unshown)
WHAT & WHY. Three corner cases the formulas must survive:
- from the start (too few points to pin the knobs). With fewer points than free knobs, the model is under-determined — many rules fit equally, so no unique fit and no single error to plot. The curve must start at (enough constraints). This is the flip side of Step 3's interpolation regime: there let us hit every point; here is simply too small to define a fit at all. At the average is literally division by zero.
- Perfect noiseless data, right-sized model. Then and (so ): every term vanishes and both curves plunge to and meet. The "good fit" ideal.
- . Every term vanishes; both curves flatten. What's left is — the too-simple floor plus the world's own noise that no data ever removes.
PICTURE. Three mini-panels: the forbidden left region , the ideal converge-to-zero, and the far-right flatline at .

The one-picture summary
Everything above, on one axis: rising red , falling cyan , the amber gap between them, the floor as a dashed line, and the three diagnoses labelled where the curves land. The two annotations on the figure are the reason the shapes exist: train is pulled down by fitting its own noise (the discount), val is pushed up by that same noise (), and both discounts melt as .

Recall Feynman retelling — say it like a story
We had a machine that guesses, and we measured its wrongness with squared error: the gap between guess and truth, squared, then averaged over the points — that average is the error. We kept two piles: one it studied (train) and one it never saw (val). Then we slid a slider — the amount of study material.
With almost no material (and more knobs than points, so it could thread through them all), the machine just memorised the few examples, so it looked perfect on them (train error near zero) but was clueless on fresh ones (val error high). As we poured in more material — soon more points than knobs — it could no longer memorise everyone, so its train error crept up; but now it actually grasped the real shape, so val error slid down. Two curves, one rising, one falling.
Where they settle comes from a few ingredients. Bias () is the machine being too dumb to ever fit the shape. Irreducible noise (, which for squared error is just the per-point noise variance ) is jiggle in the world nobody can predict. Both are fixed floors with no — so more data can't lift you off them. The moving part is the machine fitting the particular noise of this sample: each of its knobs catches some of the per-point jiggle , and averaging over points cancels that leaked noise down to — a fact we watched cancel: independent wobbles add to , the average squares to , product . On its own points this leaked noise flatters the machine (a discount, subtracted); on fresh points the same leaked noise hurts (a penalty, added). That mirror image is the whole gap, — big when is big (high variance, close it with more data or Regularization), tiny when is small (high bias, where only more capacity helps). Read where the two curves land, and the picture tells you exactly which cure to reach for.
Recall
A learning curve plots what against what? ::: Training error and validation error (y) versus training-set size (x). What loss are we using, and why squared? ::: Squared error ; squaring kills the sign and lets independent noise variances add cleanly, which is what makes the law hold. Why does training error rise with more data? ::: The "fits its own noise" discount shrinks as grows, so train error stops looking artificially good and climbs toward the true floor. Which error terms have no , and what does that imply? ::: and — no means more data can never remove them. How do and relate? ::: For squared-error loss they are the same number (); two names for two roles — noise going in vs unbeatable floor coming out. Where does the in the variance term come from? ::: independent wobbles add to variance ; the averaging squares to ; product is — data averages the jiggle away. Where does the factor come from and why is it in both curves? ::: = number of free knobs; each catches sample noise, so leaked noise is , subtracted on train and added on val (same size, opposite sign). What must be true for "tiny ⇒ zero training error"? ::: The model must have at least as many knobs as points () so it can interpolate them all. A large gap still shrinking at the right edge: diagnosis and fix? ::: High variance; collect more data or increase regularization.