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
900
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
810
Takeaway Tales
peteowlett
1
170
Other Decks in Technology
See All in Technology
Oracle Cloud Infrastructureデータベース・クラウド:各バージョンのサポート期間
oracle4engineer
PRO
12
7.9k
CockroachDB はどのくらい「しぶとい」のか? / How tough is CockroachDB?
kota2and3kan
13
4.9k
データ基盤を支える技術
chanyou0311
5
2.9k
ハードウェアを動かすTypeScriptの世界
9wick
3
1.2k
動画配信サービスのフロントエンド実装に学ぶ設計原則
yud0uhu
0
130
PHP 9 に備えよ - 動的プロパティ、どうすればいぃ?
taisukearase
0
180
TDD - Test Driven Drupal
opdavies
0
3k
株式会社EventHub・エンジニア採用資料
eventhub
0
2.1k
The depthes of profiling Ruby - RubyKaigi 2024
osyoyu
0
130
QA経験のないエンジニアリング マネージャーがQAのカジュアル面談に出て 苦労していること・気づいたこと / scrum fest niigata 2024
yoshikiiida
2
650
SWC Transformerから見るTypeScript関数記述ベストプラクティス
fujiyamaorange
1
170
大規模言語モデル (LLM)における低精度数値表現
pfn
PRO
3
800
Featured
See All Featured
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
245
20k
Building Better People: How to give real-time feedback that sticks.
wjessup
356
18k
Agile that works and the tools we love
rasmusluckow
325
20k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
67
14k
Design by the Numbers
sachag
274
18k
How to train your dragon (web standard)
notwaldorf
75
5.2k
A Modern Web Designer's Workflow
chriscoyier
689
190k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
123
39k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
188
16k
Raft: Consensus for Rubyists
vanstee
133
6.3k
Designing the Hi-DPI Web
ddemaree
276
33k
Practical Orchestrator
shlominoach
183
9.8k
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!