Learning Curves

Two lines that tell you whether to collect more data or change the model — and they give different answers.

Learning Curves

This module needs JavaScript: the numbers are computed in the page rather than recorded.

Worth knowing

Plot training and validation error against the number of training examples. The shape is the diagnosis.
Both high and converged: bias. The model is too simple, and more data will not help.
Low training error with a large gap: variance. More data or less capacity will help.
A validation curve that has flattened is the honest answer to 'should we collect more data'. It is no.

Overview

Learning curves compare training and validation scores as the training sample grows. Their gap and direction can suggest underfitting, overfitting, or whether more representative data may help; they are diagnostic clues, not a guarantee that collecting data will improve a model.

In this guide
  1. What the curves show
  2. Compare model capacity in the visualiser
  3. When more data may help
  4. Sources and next steps

What the curves show

The horizontal axis is the number of training examples; the vertical axis is a score or error measured consistently on training and validation data. With an error metric, training error often rises as more examples are added, while validation error often falls. The gap and whether validation error is still improving are more useful than either curve alone.

PatternLikely interpretationNext question
Both errors high and closeThe model may be underfittingCan a more suitable model or feature set represent the pattern?
Training error low, validation error much higherThe model may be overfittingWould regularisation or more representative data reduce the gap?
Both errors low and close, validation curve flatPerformance has largely plateauedWould new features or a different model help more than more rows?

These are diagnostic clues. Data leakage, distribution shift, small samples or an unsuitable metric can produce misleading curves.

Compare model capacity in the visualiser

Use Model capacity to compare the synthetic training and validation curves. Low capacity illustrates a model that cannot fit the pattern; higher capacity can reduce training error while widening the validation gap. This visualiser varies model capacity, not the number of real training examples, so treat it as an illustration of the shapes rather than evidence that collecting data will improve a particular model.

For a real learning curve, repeatedly train on increasing subsets of the training data and score each fit on held-out validation data. Average over multiple splits when the dataset is small, and keep the validation procedure consistent across subset sizes.

When more data may help

If validation error is still decreasing at the largest sample size, additional representative data may help. If both curves have flattened at high error, increasing model capacity or improving features is a more direct experiment. A large, stable gap suggests overfitting; more data can help, but so can regularisation and a simpler model.

Keep a final test set separate from model selection. Use cross-validation when comparing settings, and make sure the plotted score reflects the task—accuracy alone may hide poor performance on a rare class.

Sources and next steps

Scikit-learn’s learning-curve guide shows how to estimate these curves. Continue with bias and variance for the error patterns, or cross-validation for the evaluation procedure.

Check yourself

0 of 3

Answer without scrolling back up.

  1. Training error is high and the two curves have converged. What does that mean?

  2. What tells you whether collecting more data will help?

  3. High training error AND a large gap suggests what?

Cheat sheet

Learning Curves

Plot training and validation error against dataset size. Read the gap to decide whether more data or more model capacity will help.

MACHINE LEARNING · vizlearn.in/machine_learning/learning_curves.html

About the author

Ashish Jangra builds and maintains VizLearn. Every module here is written and the visualisation behind it hand-built, so the numbers in a readout come from the same code that draws the picture. Corrections are genuinely welcome and get priority over everything else — if a page states something wrong, or an animation misrepresents what the algorithm does, get in touch.

Teaching a course with this? Individual teachers can use it freely; for a whole department or programme, see institutional licences.