Skip to content
AI360XpertBeta
Core ML

Visual explainer

Learning Curves

Compare training and held-out error as sample size grows, using a checked mean predictor and a visible population-shift limit.

A learning curve refits the same model on growing training subsets.
A learning curve refits the same model on growing training subsets.

A learning curve compares training and held-out performance as the number of training rows changes. Refit the same model at each size, then score it on data excluded from that fit. The three strips represent 2, 4 and 8 rows; the validation set stays separate. This is a data-size curve, not an epoch-by-epoch training history.

Keep preprocessing inside each training subset. Repeat the procedure across suitable splits to see how sensitive the result is to the sampled rows. The scikit-learn learning-curve reference describes this protocol.

Read Both Axes

Training size and error are separate axes of a learning curve.
Training size and error are separate axes of a learning curve.

Here, horizontal position is training size nn and vertical position is mean squared error (MSE), so lower is better. Circles identify training error; diamonds identify validation error. At the same size n=4n=4, the expected errors in our synthetic example are 0.75 and 1.25. The vertical guide ties both measurements to the same fit size.

The example has no informative input feature. Each independent target is equally likely to be 0 or 2, and the model predicts its training targets' mean mm. Every error uses squared target units. These are exact analytical expectations, not measured benchmark results or confidence intervals.

A Realized Plateau

Balanced subsets leave a constant predictor at the same error.
Balanced subsets leave a constant predictor at the same error.

First consider specific balanced subsets: half the targets are 0 and half are 2 at each size. Every fitted mean is 1. Both training MSE and MSE on a fixed balanced validation set equal ((0−1)2+(2−1)2)/2=1((0-1)^2+(2-1)^2)/2=1. Adding more balanced rows changes neither score.

These are realized balanced subsets, unlike the expectations in the preceding scene. A small gap alone does not prove a good model. Error must be judged against the task and available information; a plateau suggests experiments, rather than identifying a guaranteed cure.

One Row Can Overfit

One training label can give zero training error and nonzero held-out error.
One training label can give zero training error and nonzero held-out error.

With one training target equal to 0, the fitted mean is 0 and training MSE is zero. On a separate balanced validation set, targets 0 and 2 give squared errors 0 and 4, averaging 2. The dashed line is the model's prediction; the vertical bracket is the residual for target 2. The vertical axis here is target value, not MSE.

A generalization gap can appear even for a one-parameter constant model. It does not require a large network, and it does not by itself prove that buying data is the best intervention.

The Expected Gap Narrows

More independent samples narrow the expected gap in this fixture.
More independent samples narrow the expected gap in this fixture.

Return to averaging over every possible training sample. The target mean is 1 and variance is 1, so E[m]=1E[m]=1 and Var⁡(m)=1/n\operatorname{Var}(m)=1/n. An independent future target gives

E[MSEfresh]=1+1/n,E[MSEtrain]=1−1/n.E[\mathrm{MSE}_{\mathrm{fresh}}]=1+1/n, \qquad E[\mathrm{MSE}_{\mathrm{train}}]=1-1/n.

For n=1,2,4,8n=1,2,4,8, the training errors are 0,0.5,0.75,0.8750,0.5,0.75,0.875 and fresh errors are 2,1.5,1.25,1.1252,1.5,1.25,1.125. The expected gap shrinks from 2 to 0.25. Training error rises because fitting more independent labels removes the one-row model's accidental perfect fit. Straight joins connect checkpoints; they are not extra observations. A finite validation set can deviate from these expectations.

Try An Informative Feature

A missing predictive feature can matter more than extra rows.
A missing predictive feature can matter more than extra rows.

This controlled experiment changes the data assumption explicitly: now xx is 0 or 1 and y=2xy=2x without noise. Both panels show the same two points and target scale. A constant prediction of 1 leaves residuals of magnitude 1 and MSE 1. Giving the model the informative feature lets the predictor 2x2x hit both points, with MSE 0 on training and fresh examples from this rule.

The original random-target fixture cannot be solved this way: it has no informative feature to recover. A learning curve motivates checks of features, capacity and optimization; it cannot select among them without further evidence.

An Information Floor

Identical observed inputs can retain unpredictable target variation.
Identical observed inputs can retain unpredictable target variation.

Return to the original featureless distribution. Identical observed inputs can lead to either target 0 or target 2. The best fixed prediction is the midpoint 1: for any prediction aa, fresh expected squared error is 1+(a−1)21+(a-1)^2, minimized at 1.

The floor of 1 belongs to this distribution and these observed features. It is not a universal percentage of bad labels. More data estimates the midpoint more reliably but cannot reveal an independent future coin flip.

Repeat The Subsets

Different subsets at the same size can produce different validation errors.
Different subsets at the same size can produce different validation errors.

At n=2n=2, the four equally likely ordered target pairs are 00, 02, 20 and 22. Their fitted means are 0, 1, 1 and 2. On the same balanced validation set, their MSEs are 2, 1, 1 and 2. The dashed line is their average, 1.5.

Repeating subsets exposes variation hidden by a single curve. These four bars enumerate sample outcomes; they are not four sample sizes or a statistical confidence interval. Real splitting must also respect groups or temporal dependence when present.

Smaller Marginal Gains

Doubling the sample can yield a smaller next improvement.
Doubling the sample can yield a smaller next improvement.

In the same analytical example, doubling nn through 2, 4, 8 and 16 reduces expected fresh MSE through 1.5, 1.25, 1.125 and 1.0625. The successive improvements are 0.25, 0.125 and 0.0625. All bars share a zero baseline, and horizontal spacing is proportional to sample size.

This demonstrates diminishing returns in this model. It is not a promised return on a labeling budget. Compare the uncertainty and operational cost of the next experiment with the benefit you need.

Where It Breaks

A learning curve cannot promise performance after the population changes.
A learning curve cannot promise performance after the population changes.

Keep the model trained on 8 independent targets drawn from 0 or 2, but change future targets to 4 or 6 with equal probability. Their mean is now 5 and variance remains 1. Fresh expected MSE becomes 1+1/8+(5−1)2=17.1251+1/8+(5-1)^2=17.125, versus 1.125 on the original population. The bars share a new 0–20 MSE scale so neither is clipped.

A favorable validation curve only measures the population represented by its validation procedure. It cannot guarantee performance after this target shift. The learning-curve guide supports using curves to investigate bias and variance; the numerical shift here is our synthetic counterexample.

The Quick Version

  • Refit at each training size and keep validation separate.
  • Compare both errors using the same metric and scale.
  • A narrow gap alone does not establish a good model.
  • Repeat subsets to expose variation at each size.
  • Extra data cannot recover information absent from observed inputs.
  • Validation curves cannot promise performance after population shift.