Problem
Zomato needs an accurate estimate of how long a delivery partner (DP) takes to reach the restaurant and the customer. Road maps are sparse in smaller towns and the road network is dense in others, so generic map ETAs fit badly. Trip times are non-negative and right-skewed, with a long tail of slow trips. Predictions must come back in milliseconds, for millions of requests a day, on a small budget.
Example from the article: in a plot of trips by duration, most trips take about 10 minutes, and a thin tail runs to 40 minutes.
Solution in brief
Train one LightGBM model per city on a minimal feature set. A Tweedie objective with a log link and L1 as the metric fits the long tail with a smaller model. Split the forecast into two legs, tune each model automatically, and serve the native LightGBM booster behind FastAPI instead of MLflow serving.
Questions this case answers
- How to predict a skewed, non-negative duration for many local markets with a small model that must answer within a few milliseconds on CPU
- How to predict delivery-partner trip time accurately when road maps are sparse and trip times have a long right tail?
- How to serve a gradient-boosting model for millions of real-time predictions on CPU at low cost?
- How to find which operational factors make delivery partners late, using model explanations?
Tools and methods
- LightGBM — gradient-boosting trees for the ETA regression
- Optuna (LightGBMTuner) — automatic tuning of the many per-city models
- FastAPI — model serving that replaced MLflow serving
- MLflow — training pipeline and the former serving layer
- SHAP — explains predictions, prunes features, locates sources of delay
- ONNX, PyTorch, Apache TVM via Hummingbird — tested serving formats for tree models
- Amazon S3 — artifact store the prediction cluster loads models from
Google or a one-time email code. No password.