How do you reframe a forecasting problem as a supervised learning problem?

Quick Overview

Asks how to turn a time series forecasting task into a supervised learning dataset that a standard regression model can train on. Tests building lag and window features, defining one-step and multi-step targets, and validating without leaking future data.

How do you reframe a forecasting problem as a supervised learning problem?

Role: Data Scientist

Category: Statistics & Math

Difficulty: medium

Interview Round: Other

How do you reframe a forecasting problem as a supervised learning problem? Describe how you would build the feature matrix and target from a single time series so that a standard regression model can be trained on it, and how you would validate the result. ```hint One row per forecast Picture a table where each row is one moment at which you would make a forecast. Ask what you already know at that moment and what you want to predict. ``` ```hint Look for the future Check every feature and every train and validation split for information that would not exist yet at the time of the forecast. ``` ### What a Strong Answer Covers - How a sliding window turns past values into features and a future value into the target - Choosing the window length and adding rolling, calendar and exogenous features - Defining the target for one-step and multi-step horizons - Validation that respects time order and keeps future information out of every feature ### Follow-up Questions - For a 7-day horizon, compare the recursive, direct and multi-output strategies. Which would you pick and why? - A gradient-boosted model on lag features does badly on a series with a strong upward trend. Why, and how would you fix it? - You want to use tomorrow's weather as a feature. What changes between training time and prediction time? - How would you train one model across thousands of related series, such as daily sales per store?

Overview: Asks how to turn a time series forecasting task into a supervised learning dataset that a standard regression model can train on. Tests building lag and window features, defining one-step and multi-step targets, and validating without leaking future data.

Nov 24, 2026
mediumData ScientistOtherStatistics & Math
0
0

How do you reframe a forecasting problem as a supervised learning problem? Describe how you would build the feature matrix and target from a single time series so that a standard regression model can be trained on it, and how you would validate the result.

What a Strong Answer Covers Guidance

  • How a sliding window turns past values into features and a future value into the target
  • Choosing the window length and adding rolling, calendar and exogenous features
  • Defining the target for one-step and multi-step horizons
  • Validation that respects time order and keeps future information out of every feature

Follow-up Questions Guidance

  • For a 7-day horizon, compare the recursive, direct and multi-output strategies. Which would you pick and why?
  • A gradient-boosted model on lag features does badly on a series with a strong upward trend. Why, and how would you fix it?
  • You want to use tomorrow's weather as a feature. What changes between training time and prediction time?
  • How would you train one model across thousands of related series, such as daily sales per store?