Why should time-series validation respect chronological order?
Reveal the answer and explore the explanation.
05MediumHigh priorityWhy should time-series validation respect chronological order?
Answer
MediumHigh priority
Why should time-series validation respect chronological order?
Answer
Training on future observations can leak information unavailable at the prediction time.
Practical example
Train on earlier months and evaluate on subsequent months.
PythonRelated concept example
from sklearn.model_selection import TimeSeriesSplit
X = list(range(8))
for train, test in TimeSeriesSplit(n_splits=3).split(X):
print(train, test)Each split trains on earlier observations and evaluates later observations.
Reference: Further reading ↗