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.
- Drop in performance: 40 − 2 = 38 percentage points
- 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
- Backtesting pitfalls: why past results mislead15 min lesson Free course: Advanced strategies & derivatives: Advanced
- Lab 7: watching a model overfit15 min lesson Free course: Financial Data Lab
- Backtesting properly: out-of-sample tests, walk-forward, multiple testing and overfitting15 min lesson Free course: Algorithmic trading
- Leakage, look-ahead bias and walk-forward validation15 min lesson Free course: AI and machine learning applied to financial data
- Indicators: what RSI and MACD compute, and nothing more15 min lesson Free course: Charts in context: technical analysis and its limits
Official sources
- Artificial intelligence · National Institute of Standards and Technology
- Engineering Statistics Handbook · National Institute of Standards and Technology
Facts last checked on 1 November 2026.
Education, not advice: the Stockertim Dictionary explains what terms mean. It never recommends buying or selling anything.