Problem
Picnic is an app-only online supermarket with a just-in-time supply chain, so supplier orders and delivery plans depend on the demand forecast. Overestimating demand wastes perishable food, and underestimating it leaves customers without products. The history is also not pure demand: when capacity was short, customers moved orders to another day, which distorts the signal. Forecasts are needed two, three or seven days ahead. A gradient-boosting model failed during COVID-19, when sudden toilet-paper buying produced values it had not seen in training.
Example from the article: Picnic runs one model at article level (how many bananas customers need in the coming weeks) and one at delivery level (how many orders to expect).
Solution in brief
Replace gradient boosting with the Temporal Fusion Transformer (TFT), which handles static, known-future and past-only inputs, selects variables, combines short-term and long-term temporal layers and outputs quantiles. Picnic reports a 20% gain in forecast precision, mostly on slow-moving articles, and uses the quantiles to balance waste against unavailability.
Questions this case answers
- How to forecast a perishable quantity several steps ahead with uncertainty when behaviour shifts abruptly and tree models cannot extrapolate
- How to build one multi-horizon forecasting model from static, known-future and past-only inputs while keeping it explainable
- How to forecast perishable-product demand several days ahead with uncertainty estimates?
- How to forecast demand when a gradient-boosting model cannot extrapolate to unseen values such as a sudden shopping shock?
Tools and methods
- Temporal Fusion Transformer — multi-horizon forecasting with static, known-future and past inputs
- Quantile regression — prediction intervals instead of a point forecast
- Darts — forecasting library Picnic is considering instead of Pytorch Forecasting
- Pytorch Forecasting — library with the TFT implementation Picnic started with
- Gradient boosting — the previous model and the recommended baseline
Google or a one-time email code. No password.