MLCrack

    TIME SERIES & FORECASTING · INTERVIEW QUESTION

    Why is random train-test splitting usually inappropriate for forecasting?

    🔴 advanced · Validation · Temporal Split

    Hint: Focus on the decision rule, assumptions, and failure mode behind validation · temporal split.

    Answer

    Forecasting evaluation should respect temporal ordering, typically using rolling-origin or forward-chaining validation.

    Interview reasoning

    A future forecasting test must not train on later timestamps. Replay rolling origins with the actual refit schedule and feature availability.

    A forecast test reproduces real decisions in order. At each origin, fit transforms and the model on then-available history and predict the production horizons. Keep later origins untouched after hyperparameter and window selection. The seasonal-naive baseline uses only information that the deployed service would have at the same cutoff.

    Worked example. For Monday refits, train through Sunday and predict fourteen days. Holiday dates are allowed, but realized future sales totals are not.

    Validation

    Check horizon errors and compare with seasonal-naive forecasts across several origins.

    Retain an origin-by-horizon error matrix, compare incumbents, and use temporal blocks for uncertainty rather than assuming independent rows.

    Common pitfalls

    Random rows and globally fitted preprocessing can both leak future information.

    Chronological splits still leak through full-history scaling, encoding, revisions and cross-series aggregates. Audit those transforms, not only split timestamps.

    Likely follow-up: Check horizon errors and compare with seasonal-naive forecasts across several origins.