Engagement · Retail and consumer goods

Store and product level demand forecasting, measured against a plain baseline, for a grocery retailer

A grocery retailer moves from rule-of-thumb ordering to a store and product forecast that is kept only where it beats a simple baseline.

The situation

A regional grocery retailer operates supermarkets and smaller convenience stores, which it supplies from its own distribution centers. Most of the range is replenished automatically, with the replenishment system proposing an order for each product in each store from a moving average of recent sales, a shelf minimum and the delivery schedule. Store managers then adjust those proposals by hand, and they do so most heavily for fresh produce, bakery and chilled goods and for anything on promotion.

The moving average causes most of the trouble, and it is also the benchmark any replacement has to beat. It takes no account of the day of the week, learns nothing from last year's holiday trading and treats a day on which the shelf was empty as a day with no demand, which leads to waste in fresh categories and gaps on promoted lines. The retailer abandoned an earlier attempt with a vendor's forecasting module because no one could show that it did better than the stores were already doing, and this design is built around avoiding that outcome.

What was going wrong

  1. Stockouts recorded as low demand

    If a product sells out by early afternoon, the sales history records what looks like a modest day. The moving average then lowers the next order, so the shelf empties even sooner, and over time the data trains the system to repeat the same shortage.

  2. Promotions forecast by instinct

    A promoted item can sell many times its usual volume while the items next to it sell less. Category managers estimate the uplift from memory, and the promotions calendar is held in a merchandising system that the replenishment logic does not read at all.

  3. Manual overrides that are never evaluated

    Store managers change a large share of the proposed orders. Some of those changes reflect local knowledge about a school holiday or nearby roadworks, while others are a matter of habit, and because overrides are stored without a reason, the retailer cannot tell which of them help.

  4. No agreed definition of better

    The earlier forecasting project reported a single accuracy figure averaged across all products, and that figure was dominated by steady sellers that almost any method predicts well. It told the retailer nothing about fresh items, promotions or new products, which are the areas where it loses money.

Our approach

In order
  1. Agree the measure and the baseline

    We would first settle with supply chain and finance how forecast error is measured, using volume-weighted absolute error and bias reported by category, by store format and separately for promoted days. The baseline is a seasonal naive forecast that uses the same weekday in recent weeks, and any model has to beat it in backtests on the segments that matter before it is used.

  2. Rebuild the demand history

    Sales are joined with stock on hand, deliveries, the promotions calendar, prices, store opening hours and public holidays. Days on which a product ran out partway through are flagged and their demand is estimated, because the recorded sales understate what customers would have bought.

  3. Model in steps, simplest first

    The first model after the baseline is a gradient-boosted model for each category, using calendar, price, promotion and weather features. More complex methods are tried only in segments where the backtest shows the results are still poor, and slow sellers with frequent zero days get a separate method designed for intermittent demand.

  4. Backtest under real ordering conditions

    Each backtest uses only the data that existed on the forecast date and is rolled forward week by week across a full year, holidays included. We report the results as the waste and availability the forecast would have produced through the existing ordering rules, alongside the error figures.

  5. Pilot against control stores

    A group of pilot stores orders from the new forecast for selected categories, while matched control stores carry on with the current process. Overrides in the pilot stores are captured with a reason code, and the comparison runs for long enough to cover at least one promotion cycle.

The design

The parts and what each one does
  • Daily data pipelines

    Point of sale transactions, stock positions, deliveries, prices and promotions arrive in the data platform every night, and tests for missing stores, duplicate files and implausible quantities run before any forecast is produced.

  • Demand history table

    The table holds a row for each combination of store, product and day, containing sales, an availability flag, estimated unconstrained demand, price and promotion status, and it serves as the single input for every model and every report.

  • Forecast models and registry

    The baseline and the candidate models are versioned in a registry together with their backtest results, and a model is promoted for a category only when it beats the current model on the agreed measures.

  • Forecast publication

    Each day a forecast with a prediction range is produced for every store and product over the ordering horizon, and it is written to the interface the replenishment system already reads, using that system's units and calendar.

  • Override capture

    When store managers change a proposed order, the change is recorded with a reason code and later compared with what actually sold.

  • Accuracy and drift dashboard

    A dashboard in the BI tool the supply chain team already uses shows error and bias by category, store and promotion status, compares each model with the baseline and is updated daily.

