Skip to content

Temporal Cross-Validation

A random fold can leak information when financial labels use future prices or overlap in time. The notebooks compare random, ordered, purged, embargoed, and walk-forward designs on the same prediction task.

The central relation

Overlap between two information intervals is recorded by

Ii=[si,ei],Oij=1 ⁣{Ii∩Ij≠∅}.I_i=[s_i,e_i],\qquad O_{ij}=\mathbf 1\!\left\{I_i\cap I_j\neq\varnothing\right\}.

IiI_i is the information interval for observation ii, with start sis_i and end eie_i. The indicator OijO_{ij} equals one when observations ii and jj share any part of their information intervals.

Keeping future information out of validation

The anatomy figure shows which observations are removed around a test fold. The public comparison reports held-out accuracy across several temporal designs.

Training, test, purged, and embargoed observations arranged in time order.

Purging removes training labels whose information overlaps the test period. The embargo removes a short interval immediately after the test fold.

Public-data accuracy across random, ordered, purged, and embargoed validation folds.

Fold-level results reveal how the validation estimate changes when time order and information overlap are handled explicitly.

Temporal protection reduces a known source of leakage. It does not make later market conditions identical to the evaluation sample.

Notebooks