Skip to content
AI360Xpert
Beta
Playgrounds

Evaluation & RL

Learning Curves

How adding more training data helps a model generalize (lowering validation error) but makes the training set harder to memorize perfectly (raising training error).

Stage 1 of 3: The Small Dataset

Training on 4 points with a degree-5 polynomial. Training error 0.00. Validation error 4271444.35 — diverging.

  • Training Sample
  • Validation Sample
  • Fitted Curve
Train Error0.00Train Error: 0.00
Val Error4.27e+6Val Error: 4.27e+6 — diverging

Using a high-capacity model on very few data points causes the training error to drop to zero while validation error explodes—a classic visualization of overfitting.

Check your understanding

Plot train vs validation error as dataset size grows to visually diagnose underfitting and overfitting.

A Learning Curve is one of the most powerful diagnostic tools in machine learning. It plots the model's error on the training set and the validation set as a function of the amount of training data.

When you have very little data, a complex model can easily memorize every point. The training error is nearly zero, but because it has learned the noise instead of the signal, its error on unseen validation data is massive. This is Overfitting.

As you add more data, the model can no longer hit every point perfectly. The training error goes up. However, the model is forced to learn the actual underlying pattern, so the validation error goes down.

By looking at the gap between the two curves, you can diagnose what your model needs. If the gap is large, you are overfitting (add more data or reduce model capacity). If they converge but both are high, you are underfitting (increase model capacity).

Both curves are computed from the same closed-form polynomial fit at every dataset size, held against a fixed, separate set of points the model never trains on — nothing here is interpolated or read off a lookup table. Move the sliders to trace out both regimes yourself.

Reference

Learning Curve
A plot showing model performance vs experience (usually training set size).
Overfitting
High variance. Large gap between train and val error.
Underfitting
High bias. Train and val error converge, but both are high.
Model capacity
How flexible the model is — here, the degree of the fitted polynomial. Higher degree can bend through more points, for better or worse.
Ridge penalty
A tiny weight-shrinkage term added so the fit stays well-defined even when there are barely more points than parameters.

Break it on purpose

Using a high-capacity model on very few data points causes the training error to drop to zero while validation error explodes—a classic visualization of overfitting.