Safeguards

What keeps a bad day small
  • Fallback to the baseline

    When a night's data fails its checks, or a forecast for a product falls outside sensible bounds, the pipeline publishes the baseline for that product and raises an alert, so the replenishment run is never held up waiting for a model.

  • Limits on order changes

    During the pilot, an order generated from the new forecast is allowed to differ from the old proposal only within a band agreed for each category, and anything larger goes to a supply planner for approval.

  • Store managers keep the override

    The forecast produces a proposal, and a manager who knows about a local event can still change the order. The reason for each change is recorded so that this knowledge can later be turned into a model feature.

  • Weekly bias review

    If any category shows a persistent tendency to forecast high or low, a review is triggered before the bias turns into waste or empty shelves. Retraining follows a fixed schedule and requires a documented approval.

Timeline

  1. Weeks 1 to 2

    We agree the measures, the baseline and the pilot categories with supply chain and finance, and audit the data sources and the interface into the replenishment system.

  2. Weeks 3 to 5

    We build the pipelines and the demand history table with its availability flags, then publish the baseline's backtest so that everyone can see the starting point.

  3. Weeks 6 to 8

    Candidate models are trained and backtested by category, and we review the results segment by segment with the category planners and supply planners.

  4. Weeks 9 to 12

    Forecasts go to the pilot stores with the fallback and the order limits in place, and we capture overrides and compare the results with the control stores every week.

  5. After week 12

    The retailer makes the rollout decision on the evidence from the pilot, and operation, monitoring and retraining pass to its own team, with our support if it wants it.

What it changes

What the build is designed to change

The retailer ends up with a forecast whose performance it can examine and dispute. Every category has a published comparison between the model and the naive baseline over the same days, with promotions and fresh products reported separately. The baseline stays in use in categories where the model does not do better, which the reports state openly. In categories where the model does win, orders follow the weekday pattern, the holiday calendar and the promotion plan where they used to follow an average of recent weeks.

The design aims to improve two things that tend to pull against each other, which are waste in short-life categories and availability on the shelf. It also records store managers' local knowledge as reasons that can be tested. None of this is a reported outcome, since the pilot against control stores is how the retailer would find out whether the change is real, and the measures below are the ones it would use to judge it.

How success is measured

  • Weighted absolute error and bias by category, compared with the seasonal naive baseline
  • Forecast error on promoted days, reported separately from error on normal days
  • Waste in fresh categories in pilot stores, compared with the control stores
  • On-shelf availability in pilot stores, compared with the control stores
  • Share of proposed orders that were overridden, and whether those overrides improved the result

What generalizes

  1. A published baseline anchors every comparison

    A forecast is worth roughly the margin by which it beats the simplest sensible method. Publishing the baseline first gives finance a fixed reference point, shows the segments where modeling adds nothing, and prevents an averaged figure from hiding the categories that matter most.

  2. Recorded sales understate demand

    Sales history records what was sold, and that is capped by what was on the shelf at the time. Unless out-of-stock periods are identified and corrected, any model, however sophisticated, will learn to order too little of the products customers want most.

  3. Forecasts are judged through replenishment

    Pack sizes, shelf minimums and delivery days all sit between a forecast and the order that reaches a store. For that reason the test that counts is the outcome measured in stores through those rules, and the error shown on a chart is an intermediate result on the way there.

All engagements

If you have a similar problem, a two-week review is the usual place to start.

Tell us what you are trying to do and where it is stuck. A principal reads every message and replies within one working day.

How we engage

Start a conversation.

A short paragraph is enough. A principal reads every message and replies within one working day.

Or email hello@farside.works. We use what you send only to reply. Privacy