MLCrack

    TIME SERIES & FORECASTING · INTERVIEW QUESTION

    Why can a centered rolling average leak information into a forecast?

    🔴 advanced · point-in-time feature correctness

    Hint: Every feature must be reconstructed using only information available at the forecast origin.

    Answer

    Its window includes observations after the forecast origin.

    Interview reasoning

    Use a trailing window over available data and test the exact transformation in historical replay.

    Every feature must be reconstructed using only information available at the forecast origin.

    A forecasting row has both a target time and a forecast origin. Availability, rather than event time alone, determines which values belong in the feature vector. Construct historical vintages including publication delays; fit preprocessing inside the origin's training window.

    Worked example. A centered seven-day mean uses three future days; a trailing window avoids that lookahead.

    Validation

    Use rolling-origin backtests and point-in-time joins.

    Assert availability_time <= origin for contributing records as well as final aggregates. Compare vintage-aware scores with finalized-data scores.

    Common pitfalls

    Revised values and future aggregates leak information into training.

    Shifting a column one row does not repair publication delays, revised history, or cross-series aggregates built from future observations.

    Likely follow-up: How would you prove a forecasting feature was available for every historical prediction?