Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Send More Riders
Search
peteowlett
February 02, 2016
Technology
4
920
Send More Riders
Predictive scheduling for an on demand delivery fleet
peteowlett
February 02, 2016
Tweet
Share
More Decks by peteowlett
See All by peteowlett
Lessons from 6 Months of using Luigi
peteowlett
4
890
Takeaway Tales
peteowlett
1
190
Other Decks in Technology
See All in Technology
Oracle Cloud Infrastructure:2025年3月度サービス・アップデート
oracle4engineer
PRO
0
310
目次機能実装から理解するLexical Editor
wtdlee
0
130
「エンジニアマネージャー」の役割を担っている / 担ってみたい方へのキャリアパスガイド
coconala_engineer
1
220
大規模プロジェクトにおける 品質管理の要点と実践 / 20250327 Suguru Ishii
shift_evolve
0
200
モジュラーモノリスでスケーラブルなシステムを作る - BASE のリアーキテクチャのいま
panda_program
7
1.8k
チームの性質によって変わる ADR との向き合い方と、生成 AI 時代のこれから / How to deal with ADR depends on the characteristics of the team
mh4gf
4
290
初めてのPostgreSQLメジャーバージョンアップ
kkato1
0
250
caching_sha2_passwordのはなし
boro1234
0
160
技術的負債を正しく理解し、正しく付き合う #phperkaigi / PHPerKaigi 2025
shogogg
7
1.6k
AIが変えるソフトウェア開発__未来のアジャイルチームとは__.pdf
buchirei
0
360
DIってなんだか難しい? 依存という概念を「使う・使われる」 という言葉で整理しよう
akinoriakatsuka
1
740
モンテカルロ木探索のパフォーマンスを予測する Kaggleコンペ解説 〜生成AIによる未知のゲーム生成〜
rist
4
930
Featured
See All Featured
Designing for Performance
lara
605
69k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
45
9.5k
Fontdeck: Realign not Redesign
paulrobertlloyd
83
5.4k
Documentation Writing (for coders)
carmenintech
69
4.7k
How GitHub (no longer) Works
holman
314
140k
Measuring & Analyzing Core Web Vitals
bluesmoon
6
320
How to Ace a Technical Interview
jacobian
276
23k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
32
2.2k
Automating Front-end Workflow
addyosmani
1369
200k
Large-scale JavaScript Application Architecture
addyosmani
511
110k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
9.4k
Faster Mobile Websites
deanohume
306
31k
Transcript
Send More Riders! Predictive scheduling for an on demand delivery
fleet @PeterOwlett
High quality food, delivered fast and on demand
None
Life of an order
Life of an order
Utilisation % Hour of Day (Colour = Day of Week)
We need enough drivers to deliver on time, but not
so many we lose money
•Restaurants take longer than expected to make food •Items get
missed - we have to go back and get them •Drivers become unavailable (flat tyre etc) •Customers hard to find It gets harder …
Exam question How many drivers should we schedule for the
next two weeks in each part of London over 15 minute blocks?
Before we dive in - a quick apology
Lets formulate! Where • O is orders • d is
date • z is zone
Forecasting Daily Volume
This book is awesome And Free!!! - https://www.otexts.org/fpp
Forecasting Daily Volume
None
Statsmodels supports this out of the box Forecasting Daily Volume
# Decompose the raw time series decomposition = sm.tsa.seasonal_decompose(data.values, freq=7) # Extract individual components all_trend = decomposition.trend all_seasonal = decomposition.seasonal all_resid = decomposition.resid
First Results
Holidays (and Weather) Forecasting Daily Volume
Improving the seasonal 50% Improvement!
•Vary the training range •Train on np.log(series) and transform back
Signal in the noise? Looks Seasonal Looks Seasonal Random Noise
Because we can chart each series, we can reason about
how to improve our model
Forecast each component Forecasting Daily Volume # Forecast Trend lm_lin
= LinearRegression().fit(dates, trend_vals) forecast_trend = lm_lin.predict(forecast_window) # Forecast Seasonal seasonal_pattern = np.tile(base_seasonal_pattern, math.ceil(days_to_forecast / 7.0)) forecast_seasonal = seasonal_pattern[0: days_to_forecast]
Forecasting Daily Volume
Where • O is orders • D is demand •
E is efficiency • z is zone • d is date • w is weekday • t is time of day Converting Daily Orders to Driver Hours
Zero to One Scale - neat trick Estimating Demand Curves
scaled_series = df_mean_curves.order_volume / df_mean_curves.groupby(['zone', ‘day_of_week’])\ .transform(np.sum).order_volume
Estimating Demand Curves Ratio of daily orders per unit time
Hour of Day
Efficiency Orders per driver per hour Hour of Day
Final Forecast
Getting the forecast out into the real world
Volumes to Shifts
Deployment
SUCCESS!!!
1. While not as powerful as R, Statsmodels does give
you core time series tools 2. Seasonal decomposition is very meaningful to human beings 3. By using all python, we were able to ship quickly Stuff we learned
Thanks!