Quant research and backtesting

Purged cross-validation

Also called purged k-fold, purging and embargo, combinatorial purged cross-validation, CPCV

Cross-validation for financial labels that removes training observations whose label windows overlap the test set (purging) and also those just after it (embargo), to stop leakage.

How it works

Financial labels often span time, for example the return over the next 10 days, so an observation just before a test block shares future returns with the test labels. Ordinary k-fold lets the model learn those shared returns and inflates the score. Purging drops every training observation whose label period overlaps the period spanned by the test labels. The embargo then drops a further band of training observations right after the test block, because features are serially correlated and can still carry test information. Lopez de Prado set this out in Advances in Financial Machine Learning (2018); the combinatorial version splits the sample into N groups and uses every combination of k of them as the test set, which builds many backtest paths instead of one.

Worked example

Daily data, label = return from close t to close t+10, test block = days 200 to 299 (labels span to day 309). Purging removes training days 191 to 199 and 300 to 308, whose labels overlap that span. An embargo of 1% of a 1,000-day sample then removes 10 more days after that, up to day 318.

Put it to work in a timed game.

Practise with Find the Bug

Sources

  1. skfolio.org/generated/skfolio.model_selection.CombinatorialPurgedCV.html
  2. pypi.org/project/purgedcv/

Last checked November 2026.

← All 281 glossary terms

Was this definition clear?