Retail Demand Forecasting
Asked of: Data Scientist
Last updated
What's being tested
Interviewers are probing your ability to turn retailer signals into reliable, operational demand forecasts: problem framing, appropriate model choice, evaluation with business-aligned metrics, and communicating uncertainty and risk to downstream inventory and buying teams. Expect questions that test time-series reasoning (seasonality, promotions, stockouts), evaluation design (rolling-origin backtests, forecast horizons), and principled tradeoffs between accuracy, complexity, and maintainability.
Core knowledge
-
Forecast horizon & cadence: Match horizon (e.g., 1–4 weeks vs 13 weeks) to supply-chain lead times; daily forecasts often require more noise-handling than weekly aggregation which stabilizes variance.
-
Censoring / stockout bias: Sales data often show observed sales = min(true demand, inventory). Treat as censored demand; consider imputation, censorship models, or auxiliary
`on_hand`signals rather than naively training on observed sales. -
Intermittent demand: For many
`SKU`-store series with many zeros, use Croston or zero-inflated models, frequency/size decomposition, or global methods that pool information across items to avoid overfitting zeros. -
Model families & tradeoffs: Local ARIMA/ETS fit per series for explainability; global ML models (
`LightGBM`,`XGBoost`, neural nets) scale better across millions of series and learn cross-series patterns, but need careful feature engineering and calibration. -
Feature engineering essentials: Lags, rolling means, price elasticity, promotion flags, day-of-week/holiday encodings, store-level seasonality, and inventory-level flags; lag windows typically 1–52 weeks and decay-weighted aggregates.
-
Evaluation: rolling-origin & business metrics: Use rolling-origin cross-validation (walk-forward) and report multiple metrics:
`MAE`/`RMSE`for scale,`MAPE`with caution (zeros), and RMSSE for comparability across items: -
Probabilistic forecasts & loss functions: For inventory decisions, predict quantiles; train with pinball (quantile) loss: Also evaluate using
`CRPS`when full distributions are available. -
Hierarchy & reconciliation: Forecasts must be coherent across
`SKU`→store→region→category. Reconcile using bottom-up, top-down, or statistical methods like MinT (Minimum Trace) for optimal variance-adjusted reconciliation. -
Promotion & causal lift: Promotions change baseline demand and create displacement/cannibalization effects; for attribution, combine forecasting with uplift or causal methods (difference-in-differences, synthetic control) before embedding promotion-adjusted features.
-
Cold-start / new-product strategies: Use attribute-driven forecasting (category/brand/price band), Bayesian hierarchical shrinkage, or analog-series matching. Always inflate uncertainty and consider experimentation for learning.
-
Operational constraints & calibration: Penalize under-forecast vs over-forecast differently depending on stockout cost vs holding cost. Calibrate probabilistic forecasts using reliability diagrams and sharpness metrics before deployment.
-
Scale & deployment considerations (DS lens): For millions of series, prefer global models with per-series embeddings, incremental retraining cadence aligned to data freshness, and robust backtesting that simulates production refresh and latency.
Worked example
Problem frame: "Forecast weekly demand for a `SKU` at store-level for the next 13 weeks given 3 years of POS sales, prices, promotions, holidays, and inventory snapshots." First 30s: clarify horizon, aggregation level (store vs region), whether inventory records contain stockouts, and business loss asymmetry (stockout vs overstock cost). Skeleton answer pillars: (1) Data preparation — flag stockout periods and impute censored demand; (2) Features — construct lags (1,2,4,13), rolling means, price elasticities, promotion encodings, holiday indicators; (3) Model — choose a global gradient-boosted tree (`LightGBM`) with quantile objectives to produce 10/50/90% forecasts; (4) Evaluation — rolling-origin backtest with RMSSE and pinball loss, and reconciliation if rolling up to region. Tradeoff to call out: per-`SKU` local ARIMA models are interpretable but won't share signal across sparse series, so I’d prefer a global model unless the business demands per-item explainability. Close: "If I had more time, I'd run a promotion-causal lift study to separate baseline vs promotional uplift and then retrain the forecast model on baseline-adjusted demand."
A second angle
Consider "forecasting demand for brand-new product launches." The same principles apply but with different emphasis: you cannot learn per-series lags, so rely on attribute-based features (category, price point, pack size), analogous-item time-series clusters, and Bayesian hierarchical models that borrow strength from category-level priors. Evaluation shifts from historic backtests to simulation and early-launch A/B tests; you must present wide prediction intervals and plan rapid learning (short retraining cycles) once early sales arrive. The interviewer will judge whether you can adapt pooling, uncertainty, and experiment-driven learning to a cold-start setting.
Common pitfalls
Pitfall: Using
`MAPE`blindly for series with zeros or very low volume.
MAPE explodes on zeros and biases against low-volume items. Use `MAE`, `RMSE`, or RMSSE for comparisons, and report quantile coverage for uncertainty.
Pitfall: Ignoring censoring caused by stockouts.
Training on observed sales without correcting for stockouts underestimates true demand. Flag periods with zero sales and no inventory, impute or model censoring explicitly, and leverage `on_hand` signals where available.
Pitfall: Presenting point forecasts without business context.
Giving a single point estimate without quantifying downside risk (e.g., 90th percentile for safety stock) or stating cost asymmetry (stockout vs holding) loses credibility. Always link forecast outputs to a downstream decision metric.
Connections
Related pivots include inventory optimization (safety stock and reorder points derived from forecast uncertainty), price-elasticity modeling (integrate demand response into forecasts), and causal inference for promotion lift (if asked why promotions spike baseline demand).
Further reading
-
Forecasting: Principles and Practice (Hyndman & Athanasopoulos) — practical time-series methods and evaluation guidance.
-
M5 Forecasting Competition (Kaggle) — real-world retail forecasting patterns, hierarchical reconciliation, and probabilistic scoring techniques.
Related concepts
- Conversion Rate ForecastingMachine Learning
- Inventory Replenishment And Stockout Analytics
- Predictive Modeling For Delivery And Marketplace DecisionsMachine Learning
- Supply Chain Fulfillment ETA Modeling
- Product Metrics, Root-Cause Analysis And VisualizationAnalytics & Experimentation
- Pricing, Demand, And Capacity OptimizationAnalytics & Experimentation