Time-based split

A time-based split respects the order of time: training on the oldest period, testing on the most recent. A random split would mix past and future and distort the evaluation through leakage. Validation uses successive folds, for example with TimeSeriesSplit.

Example

train, test = serie[:'2024-06'], serie['2024-07':]

Related concepts

The whole glossary