Skip to main content
Blog home
Newsletter
News
Video
Podcast
Reading list
Wright Brief
Sign In

What is Out-of-Sample Testing?

A plain-language explanation of Out-of-Sample Testing, with a worked example, common pitfalls and the questions people ask most.

Listen to this article
Audio · ~3 min
Add as a preferred source on Google

Out-of-sample testing evaluates a model on data that was not used during its development. This step helps determine whether observed performance reflects real predictive power or merely overfitting.

Typically, historical data is divided into two parts: in-sample data for building the model and out-of-sample data for validation. If a strategy performs consistently across both, confidence in its robustness increases.

Out-of-sample testing mimics real-world conditions. The model must operate without access to future information, revealing how it might behave in live markets.

Quant frameworks often extend this concept through walk-forward testing, where models are repeatedly trained and evaluated on rolling windows. This better reflects evolving market dynamics.

Strong in-sample results alone are not meaningful. Many strategies look impressive on historical data but fail when applied to unseen periods.

Out-of-sample performance helps identify unstable signals, regime sensitivity, and drawdown characteristics that may not appear in optimized backtests.

While no test can guarantee future success, out-of-sample validation is a critical filter for separating durable strategies from data-mined artifacts.

Ways to split the data

MethodHow it worksWatch out for
HoldoutDesign the model on an early period and test once on a later oneOnly one test, and a short holdout gives noisy results
Walk-forwardDesign on a window, test on the next period, then roll both forward and repeatMore work, but it mimics how the model would have been used
Time-series cross-validationSeveral train and test splits that always keep the test period after the training periodTest windows must not overlap the training data

An illustrative example

A researcher has 10 years of monthly data and designs the model on the first 7 years, which is 84 months. The last 3 years, 36 months, are kept aside. In a walk-forward version, the model might be designed on 5 years, tested on the next year, then moved forward a year and repeated, giving several separate test results. The numbers are illustrative.

How the test goes wrong

  • Peeking. If the model is changed after seeing the out-of-sample result, that data has become part of the design, and the test no longer counts. See overfitting.
  • Leakage. If returns overlap the boundary between the training and test periods, information from the test period leaks into the design. A gap between them (an embargo) reduces this.
  • A short test. Three years of monthly data is only 36 observations, which is weak evidence, especially if the period is unusual.
  • Same period, different test. Testing on other stocks in the same years is not the same as testing on new years.

Reading the result

A strong in-sample result and a similar out-of-sample result is encouraging. A large gap, or a sharp drop in the out-of-sample period, suggests the model fitted noise. A good out-of-sample result still describes only the past, so it is a filter for weak ideas and not proof of future performance. See backtesting and model drift.

Frequently asked questions

What is out-of-sample testing?

It is testing a model on data that was not used to build it, so the result shows whether the model works beyond the period it was designed on.

What is the difference between in-sample and out-of-sample?

In-sample data is used to design or tune the model. Out-of-sample data is kept separate and used only to check the finished model.

What is walk-forward testing?

It repeats the process of designing a model on a window of past data and testing it on the period that follows, rolling forward through time to produce several out-of-sample results.

Does passing an out-of-sample test mean a strategy will work?

No. It lowers the chance that results are a data-mining artefact, but market conditions can change and no test guarantees future performance.

Further reading

  1. Pardo, R. (2008). The Evaluation and Optimization of Trading Strategies, 2nd ed. Wiley.
  2. Lopez de Prado, M. (2018). Advances in Financial Machine Learning. Wiley.
Browse the full Quant Glossary →

Disclaimer: Investment in securities market are subject to market risks. Read all the related documents carefully before investing. Registration granted by SEBI, membership of a SEBI recognized supervisory body (if any) and certification from NISM in no way guarantee performance of the intermediary or provide any assurance of returns to investors.

The content in these posts/articles is for informational and educational purposes only and should not be construed as professional financial advice and nor to be construed as an offer to buy/sell or the solicitation of an offer to buy/sell any security or financial products. Users must make their own investment decisions based on their specific investment objective and financial position and using such independent advisors as they believe necessary.

Wryght Research & Capital Pvt (Brand name: Wright Research) is a SEBI Registered Portfolio Manager Reg No: INP000007979 (Validity: Apr 03, 2023 – Perpetual) and a SEBI Registered Research Analyst No: INH000017295 (Validity: Jul 03, 2024 – Perpetual), with its registered office at 103, Shagun Vatika Prag Narayan Road, Lucknow, UP, 226001 India and CIN: U67100UP2019PTC123244. Past performance may or may not be sustained in future. Performance provided there in is not verified by SEBI. Investment in securities is subject to market and other risks, and there is no assurance or guarantee that the objectives of any of the strategies of the Portfolio Management Services will be achieved. Registration granted by SEBI, enlistment as RA with Exchange and certification from National Institute of Securities Markets (NISM) in no way guarantee performance of the intermediary or provide any assurance of returns to investors. Please read the Disclosure document carefully before investing. Securities quoted are for illustration only and are not recommendatory. Charts shown are for illustration only. For more information and disclosures, visit our disclosures page here.

Found this useful? Share it.
Wright PMS · Portfolio Management Service

Put this research to work

The same 300+ factor research engine behind this article — applied to a professionally managed portfolio, end to end.

300+
Factors tracked
2L+
Investors
₹1,200+ Cr
Invested
SEBI
Registered PMS