← Back

AI Demand Forecasting: Test It Against Your Current Forecast

TL;DR

A forecast can have a smaller average error and still lead to the wrong stock decision. Compare both with a transparent four-week example.

Conceptual illustration for AI Demand Forecasting: Test It Against Your Current Forecast

AI demand forecasting uses learned patterns in historical data to estimate future demand. Its value depends on whether those estimates improve a real decision—what to order, prepare or staff—compared with your current forecast. A lower average prediction error is useful evidence, but it is not the same as lower operating cost.

Before commissioning a model, save the forecasts your team already makes. Record when they were made, what information was available and what happened afterwards. Without that baseline, “better forecasting” is an attractive claim with no fair comparison.

The worked example here uses invented demand and forecast values. It demonstrates how to evaluate a proposal; it does not claim that an AI model has achieved these results.

Define the decision and the horizon first

A forecast for tomorrow's bakery production is not the same problem as a forecast for an imported component with a long lead time. The output needs to match the decision window.

Write a sentence such as: “Every Monday, the planner decides how many units of each product to order for delivery the following week.” That gives the experiment a forecast origin, a lead time, a horizon and a decision owner.

Then define the unit. Are you forecasting individual products, categories, locations or the whole business? A total can look accurate while important products are repeatedly understocked. Conversely, a noisy individual-product forecast may still support a useful aggregate staffing decision.

Record the constraints that sit between a forecast and an order: minimum quantities, pack sizes, shelf life, supplier availability and storage capacity. The model does not remove them. A forecast of 37 units may become an order of 48 because the product arrives in packs of 12.

Forecast evaluation example: baseline MAE 15, candidate MAE 10, and an illustrative £5 understock cost that changes the decision.
Fictional four-week arithmetic example, not a trained-model result. Costs and demand are illustrative assumptions.

A four-week example: accuracy and cost disagree

Consider a fictional product with the following actual demand and two forecasts. Both forecasts are manually specified for this illustration; neither comes from a trained model.

Week Actual demand Current forecast Candidate forecast
1 100 110 95
2 120 100 105
3 80 100 75
4 100 90 85

The current forecast has absolute errors of 10, 20, 20 and 10 units. Its mean absolute error, or MAE, is 60 ÷ 4 = 15 units. The candidate's errors are 5, 15, 5 and 15: 40 ÷ 4 = 10 units.

On MAE, the candidate wins. But it underforecasts every week.

Now use a deliberately simplified cost model: £5 for each unit of unmet demand and £1 for each excess unit. Assume orders equal forecasts, no opening stock, and no stock carried between weeks. These are illustrative penalty values, not a claim about your margins or accounting costs.

Measure Current forecast Candidate forecast
Total underforecast units 30 40
Total overforecast units 30 0
Illustrative cost £180 £200

The arithmetic is 30 × £5 + 30 × £1 for the current forecast, versus 40 × £5 for the candidate. The lower-error forecast produces the higher cost under these assumptions.

This does not prove the candidate is commercially worse in a real business. It proves that the choice depends on the loss you care about. Change the costs, inventory policy or carry-over assumptions and the decision may change. Four weeks are far too little evidence for a production recommendation.

Compare with a baseline that deserves to be beaten

Use the current planning process, including its recorded human overrides. Also include a simple reference such as the previous comparable period. If weekly seasonality matters, comparing a Monday with the preceding Sunday may be a weak test.

The forecasting text Forecasting: Principles and Practice explains simple benchmark methods, held-out forecast accuracy and time-series cross-validation. The practical implication is to evaluate forecasts against observations that were not available when those forecasts were made.

Keep the comparison fair. The candidate and baseline should forecast the same products over the same horizon, using information available at the same point. If one receives a confirmed promotion calendar and the other does not, report that difference. You may have improved the planning inputs rather than the forecasting method.

Do not remove difficult weeks merely because they make the result look worse. Flag data-entry errors, genuine demand shocks and stockouts separately. Each calls for a different response.

Prevent information from leaking backwards

A random split can mix earlier and later observations in a way that does not resemble deployment. Use chronological evaluation and repeat it across several forecast origins.

