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
950
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
940
Takeaway Tales
peteowlett
1
200
Other Decks in Technology
See All in Technology
変化するコーディングエージェントとの現実的な付き合い方 〜Cursor安定択説と、ツールに依存しない「資産」〜
empitsu
3
600
セキュリティ はじめの一歩
nikinusu
0
1.2k
いよいよ仕事を奪われそうな波が来たぜ
kazzpapa3
3
300
フロントエンド開発者のための「厄払い」
optim
0
180
Werner Vogelsが14年間 問い続けてきたこと
yusukeshimizu
2
260
みんなだいすきALB、NLBの 仕組みから最新機能まで総おさらい / Mastering ALB & NLB: Internal Mechanics and Latest Innovations
kaminashi
0
140
Lambda Durable FunctionsでStep Functionsの代わりはできるのかを試してみた
smt7174
2
160
プロダクトエンジニアこそ必要なPMスキル 〜デリバリー力を最大化し、価値を届け続けるために〜
layerx
PRO
0
150
オープンウェイトのLLMリランカーを契約書で評価する / searchtechjp
sansan_randd
3
410
JuliaTokaiとしてはこれが最後かもしれない(仮) for NGK2026S
antimon2
0
130
re:Inventで見つけた「運用を捨てる」技術。
ezaki
1
160
Oracle Cloud Infrastructure:2026年1月度サービス・アップデート
oracle4engineer
PRO
0
190
Featured
See All Featured
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
190
Thoughts on Productivity
jonyablonski
74
5k
SEO for Brand Visibility & Recognition
aleyda
0
4.2k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
54k
How to train your dragon (web standard)
notwaldorf
97
6.5k
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
51
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
160
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
22k
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
50
Done Done
chrislema
186
16k
Art, The Web, and Tiny UX
lynnandtonic
304
21k
[RailsConf 2023] Rails as a piece of cake
palkan
59
6.3k
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!