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
ZOZOにおけるAI活用の現在 ~開発組織全体での取り組みと試行錯誤~
zozotech
PRO
5
5.5k
Tebiki Engineering Team Deck
tebiki
0
24k
会社紹介資料 / Sansan Company Profile
sansan33
PRO
15
400k
モダンUIでフルサーバーレスなAIエージェントをAmplifyとCDKでサクッとデプロイしよう
minorun365
4
200
Red Hat OpenStack Services on OpenShift
tamemiya
0
110
コミュニティが変えるキャリアの地平線:コロナ禍新卒入社のエンジニアがAWSコミュニティで見つけた成長の羅針盤
kentosuzuki
0
110
Azure Durable Functions で作った NL2SQL Agent の精度向上に取り組んだ話/jat08
thara0402
0
190
登壇駆動学習のすすめ — CfPのネタの見つけ方と書くときに意識していること
bicstone
3
110
AWS Network Firewall Proxyを触ってみた
nagisa53
1
230
SREが向き合う大規模リアーキテクチャ 〜信頼性とアジリティの両立〜
zepprix
0
450
AIエージェントを開発しよう!-AgentCore活用の勘所-
yukiogawa
0
170
配列に見る bash と zsh の違い
kazzpapa3
1
150
Featured
See All Featured
KATA
mclloyd
PRO
34
15k
Typedesign – Prime Four
hannesfritz
42
2.9k
How to Talk to Developers About Accessibility
jct
2
130
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
200
How to make the Groovebox
asonas
2
1.9k
Imperfection Machines: The Place of Print at Facebook
scottboms
269
14k
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
280
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.4k
The World Runs on Bad Software
bkeepers
PRO
72
12k
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.1k
Utilizing Notion as your number one productivity tool
mfonobong
3
220
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
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!