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
960
4
Share
Send More Riders
Predictive scheduling for an on demand delivery fleet
peteowlett
February 02, 2016
More Decks by peteowlett
See All by peteowlett
Lessons from 6 Months of using Luigi
peteowlett
4
960
Takeaway Tales
peteowlett
1
210
Other Decks in Technology
See All in Technology
freeeで運用しているAIQAについて
qatonchan
0
350
Agent の「自由」と「安全」〜未来に向けて今できること〜
katayan
0
340
オライリーイベント登壇資料「鉄リサイクル・産廃業界におけるAI技術実応用のカタチ」
takarasawa_
0
330
知ってた?JavaScriptの"正しさ"を検証するテストが5万以上もあること(Test262)
riyaamemiya
1
160
小さいVue.jsを30分で作る
hal_spidernight
0
140
ボトムアップの改善の火を灯し続けろ!〜支援現場で学んだ、消えないための3つの打ち手〜 / 20260509 Kazuki Mori
shift_evolve
PRO
2
590
カオナビに Suspenseを導入するまで / The Road to Suspense at kaonavi
kaonavi
1
430
Fabric MCPの紹介と使い分け
ryomaru0825
1
150
生成AIはソフトウェア開発の革命か、ソフトウェア工学の宿題再提出なのか -ソフトウェア品質特性の追加提案-
kyonmm
PRO
2
860
GKE Agent SandboxでAIが生成したコードを 安全に実行してみた
lamaglama39
0
210
QAエンジニアはどうやって プロダクト議論の場に入れるのか?
moritamasami
2
410
大学職員のための生成AI最前線 :最前線を、AIガバナンスとして読み直すためのTips
gmoriki
2
3.8k
Featured
See All Featured
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.8k
Testing 201, or: Great Expectations
jmmastey
46
8.1k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1.1k
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
0
340
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
290
RailsConf 2023
tenderlove
30
1.4k
Docker and Python
trallard
47
3.8k
Designing for humans not robots
tammielis
254
26k
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
100
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
510
Highjacked: Video Game Concept Design
rkendrick25
PRO
1
350
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!