Demand Forecasting with Machine Learning: A Practical Guide for Retail and Supply Chain

How machine learning improves demand forecasting for retail, FMCG and supply chain: the data, models, accuracy metrics and replenishment that work.

Machine learning forecasting predicts future demand at a fine level — such as SKU by store by week — by learning from sales history together with drivers like price, promotions, holidays, seasonality and stock availability. Gradient-boosted models and modern statistical methods are strong, practical choices; the real gains come from clean data, hierarchical forecasts planners can adjust, and tying forecasts directly to replenishment.

Why move beyond spreadsheet forecasting?

Spreadsheet and moving-average forecasts work for a handful of stable products. They struggle with thousands of SKUs, many locations, frequent promotions and events such as festivals, where demand shifts sharply and differently by region.

Machine learning models learn these patterns across the whole catalogue at once, so a new promotion or a regional festival is handled consistently rather than by individual judgement in each spreadsheet.

What data do you need?

Start with what most businesses already have, then enrich:

Which forecasting models work in practice?

Gradient-boosted trees such as LightGBM and XGBoost, trained on lag features, calendar features and promotions, are robust and widely used for retail demand. Statistical methods such as exponential smoothing and ARIMA (for example via statsforecast) remain strong baselines, especially for stable series. Prophet is convenient for series with clear seasonality and holiday effects. Deep learning models such as the Temporal Fusion Transformer can help with very large catalogues and many drivers.

In practice, an ensemble or a well-tuned boosted model with good features usually beats a single sophisticated model. Always compare against a simple baseline, such as last year's same period.

How do you measure forecast accuracy?

Use metrics that reflect business impact. Weighted MAPE or WAPE weights errors by volume so fast movers count more; bias shows whether you systematically over- or under-forecast, which drives excess stock or stock-outs. Measure at the level decisions are made, and backtest across several past periods, including promotions and festivals.

Report accuracy by segment — fast movers, slow movers, new products — because each needs a different approach.

How do forecasts turn into better inventory decisions?

A forecast only creates value when it changes what is ordered and where it goes:

How do you keep forecasts reliable over time?

Treat forecasting as a production system. Automate data pipelines, retrain on a schedule, track accuracy and drift with MLOps tooling such as MLflow, and alert when performance degrades. Platforms like Databricks make it practical to train and score thousands of series in parallel.

We build forecasting and demand-planning systems for retail, FMCG, insurance and supply-chain teams — our forecasting service page covers the approach.

  • Sales or shipment history at the level you plan (SKU, location, day or week) — ideally two years or more.
  • Price and promotion calendars, including discounts and marketing campaigns.
  • Holidays and local events, which vary by region.
  • Stock-outs and availability, so lost sales are not mistaken for low demand.
  • Product attributes and hierarchy, to forecast new or slow-moving items from similar ones.
  • Optional external signals such as weather or market indices where they genuinely help.
  • Hierarchical reconciliation keeps SKU, category and regional forecasts consistent.
  • Safety stock and reorder points are set from forecast error and supplier lead times.
  • Replenishment suggestions flow directly into the ERP or ordering system.
  • Planners can review and override with notes, and overrides are measured.
  • Exceptions — unusual spikes, drops or new items — are flagged for attention.