Professional Documents
Culture Documents
@PeterOwlett
High quality food, delivered fast and
on demand
Life of an order
Life of an order
Utilisation
Where
O is orders
d is date
z is zone
Forecasting Daily Volume
This book is awesome
50%
Improvement!
Signal in the noise?
# 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
Converting Daily Orders to Driver Hours
Where
O is orders
D is demand
E is efficiency
z is zone
d is date
w is weekday
t is time of day
Estimating Demand Curves
Zero to One Scale - neat trick
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!!!
Stuff we learned
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
Thanks!