
An inventory AI model learns from recorded transactions. When a product sells out early, invoices show only the units customers could buy. To make that distinction concrete, Yenra tested a forecasting method on later weekly invoice quantities. The test measures recorded units, with no claim that every unfilled request is visible.
Choose the products before the test begins

Daqing Chen’s Online Retail archive records transactions for a UK-based online retailer. We used 52 complete Monday-to-Sunday weeks starting December 6, 2010. We kept UK rows with positive quantity and price, excluded cancellation invoices, and restricted stock codes to five digits optionally followed by letters. From the first 40 weeks we selected the eight codes with the largest summed units. A week with no qualifying invoice counts as zero observed units. Daqing Chen’s Online Retail dataset at UCI
Compare the next week with two simple forecasts

We fitted a separate ridge regression for each product on weeks 9–40 using the prior week, four-week mean and eight-week mean as inputs. Inputs were standardized using the training rows. The penalty was ten with an unpenalized intercept. Coefficients stayed fixed over weeks 41–52, but each forecast could use the preceding observed weeks. Negative predictions were floored at zero. Across the 96 later product-weeks, mean absolute errors were 468.6 units for last week, 392.0 for the four-week mean and 461.1 for the fitted method. The four-week mean won this comparison.

Download all 96 product-week forecasts (CSV). The columns give week beginning, stock code, observed positive invoiced units, last week’s units, the prior four-week mean and the fitted prediction. Adapted and aggregated by Yenra from Daqing Chen’s Online Retail dataset at UCI, licensed under CC BY 4.0. Creative Commons license.
Translate units into an order only after checking supply

A buyer still needs the usable inventory position, committed orders, case pack and delivery window. Demand during a two-week lead time may be quite different from next week’s invoices. The M5 competition illustrates the importance of evaluating retail forecasts at the product and aggregation levels actually used. These eight active codes represent a selected part of one retailer. The M5 retail forecast competition results Why Can an Item Be in Stock and Still Unavailable to a Shopper?
Try it with the evidence
Turn a demand assumption into a case order
Source notes. Fictional one-week lead time. Expected use is 42 units, target buffer 8, on hand 31 and confirmed inbound before need 7. No backorders. The supplier ships cases of six. Round up to meet the target.
Prompt. Calculate the net requirement and number of cases. Which input changes first if the inbound shipment slips?
Check your reading
The target is 50 and available stock is 38, leaving a 12-unit requirement or two cases. If the seven inbound units miss the window, available stock is 31. The gap becomes 19, requiring four cases if all other assumptions stand.
Illustrated field notes
Stock measurement and physical flow
Track the movement that changes the count and distinguish a recorded zero from an unknown quantity.






