Quant research and backtesting
In-sample and out-of-sample
Also called IS and OOS, training and test data, holdout
In-sample data is used to build and tune a strategy; out-of-sample data is kept untouched and used once to test the finished strategy on unseen data.
How it works
Out-of-sample results are only honest if the data was never used in any decision, including choosing which idea to pursue. Once a researcher looks at the holdout, changes the strategy and looks again, the holdout has become in-sample. Time series need a split in time (train on earlier, test on later) rather than a random split, because shuffled rows let the model learn from neighbouring periods. A gap between in-sample and out-of-sample performance is expected; a very large one points to overfitting or to a regime change.
Worked example
Data from 2010 to 2024. Build and tune on 2010 to 2019, then run the final version once on 2020 to 2024. If the in-sample Sharpe ratio is 1.8 and the out-of-sample one is 0.3, most of the in-sample result was probably fitted noise.
Related terms
Put it to work in a timed game.
Practise with Find the BugSources
Last checked November 2026.