For example, train through the end of one period, predict the next ordering window, move the cutoff forward, and repeat. Keep an untouched final period for the decision after model choices are complete. The exact windows depend on seasonality, lead time and the quantity of usable history.

Scikit-learn's TimeSeriesSplit documentation describes ordered splits and a configurable gap between training and test samples. It also notes the equal-spacing requirement for comparable fold durations. Those details matter when events arrive irregularly or labels become available late.

Check each feature's timestamp. Actual weather, final promotional spend and corrected order quantities may exist in today's database but may not have existed at forecast time. Store the version that would have been known then.

The same applies to human adjustments. Save the planner's original forecast and the later correction separately. Reconstructing yesterday's prediction from today's spreadsheet can accidentally turn a forecast test into a hindsight test.

Build a dataset that distinguishes sales from demand

Sales can be constrained by availability. If a product sold zero units because it was unavailable, treating that as zero demand teaches the wrong lesson. You may not know the unobserved demand precisely; record the limitation rather than inventing it.

A useful initial data contract covers product and location IDs, timestamps, quantities, returns, availability, promotions and changes in product definitions. Keep units consistent. A case, a pack and an individual item cannot silently share one quantity column.

For new products, document whether a comparable product or category supplies the initial estimate. For discontinued products, ensure the model does not keep generating replenishment recommendations. Decide how substitutions and product renaming affect the series.

Our AI data-quality checks provide a way to inspect missing, duplicate and stale records before testing a model. Cleaning a broken feed may be more valuable than changing the algorithm.

Inspect errors by the decisions they affect

Report aggregate error, but also inspect important segments: high-value items, intermittent demand, promotions, new products and locations with little history. Show the number of observations behind each result.

Track direction as well as magnitude. A forecast that is consistently too low creates a different operating problem from one that alternates above and below demand. Percentage errors can become unstable around zero, so choose metrics that make sense for your series rather than copying the most impressive dashboard label.

Ask the planner to review the largest misses. Was the issue an unavailable input, a one-off event, a product mapping error or a pattern the model failed to learn? That discussion should produce a specific change, not simply another training run.

If intervals are shown, explain what they represent and check their coverage on held-out periods. A narrow band looks reassuring even when it is wrong. Avoid turning an unvalidated score into “high confidence” for a buyer who cannot inspect its meaning.

Run in shadow mode before changing orders

Have the candidate generate recommendations alongside the existing process. Save both forecasts before the outcome occurs. Initially, let the planner continue using the current workflow while the team investigates discrepancies.

Define acceptance conditions before seeing the results. These might cover cost under an agreed inventory simulation, error on critical product groups, processing time and the rate of unusable outputs. There is no universal percentage improvement that makes a model worth deploying.

When moving to live use, retain an override and record why it was used. Repeated overrides are evidence: either the model lacks useful context or the workflow does not explain its output well enough. A system that planners routinely ignore has not solved the operating problem.

Keep a fallback for missing feeds and delayed runs. A forecast delivered after the supplier cutoff may be less useful than a modest forecast delivered on time.

Questions to put in the project brief

Ask which baseline will be used, how historical availability is handled, which inputs are available at prediction time, and how the ordering policy will be evaluated. Request results by horizon and segment, not just a single accuracy percentage.

Also ask who owns the model after launch: data-feed failures, retraining decisions, monitoring and planner support all need an owner. Separate the cost of an experiment from the cost of a dependable service.

Download the forecasting pilot worksheet to record these decisions and reproduce the example. If the baseline or source data is still uncertain, start with a scoped AI proof of concept.

Pixelfield's AI development services can help connect a forecasting experiment to the operational system it must support. The useful deliverable is a defensible decision about what to deploy—or what to keep unchanged—not a model for its own sake.

Michal Vávra
Written by
Head of AI & Development

Michal has been with Pixelfield since September 2012 and has held technical leadership roles since 2017. He is the technical force behind our most demanding builds, combining AI expertise with the infrastructure and software architecture needed to make it work in production. His work spans LLM applications, multi-agent orchestration and complex integrations. He sets the engineering standards behind reliability, performance and scale, and guides the team through the decisions that determine how a system runs long after launch.