The table
Use one row per item, store and day. Keep every day, including days with no sales, which are zeros, not missing rows.sales.csv
Forecast the next 28 days
From a forecast to an order
A single number is not enough to set a stock level. The right level depends on the cost of running out against the cost of holding stock. With a full predicted distribution, you pick the quantile that matches that trade-off.- For a fast-moving staple with a high cost of a lost sale, order up to a high quantile of the demand over the lead time, such as the 95% quantile.
- For a perishable item, where unsold stock is thrown away, order closer to the median.
Slow-moving items
Many items sell on only a few days. Their median forecast is often zero, which does not mean that no stock is needed. Read the upper quantiles: the 90% quantile of a spare part tells you how many units cover nine weeks in ten.Check before you use it
mase with 1, the score of a seasonal naive forecast that repeats last week. Look at inside_80pct_interval too. If it is far below 0.8, the stock levels set from the quantiles will run out more often than planned.
Things that often go wrong
- Missing days. A day with no sales must be a row with zero units. If such days are left out, the model sees a series with gaps, not a series of zeros.
- Stock-outs read as low demand. A day without stock shows zero sales. Mark it, or the forecast learns that demand was zero.
- Promotions known late. A promotion added to
future_rowsonly after the forecast was made cannot help that forecast. When you evaluate, use the promotion plan as it was known at the time.