Technical report
How the delivery time model works
The model predicts how many minutes a food order takes from the moment it's placed to the moment it arrives. It only uses what's known when the customer orders: the road distance, the time and day, the order type, the city type and whether it's a festival.
- Orders in the dataset
- 45,584
- 2022-02-11 to 2022-04-07
- Orders used for the model
- 36,416
- With a road distance and an order time
- Model inputs
- 6
- All known at order time
- XGBoost test error
- 6.04 min
- 1.26 min better than the baseline
The approach
- 1. Raw CSV45,584 Zomato orders, 20 columns
- 2. CleanFix labels, parse times, clear impossible values
- 3. Add road distanceOSRM route for each restaurant and customer
- 4. Split by timeOlder orders train, newer orders test
- 5. Train and tuneMedian baseline, Decision Tree, XGBoost
- 6. ServeFastAPI loads all three for the demo
Three models are trained on the same orders and compared on the same newer orders. The median baseline predicts the same time for every order, so any useful model has to beat it. XGBoost had the lowest validation error, so the app uses it by default. The demo shows all three side by side.
Sections
- 1DatasetEvery order in a searchable table, cleaned or raw.
- 2Exploratory analysisWhat drives delivery time, and what the model can know.
- 3Outliers and cleaningEach cleaning rule, how many rows it touched and why.
- 4Data splitTrain on older orders, test on newer ones.
- 5Features and trainingSix inputs, one pipeline, and the tuning grid.
- 6EvaluationHow the three models compare, and their limits.
- 7SlidesThe presentation, ready to present full screen.