FREE FINANCIAL EDUCATION
Purging and embargo for overlapping labels
Remove training labels whose information intervals overlap held-out labels.
What you will learn
Prerequisites: Interpret observation intervals and distinguish training eligibility from chronological deployment.
- Remove training labels whose information intervals overlap held-out labels.
- Apply a separately declared embargo after the held-out interval.
- Explain why these exclusions do not authorize future-data training in a forward simulation.
Mechanism and decision rules
A training sample can start before a test interval yet use an outcome that ends inside it. Purging removes such overlapping information so that a label shared across the boundary does not leak test outcomes into fitting. Represent each label by its start and end timestamps. For this lesson, intervals are closed: a shared endpoint counts as overlap. Two intervals overlap when the later start is no greater than the earlier end.
An embargo is an additional exclusion of a declared number of observation starts after the held-out interval. It addresses a different concern from direct label overlap and is not a substitute for mapping those overlaps. The following examples describe a cross-validation design that considers training observations on both sides of a held-out segment. In a genuinely forward deployment evaluation, later observations remain unavailable regardless of whether they pass a purge or embargo check.
Worked example · synthetic data
Hypothetical held-out labels span [10,13] and [11,14], with union [10,14]. Candidate training intervals are A=[5,8], B=[8,10], C=[9,12], D=[15,17] and E=[17,19]. Closed-interval purging removes B and C. A two-start embargo excludes starts 15 and 16, so D is also removed. A and E remain for this specified cross-validation split. E would still be ineligible for a decision at time 10 in a strict forward backtest; passing a cross-validation exclusion is not evidence of historical availability.
Failure modes and limits
Real labels can end at different times, and feature windows may introduce additional dependencies. Date-only timestamps can hide intraday overlap. Purging also does not fix preprocessing fitted on the whole dataset, revised data or a test set repeatedly used for model design. Specify whether an embargo uses calendar time, trading observations or a fraction of records, and inspect boundary examples before relying on a library default.
Practice case
A separate held-out label covers [20,23]. Candidate training intervals are [15,19], [18,20], [23,25], [24,26] and [26,28]. Under the same closed-interval rule and an embargo excluding starts 24 and 25, identify the intervals removed by purging, those removed only by embargo, and those retained for this split.
Reveal the worked answer
Purging removes [18,20] and [23,25] because each shares an endpoint with the held-out interval. [24,26] does not overlap directly but its start falls in the embargo, so it is excluded. [15,19] and [26,28] remain for the stated split. Only the earlier retained interval could be available for a historical decision at time 20 under a forward-only policy.
Check your understanding
Sources and next steps
The lesson, calculations and synthetic cases are original educational material. References explain underlying contract or chart conventions; none validates the profitability of a trading rule. Actual contract specifications, settlement obligations and charges must be checked before trading.
Explore OHLCV data in the chart lab · Explore volume-at-price and TPO data · Practice library
