Sign in

Blog · Forecast and pipeline

AI predictive analytics for retail: test the results

Evaluate retail demand estimates against actual unit sales and a simple baseline. Work from store and SKU exports, calculate forecast errors, and separate stockouts and returns before judging the result.

The short answerAI predictive analytics for retail should be tested against actual sales that were unavailable when the estimates were made. Match forecast and actual units by store, SKU and period, then compare absolute error and bias with a simple baseline. Review stockouts and returns separately because recorded sales do not always represent unconstrained customer demand.

AI predictive analytics for retail is useful when its estimates beat a simple baseline on sales that had not happened when the estimates were made. Match each estimate to actual units by store, SKU and selling period, then measure absolute error and persistent overstatement or understatement. Check availability and returns before interpreting the score as evidence about demand.

Freeze the question before opening the results

Start with a business decision: whether a proposed demand estimate deserves a place in the weekly merchandise review. This is a specific test within predictive analytics in retail, rather than a review of every possible retail application.

Choose the forecast horizon, issue date, unit and target. A forecast issued before a selling week must not be replaced by a revised version created during that week. The authors of Forecasting: Principles and Practice explain why accuracy should be evaluated on observations excluded from the data used to fit the statistical method.

Keep a frozen comparison file with the original estimates and a baseline available at the same issue date. The baseline could be the preceding comparable week's unit sales; promotions and holidays may require a different comparable period. The broader predictive analytics method explains that distinction between an estimate and evidence that it works.

Prepare store and SKU rows

Bring the forecast export, point-of-sale unit sales, return register and availability report. Match them on store ID, SKU and period. Reconcile store totals to the original sales export before using the combined file. A duplicate SKU-store key can otherwise multiply both sales and errors.

For this fictional US retailer, both methods predict gross units purchased during the same completed week. Returns are recorded separately. Put these headers in A1:G1 and the detail in rows 2 through 5; the total is row 6.

Store SKU Sold units Returned units Forecast units Baseline units In stock throughout?
East A 100 4 110 90 Yes
East B 50 2 40 60 Yes
West A 80 3 100 65 Yes
West B 70 1 70 55 Yes
Total 300 10 320 270

Sold units total 300. Subtracting the 10 returned units gives 290 net units, but that is not the target these forecasts estimated. Comparing gross forecasts with net sales would introduce a definition error before any method was scored.

Calculate errors before aggregating them

Use a signed convention where a positive error means an overestimate:

Signed error = Forecast units − Actual sold units

Weighted absolute percentage error (WAPE) = Sum of absolute row errors / Sum of actual sold units

Bias percentage = Sum of signed row errors / Sum of actual sold units

In Excel, put signed error in H2, absolute forecast error in I2 and absolute baseline error in J2. Fill each formula down through row 5:

H2: =E2-C2
I2: =ABS(H2)
J2: =ABS(F2-C2)

The resulting calculations are:

Store and SKU Signed forecast error Absolute forecast error Absolute baseline error
East A 10 10 10
East B -10 10 10
West A 20 20 15
West B 0 0 15
Total 20 40 50

For the whole file, use:

Forecast WAPE: =SUM(I2:I5)/SUM(C2:C5)
Baseline WAPE: =SUM(J2:J5)/SUM(C2:C5)
Bias: =SUM(H2:H5)/SUM(C2:C5)

Format the results as percentages. Forecast WAPE is 40 / 300 = 13.3%; baseline WAPE is 50 / 300 = 16.7%. Bias is 20 / 300 = 6.7%, meaning the forecast overstates total observed sales. Percentages are rounded to one decimal place from unrounded calculations.

The absolute error falls by (50 − 40) / 50 = 20.0% against the baseline. That improvement describes this evaluation set; it does not establish that future weeks will improve by the same amount.

Prove the score and isolate availability

First, signed errors must reconcile: forecast units minus actual units is 320 − 300 = 20, matching the signed-error total. Absolute error is 40 because East's opposite errors do not cancel. Taking the absolute difference between company totals would hide that distinction.

Now suppose the availability review changes West A's flag in G4 to No. Its sales remain observable, but a stockout means they may understate demand. Report the original comparison and an additional in-stock comparison; retain the excluded row in the review.

In-stock forecast WAPE:
=SUMIFS(I2:I5,G2:G5,"Yes")/SUMIFS(C2:C5,G2:G5,"Yes")

In-stock baseline WAPE:
=SUMIFS(J2:J5,G2:G5,"Yes")/SUMIFS(C2:C5,G2:G5,"Yes")

Microsoft documents SUMIFS as summing values that meet multiple criteria. Covirage is not affiliated with Microsoft.

Removing West A from both scores leaves 220 sold units, forecast absolute error of 20 and baseline absolute error of 35. The in-stock scores are therefore 9.1% and 15.9%. They describe a different subset, not a correction that makes the original comparison disappear.

Where it goes wrong

  • Changing the target. Gross purchased units, net units and unconstrained demand answer different questions. Preserve the original definition when matching actuals.
  • Scoring only the company total. Product and store errors can cancel while leaving the wrong inventory in the wrong places. Calculate row errors first.
  • Treating missing sales as zero. A missing export row needs investigation. A confirmed zero-sale row belongs in absolute error, but individual percentage errors would divide by zero.
  • Hiding excluded stockouts. A cleaner in-stock score covers less of the business. Show the omitted stores, products and periods beside it.
  • Using advertising attribution as demand. Retail media analytics concerns sales credited to advertising interactions. Those figures cannot replace the point-of-sale units used here.

The merchandise planner should own the target and exclusions; store operations should confirm availability exceptions. Use the findings in the next review, then connect ordering constraints through retail supply chain predictive analytics. The wider AI analytics overview places this file-based evaluation alongside other business questions.

Test your own retail files in Covirage

Bring a sample of your own frozen forecast, sales and availability files: Covirage maps the columns, and its tools compute and check the comparisons. The external AI model explains the results with every figure traced to its rows. Create a free Covirage account, then set up your business and bring your files.

See forecast analysis for the supporting approach.

Questions people ask

How do retailers check whether demand predictions are useful?

Freeze estimates before the sales period begins, then compare them with completed-period sales using the same store, SKU and unit definitions. Score a simple baseline on those identical rows. Review error by location and product before deciding whether the more complex method improves the business decision.

Should returns be deducted from actual sales when testing a forecast?

Only when the forecast predicts net units after returns. A forecast of units purchased should be compared with purchased units, while returns remain a separate measure. Document the return cutoff and whether returns are assigned to the original sale or the period when they were received.

How should stockouts affect forecast accuracy reporting?

Keep stockout rows visible, but distinguish observed-sales accuracy from demand accuracy. A store cannot sell inventory it does not have. Report a separate in-stock comparison and the excluded rows, and do not treat the remaining score as proof of accuracy across the full assortment.

Can forecast evaluation automatically determine replenishment quantities?

Forecast evaluation establishes how estimates performed against a defined target. Replenishment also depends on lead times, minimum orders, shelf capacity, service targets and inventory already available. The merchandising and supply teams must translate the evidence into an ordering decision using those constraints.