What is a learning curve in machine learning?
A learning curve is a plot of a model's training and validation performance against the amount of training data. Reading where the two curves sit and how far apart they are tells you whether a model suffers mainly from high bias (underfitting) or high variance (overfitting), and whether collecting more data is likely to help.
Learning curves are a standard diagnostic before spending money on data labeling or bigger models. A team deciding whether to label another 50,000 images, a Kaggle competitor choosing between a deeper network and more augmentation, and a researcher fitting scaling laws for language models all use the same plot. The term also appears in a looser sense for loss plotted against training epochs, which answers a different question.
Key ideas
- A learning curve plots training and validation performance against training-set size.
- High bias shows as two curves that converge early at a poor score.
- High variance shows as a large gap between training and validation performance.
- More data helps high variance but does little for high bias.
- A flat validation curve at the largest N means more data is unlikely to pay off.
- Validation curves vary complexity at fixed N and complement learning curves.
Common questions
What is the difference between a learning curve and a loss curve?
A learning curve in the strict sense varies the amount of training data. A loss curve, often also called a learning curve in deep learning, plots loss against training epochs or steps for one fixed dataset. The loss curve is used for early stopping and learning-rate tuning, while the data-size curve is used to decide whether to collect more data.
How do I plot a learning curve in scikit-learn?
Use sklearn.model_selection.learning_curve, which takes an estimator, the data, and a list of training sizes. It runs cross-validation at each size and returns training and validation scores for every fold. Plot the mean of each with a shaded band of one standard deviation.
Why is my validation accuracy higher than my training accuracy?
Common causes are regularization that is only active during training, such as dropout, and data augmentation that makes training examples harder than validation ones. Training accuracy logged as a running average over an epoch also lags behind the model's end-of-epoch weights. A small or unusually easy validation set can produce the same effect.
How many training sizes should a learning curve use?
Five to ten sizes are usually enough, spaced on a log scale such as 1%, 3%, 10%, 30%, and 100% of the data. Log spacing shows the early rise and the later plateau equally well. Repeat each size with cross-validation or several seeds, because small subsets give noisy scores.
Related explainers
- Bias-Variance Tradeoff — Why models underfit or overfit — the fundamental decomposition
- Overfitting & Underfitting — The bias-variance tradeoff and generalization
- Train, Validation & Test Sets — Splitting data to measure generalization and avoid overfitting
- Cross-Validation — K-fold, stratified, and leave-one-out evaluation
- Regularization — Dropout, L1, and L2 — keeping models honest
- Epochs & Batching — How data is fed to the model in epochs, batches, and shuffles
References
- Perlich, Provost & Simonoff (2003), "Tree Induction vs. Logistic Regression: A Learning-Curve Analysis", JMLR
- Hestness et al. (2017), "Deep Learning Scaling is Predictable, Empirically"
- Kaplan et al. (2020), "Scaling Laws for Neural Language Models"
Last updated