QUESTION 5 OF 10

Why should time-series validation respect chronological order?

Reveal the answer and explore the explanation.

05
MediumHigh priority

Why should time-series validation respect chronological order?

Answer
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 ↗

Last 30 min revisionHigh-yield interview Q&As