liveBook · Manning

Demand forecast

As explained in Machine Learning System Design

Demand forecasting is the process of estimating future demand for a product or service over a specified time period.

A retailer must decide how many units to buy or produce before the next delivery. Buy too many and goods remain unsold; buy too few and the store risks running out. A demand forecast estimates what each product will need at each store so purchasing decisions can better balance those outcomes. section 4.3

A practical forecast starts with the decision and follows it into production:

  • Define the prediction unit. In the retail case, forecasts are made per SKU per store, using product, store, and transaction information. section 6.7.1
  • Gather useful signals. Transaction history supplies the target; product categories, shelf life, store location, weather, nearby customer traffic, and optional app or website activity can add context. Transaction history does not require a separate labeling exercise. section 6.7.1
  • Establish baselines before choosing a more elaborate model. Compare a weekly sales lag, historical quantiles, linear regression with lagged and rolling features, and time-series approaches such as ARIMA, SARIMA, or Prophet. section 8.6.1
  • Plan delivery as well as prediction. Large daily, weekly, and monthly runs favor scheduled batch jobs, with checks for job failures, data validity, and prediction accuracy against actual demand. section 15.5.1

A first forecast for a grocery item

Suppose a store needs a forecast for an item on September 8. Using September 7 sales may be unreliable if data arrives late, and it misses the weekly pattern in grocery sales. A simple baseline instead uses that item’s sales at that store on September 1. This gives the team a concrete result to improve on before investing in a more complex model. section 8.6.1

Forecast quality is only part of the design. Shelf life affects the cost of overpredicting a product, while production jobs must process large volumes of sensitive inventory and sales data economically. Monitor both the predictions and the batch system; use production results to decide whether further optimization is worthwhile. section 6.7.1 section 15.5.1

How Machine Learning System Design covers it

How deep it goes
Develops the problem through data selection, several baselines, and batch-serving plans rather than a detailed forecasting-algorithm derivation.
Examples
Uses a multi-store retailer, an item’s sales one week earlier, and progressively richer forecasting baselines.
What you can do after
Operate/configure it as scheduled batch forecasting with scalable jobs and checks on data, failures, and prediction accuracy.
How it connects
Connects demand forecasting to transaction history, seasonality, quantile loss, time-series models, batch inference, and prediction monitoring.

Also explained in

Compare how 2 books explain demand forecast →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Machine Learning System Design. The section links point to the parts of the book it draws on.