Problem
The delivery time shown to customers and the arrival time sent to couriers both depend on the food preparation time (FPT). The same dish takes different time in different kitchens, and rush hours slow the same kitchen, so FPT is right-skewed. MAE and RMSE training gives predictions that are far off or not accurate enough, and an underestimate breaks the promise to the customer. Related targets such as courier wait also need predictions, and a separate 6-million-parameter model per target is too slow to retrain and serve.
Example from the article: a sundae from a parlour 5 km away arrives in 25 minutes, biryani from a restaurant 0.5 km away takes over 45.
Solution in brief
Train the FPT network with an asymmetric quantile-style loss that penalises underestimates more, and tune the penalties on business metrics (accuracy within X minutes, breaches). Predict all related targets from one network with an output head per target, encode the order with a BiLSTM, and shrink the model by training the large embeddings separately and splitting models by city.
Questions this case answers
- How to predict a right-skewed duration so that underestimates cost more than overestimates
- How to predict several related targets with overlapping inputs without maintaining one heavy model per target
- How to predict restaurant food preparation time when the same dish takes very different time in different kitchens and at different hours?
- How to train a prediction model that underestimates less often than it overestimates?
Tools and methods
- Quantile loss with penalty factors — punishes underestimation harder
- Multi-output neural network — one model, one fully connected head per target
- BiLSTM over Word2Vec item vectors — order embedding
- Separate embeddings and per-city models — smaller, faster, more local model
- X-min accuracy and breach — business metrics for model selection
- TensorFlow — framework of the model
Google or a one-time email code. No password.