Skip to content

Non ancora disponibile in italiano. Vedi tutto ciò che è disponibile in italiano

Stockertim Dictionary · Technology · Investing

Overfitting

Also called overfit

In short

When a model learns the noise and quirks of its training data so closely that it looks excellent on past data but performs poorly on new data.

  • Intermediate
  • Concept
  • Checked

In detail

Every data set mixes real patterns with random noise. A model with enough flexibility, such as a deep neural network or a trading rule with many adjustable settings, can bend itself to fit every wiggle of the past, including the noise. It then scores brilliantly on the data it was built from. Faced with fresh data, where the noise is different, the apparent skill disappears. That gap between in-sample and out-of-sample performance is the signature of overfitting.

The risk grows when a model has many parameters relative to the amount of data, when the same data is tested again and again, and when researchers keep trying variations until something works. In investing this last habit is often called data snooping or data mining: test a thousand random rules and some will look profitable purely by chance. The opposite problem, underfitting, is a model too simple to capture the real pattern.

Defences are well established. Hold back a test set the model never sees until the end; use cross-validation to check stability across different slices; prefer simpler models where they perform almost as well; penalise complexity during training; and, in finance, test on later time periods than those used to build the model. Most important is scepticism: a result that looks too good on historical data usually is.

Worked example

A trading rule with 12 tuned settings earned 40% a year in a 2016 to 2021 back test, then 2% a year in 2022 to 2025.

  1. Drop in performance: 40 − 2 = 38 percentage points
  2. Share of the original result that survived: 2 / 40 = 5%

Only 5% of the back-tested return carried over to new data, a classic sign that the rule was fitted to noise.

In practice

Data scientists report results on a separate test set and compare against a simple baseline. Quantitative investors record how many strategies they tried before choosing one, test on later periods and other markets, and treat high returns from heavily tuned rules with suspicion.

Watch out

  • High accuracy on training data is not evidence of a good model; only unseen data tells you that.
  • Overfitting is not only a machine learning issue; a spreadsheet trading rule tuned by hand can overfit just as badly.

Learn it properly

Official sources

Facts last checked on 1 November 2026.

Education, not advice: the Stockertim Dictionary explains what terms mean. It never recommends buying or selling anything.

English