Skip to content
ML Academy

Time series and forecasting · insight-0214

Separate stockout zeros from true zero demand before modelling a retail series

Evidence type
practitioner heuristic
Difficulty
medium
Roles
Data scientist, Data analyst
Industries
retail, e-commerce

Summary: situation, action, reason, boundary

  1. Situation

    A store-SKU series looks intermittent, and stock records show the item was frequently unavailable.

  2. Action

    Join availability data, mark out-of-stock periods as censored or missing rather than zero, and model demand only from periods when the item could be bought.

  3. Reason

    Sales equal demand only when supply did not bind, so stockout periods tell you little about demand.

  4. Boundary

    Retail, e-commerce, pharmacy, vending, any channel with stock limits.

Symptom or risk

Zero sales during stockouts are recorded as zero demand, so the model learns intermittency the customer never expressed and keeps stock low, which causes more stockouts.

Exceptions

If availability data are absent, use heuristics such as long zero runs on normally steady items, and label them as inferred.

Trade-offs

Treating stockouts as missing reduces training data; imputing demand adds assumptions.

Pitfalls

Using substitution sales on sister items as evidence of demand without checking the substitution pattern.

Lessons and concepts