Forecasting Grubhub Order Volume At Scale

Hugues Demers, William Cox, Gayan Seneviratna19 May 2022

Problem

Grubhub schedules couriers in blocks of time that couriers sign up for themselves, weeks ahead. The blocks must cover forecasted demand. Too few couriers leave diners waiting. Too many leave couriers idle, and Grubhub pays them at a lower rate than for active deliveries. So the team forecasts orders for every half-hour of every region, daily, which means millions of forecasted timeslots.

Example from the article: the quality checks target a model that fails to converge or upstream data issues that cause wild variations in a forecast. Holidays such as Black Friday or New Years Day usually bring wild fluctuations in order volume, and the checks run on them too.

Solution in brief

Keep research and production in one Python codebase owned by one team. Recompute the full feature history daily, cache it, and fan out one forecasting job per region and model with Dask. Check each forecast against several safeguards, and keep a simple backup model for every region.

Questions this case answers
  • How to produce daily multi-week demand forecasts for hundreds of independent regions with several models each, without rewriting research code for production
  • How to guard an automated forecasting pipeline against non-converged models and bad upstream data when no human reviews each forecast
  • How to run daily half-hourly order-volume forecasts for hundreds of regions in production?
  • How to keep research models and production forecasting code the same codebase?

Tools and methods

  • Dask — distributed forecasting across region × model jobs, also runnable locally
  • SQLite — local cache of the full order-volume feature history on worker nodes
  • Forecast sanity checks — negative or all-zero values, day-to-day change, comparison with historic projection
  • Backup model — simple average of the past N days per region, also the baseline
Continue reading — it's free

Google or a one-time email code. No password.