Time-series cross-validation evaluates a model using training observations that occur before the observations used for testing. Unlike ordinary shuffled cross-validation, the split must respect the sequence in which information became available.
Why ordinary random folds can fail for time series
Randomly mixing past and future observations can allow the model to learn relationships from later periods and then be scored on earlier periods. That reverses the real decision process and can produce an optimistic estimate of generalization.
For time-ordered data, the training observations should precede the test observations so the evaluation does not train on future information and score on the past.
Expanding-window validation
In an expanding design, the training set grows over time. For example, train on periods 1–100 and test on 101–120; then train on 1–120 and test on 121–140.
This matches a process in which all historical observations remain available. It may be inappropriate when very old data should no longer influence the model.
Rolling-window validation
A rolling design keeps a limited training history. A later fold might train on periods 21–120 and test on 121–140 rather than keeping periods 1–20.
The window length is a modeling choice. Short windows adapt faster but use less data; long windows estimate parameters with more observations but may retain stale regimes.
The test horizon must match the decision horizon
A one-step forecast, five-day forecast and one-month holding-period model should not be evaluated with identical split logic merely for convenience. The test block should represent how the prediction or decision will actually be used.
Preprocessing belongs inside each training fold
Scaling, feature selection, missing-value imputation, dimensionality reduction and target-dependent transformations can leak information if they are fitted once on the entire dataset before cross-validation.
Fit those steps on the training portion of each fold, then apply the learned transformation to the later test portion.
Feature timestamps matter as much as row timestamps
A row dated 1 June can still contain look-ahead bias if one feature was only published, revised or computable after 1 June. Research should record when each feature became genuinely available for a trading decision.
A gap can be useful when information overlaps
Some applications exclude observations between train and test sets when labels, holding periods or engineered features overlap across the boundary. The size and need for a gap depend on the data-generating process.
A gap is not a universal statistical requirement; it is a leakage control used when the information structure justifies it.
Cross-validation is not a license for unlimited model searching
Trying many features, algorithms and hyperparameters against the same folds can overfit the validation process itself. A final untouched evaluation period can provide additional evidence after model selection.
Trading Strategy Overfitting explains the wider selection problem.
Walk-forward analysis is related but operationally different
Walk-Forward Analysis usually emphasizes repeated research or optimization followed by a forward segment, often with parameter updates between windows. Time-series cross-validation is the broader statistical framework for ordered train/test folds.
Report the split design, not just the score
State the training window, test window, gap if any, number of folds, feature-availability rule, preprocessing procedure, tuning process and transaction-cost assumptions.
The purpose of time-series cross-validation is to reproduce the information boundary faced by a real decision. A sophisticated model evaluated with future leakage is weaker evidence than a simpler model tested in the correct temporal order.