How do you window and scale sequences when preparing time series data for a neural forecasting model?

Quick Overview

Asks how to turn time series into training samples for a neural forecaster with a lookback window and a forecast horizon, and how to scale each series. Tests windowing, multi-step targets, covariate alignment, per-series scaling and avoiding leakage across the train and validation split.

How do you window and scale sequences when preparing time series data for a neural forecasting model?

Role: Data Scientist

Category: Statistics & Math

Difficulty: medium

Interview Round: Other

How do you window and scale sequences when preparing time series data for a neural forecasting model? ```hint Write out the samples List the (input, target) pairs that one series of length $T$ yields for a lookback of $L$ steps and a horizon of $H$ steps. ``` ```hint Where the statistics come from For every number your scaler uses, ask whether it would be known at the moment the forecast is made. ``` ### What a Strong Answer Covers - How lookback length, horizon and stride turn one series into training samples, and how multi-step targets are produced - Aligning past-only and known-future covariates with each window - Per-series scaling choices, transforms for positive or multiplicative data, and inverting predictions for evaluation - Preventing leakage through the split, the scaler and windows that straddle the split point - Handling missing values, padding and series shorter than one window ### Follow-up Questions - How would you choose the lookback length? - A series' level drifts upward over time. Why might scaling each window by its own context beat a scaler fit once on the training period? - When would you prefer recursive multi-step forecasting over predicting all steps directly? - How do you train on series that are shorter than the lookback plus the horizon?

Overview: Asks how to turn time series into training samples for a neural forecaster with a lookback window and a forecast horizon, and how to scale each series. Tests windowing, multi-step targets, covariate alignment, per-series scaling and avoiding leakage across the train and validation split.

General logo
General
Nov 24, 2026
mediumData ScientistOtherStatistics & Math
0
0

How do you window and scale sequences when preparing time series data for a neural forecasting model?

What a Strong Answer Covers Guidance

  • How lookback length, horizon and stride turn one series into training samples, and how multi-step targets are produced
  • Aligning past-only and known-future covariates with each window
  • Per-series scaling choices, transforms for positive or multiplicative data, and inverting predictions for evaluation
  • Preventing leakage through the split, the scaler and windows that straddle the split point
  • Handling missing values, padding and series shorter than one window

Follow-up Questions Guidance

  • How would you choose the lookback length?
  • A series' level drifts upward over time. Why might scaling each window by its own context beat a scaler fit once on the training period?
  • When would you prefer recursive multi-step forecasting over predicting all steps directly?
  • How do you train on series that are shorter than the lookback plus the horizon?