Top Banner
June 2019 Time Predictions in Uber Eats Zi Wang@Uber QCon New York 2019
53

Time Predictions in Uber Eats - QCon New York · Time Predictions in Uber Eats Zi Wang@Uber QCon New York 2019. 1. ML in Uber Eats •Goals & Challenges •ML Platform @ Uber 2. How

May 20, 2020

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Time Predictions in Uber Eats - QCon New York · Time Predictions in Uber Eats Zi Wang@Uber QCon New York 2019. 1. ML in Uber Eats •Goals & Challenges •ML Platform @ Uber 2. How

June 2019

Time Predictions in Uber Eats

Zi Wang@Uber

QCon New York 2019

Page 2: Time Predictions in Uber Eats - QCon New York · Time Predictions in Uber Eats Zi Wang@Uber QCon New York 2019. 1. ML in Uber Eats •Goals & Challenges •ML Platform @ Uber 2. How

1. ML in Uber Eats

• Goals & Challenges• ML Platform @ Uber

2. How Time Predictions Power Dispatch System

3. Deep Dive in Time Predictions

• Food Preparation Time Prediction• Delivery Time Estimation• Travel Time Estimation

4. Q&A

Agenda

Page 3: Time Predictions in Uber Eats - QCon New York · Time Predictions in Uber Eats Zi Wang@Uber QCon New York 2019. 1. ML in Uber Eats •Goals & Challenges •ML Platform @ Uber 2. How

ML in Uber Eats

Page 4: Time Predictions in Uber Eats - QCon New York · Time Predictions in Uber Eats Zi Wang@Uber QCon New York 2019. 1. ML in Uber Eats •Goals & Challenges •ML Platform @ Uber 2. How

● Goals & Challenges

● ML Platform @ Uber

Agenda

Page 5: Time Predictions in Uber Eats - QCon New York · Time Predictions in Uber Eats Zi Wang@Uber QCon New York 2019. 1. ML in Uber Eats •Goals & Challenges •ML Platform @ Uber 2. How

~ 8B Gross Bookings

for 2018> 500 Cities

Our Scale

> 220,000 Restaurant Partners

Page 6: Time Predictions in Uber Eats - QCon New York · Time Predictions in Uber Eats Zi Wang@Uber QCon New York 2019. 1. ML in Uber Eats •Goals & Challenges •ML Platform @ Uber 2. How

Make eating well effortless, every day, for everyone.

Our Mission

Page 7: Time Predictions in Uber Eats - QCon New York · Time Predictions in Uber Eats Zi Wang@Uber QCon New York 2019. 1. ML in Uber Eats •Goals & Challenges •ML Platform @ Uber 2. How

Goals & Challenges

Predicting the Future Network Efficiency Food Discovery

Reliable Affordable Effortless

Page 8: Time Predictions in Uber Eats - QCon New York · Time Predictions in Uber Eats Zi Wang@Uber QCon New York 2019. 1. ML in Uber Eats •Goals & Challenges •ML Platform @ Uber 2. How

Eyeball ETD prediction

ETD prediction ETA predictionPrep-time prediction

eater browsing order dispatch delivery-partner food delivery-partner delivery-partner foodcreated arrival ready begins trip arrival dropped-off

Page 9: Time Predictions in Uber Eats - QCon New York · Time Predictions in Uber Eats Zi Wang@Uber QCon New York 2019. 1. ML in Uber Eats •Goals & Challenges •ML Platform @ Uber 2. How

ML Platform @ Uber

Page 10: Time Predictions in Uber Eats - QCon New York · Time Predictions in Uber Eats Zi Wang@Uber QCon New York 2019. 1. ML in Uber Eats •Goals & Challenges •ML Platform @ Uber 2. How
Page 11: Time Predictions in Uber Eats - QCon New York · Time Predictions in Uber Eats Zi Wang@Uber QCon New York 2019. 1. ML in Uber Eats •Goals & Challenges •ML Platform @ Uber 2. How

Feature Report

Page 12: Time Predictions in Uber Eats - QCon New York · Time Predictions in Uber Eats Zi Wang@Uber QCon New York 2019. 1. ML in Uber Eats •Goals & Challenges •ML Platform @ Uber 2. How

Model Accuracy Report

Page 13: Time Predictions in Uber Eats - QCon New York · Time Predictions in Uber Eats Zi Wang@Uber QCon New York 2019. 1. ML in Uber Eats •Goals & Challenges •ML Platform @ Uber 2. How

How Time Predictions Power Dispatch System

Page 14: Time Predictions in Uber Eats - QCon New York · Time Predictions in Uber Eats Zi Wang@Uber QCon New York 2019. 1. ML in Uber Eats •Goals & Challenges •ML Platform @ Uber 2. How

● Overview of Dispatch System

● Evolution via Time Predictions

○ Dispatch System w/o Time Predictions

○ Dispatch System w/ Time Predictions

Agenda

Page 15: Time Predictions in Uber Eats - QCon New York · Time Predictions in Uber Eats Zi Wang@Uber QCon New York 2019. 1. ML in Uber Eats •Goals & Challenges •ML Platform @ Uber 2. How

Make Demand-Supply Matching Decisions

Challenges

● Solve an NP-Hard problem with a large problem space within seconds● Improve efficiency without compromising delivery quality● Eater & Restaurant & Delivery Partner

Page 16: Time Predictions in Uber Eats - QCon New York · Time Predictions in Uber Eats Zi Wang@Uber QCon New York 2019. 1. ML in Uber Eats •Goals & Challenges •ML Platform @ Uber 2. How

● Fast drop-off

● Low delivery fee

● 24/7

Eater Restaurant Partner

● Short wait time

● Low Unfulfillment

Delivery Partner

● Short wait time

● Smart route planning● Quick hand-off

Eater & Restaurant & Delivery Partner

Page 17: Time Predictions in Uber Eats - QCon New York · Time Predictions in Uber Eats Zi Wang@Uber QCon New York 2019. 1. ML in Uber Eats •Goals & Challenges •ML Platform @ Uber 2. How

Matching Algorithm: An Augmented Vehicle Routing Problem (VRP)

Page 18: Time Predictions in Uber Eats - QCon New York · Time Predictions in Uber Eats Zi Wang@Uber QCon New York 2019. 1. ML in Uber Eats •Goals & Challenges •ML Platform @ Uber 2. How

Dispatch System w/o Time Predictions

Page 19: Time Predictions in Uber Eats - QCon New York · Time Predictions in Uber Eats Zi Wang@Uber QCon New York 2019. 1. ML in Uber Eats •Goals & Challenges •ML Platform @ Uber 2. How

Scheduled pick-up

time

OrderCreated

9:008:30

do not dispatch a delivery-partner

dispatch a delivery-partner

Fixed 7 mins

When to Dispatch?

8:53

1st dispatch attempt

...

Page 20: Time Predictions in Uber Eats - QCon New York · Time Predictions in Uber Eats Zi Wang@Uber QCon New York 2019. 1. ML in Uber Eats •Goals & Challenges •ML Platform @ Uber 2. How

How to Dispatch? (Greedy)

● Jobs dispatched independently without considering other jobs.

Page 21: Time Predictions in Uber Eats - QCon New York · Time Predictions in Uber Eats Zi Wang@Uber QCon New York 2019. 1. ML in Uber Eats •Goals & Challenges •ML Platform @ Uber 2. How

Before...

restaurant-partnerdelivery-partner

eater

marketplace

● Where is my food?

● Food is cold● How much longer do I have to wait?

Page 22: Time Predictions in Uber Eats - QCon New York · Time Predictions in Uber Eats Zi Wang@Uber QCon New York 2019. 1. ML in Uber Eats •Goals & Challenges •ML Platform @ Uber 2. How

Dispatch System w/ Time Predictions

Page 23: Time Predictions in Uber Eats - QCon New York · Time Predictions in Uber Eats Zi Wang@Uber QCon New York 2019. 1. ML in Uber Eats •Goals & Challenges •ML Platform @ Uber 2. How

Predicted pick-up

time

Ordercreated

9:008:568:30

do not dispatch a driver dispatch a driver

ETA

8:50

1st dispatch attempt

...

When to Dispatch?

...

nth dispatch attempt

Page 24: Time Predictions in Uber Eats - QCon New York · Time Predictions in Uber Eats Zi Wang@Uber QCon New York 2019. 1. ML in Uber Eats •Goals & Challenges •ML Platform @ Uber 2. How

How to Dispatch? (Global)

● All jobs and supplies are considered at the same time.

Page 25: Time Predictions in Uber Eats - QCon New York · Time Predictions in Uber Eats Zi Wang@Uber QCon New York 2019. 1. ML in Uber Eats •Goals & Challenges •ML Platform @ Uber 2. How

● Then we solve the entire set of jobs and supplies as a single global optimization problem.

Page 26: Time Predictions in Uber Eats - QCon New York · Time Predictions in Uber Eats Zi Wang@Uber QCon New York 2019. 1. ML in Uber Eats •Goals & Challenges •ML Platform @ Uber 2. How

Greedy Global

#2

#1

Page 27: Time Predictions in Uber Eats - QCon New York · Time Predictions in Uber Eats Zi Wang@Uber QCon New York 2019. 1. ML in Uber Eats •Goals & Challenges •ML Platform @ Uber 2. How
Page 28: Time Predictions in Uber Eats - QCon New York · Time Predictions in Uber Eats Zi Wang@Uber QCon New York 2019. 1. ML in Uber Eats •Goals & Challenges •ML Platform @ Uber 2. How

After...

restaurantdelivery partner

eater

marketplace

● Fast delivery times● Accurate ETD estimations ● Track food location

● Prevent delivery partners from waiting around ● Prevent food waiting for delivery partners● Track delivery partner’s location

● Dispatch delivery partners at the right time ● Maintain supply/demand, prevent surge

● Reduce waiting at restaurants● Maximize earning potential ● Be aware of estimated travel time

Page 29: Time Predictions in Uber Eats - QCon New York · Time Predictions in Uber Eats Zi Wang@Uber QCon New York 2019. 1. ML in Uber Eats •Goals & Challenges •ML Platform @ Uber 2. How

Deep Dive in Time Predictions

Page 30: Time Predictions in Uber Eats - QCon New York · Time Predictions in Uber Eats Zi Wang@Uber QCon New York 2019. 1. ML in Uber Eats •Goals & Challenges •ML Platform @ Uber 2. How

• Food Preparation Time Prediction• Delivery Time Estimation• Travel Time Estimation

Agenda

Page 31: Time Predictions in Uber Eats - QCon New York · Time Predictions in Uber Eats Zi Wang@Uber QCon New York 2019. 1. ML in Uber Eats •Goals & Challenges •ML Platform @ Uber 2. How

Food Preparation Time Prediction

Page 32: Time Predictions in Uber Eats - QCon New York · Time Predictions in Uber Eats Zi Wang@Uber QCon New York 2019. 1. ML in Uber Eats •Goals & Challenges •ML Platform @ Uber 2. How

Why is Predicting Food Prep-time Difficult?

● 1) True restaurant prep-time is unknown!○ Example: We need to infer true prep-time in a retrospective manner based on restaurants and

delivery partners’ signals.

● 2) Prediction with limited signals○ Example: The busyness in the actual restaurant is unknown

Page 33: Time Predictions in Uber Eats - QCon New York · Time Predictions in Uber Eats Zi Wang@Uber QCon New York 2019. 1. ML in Uber Eats •Goals & Challenges •ML Platform @ Uber 2. How

How Did We Use ML to Solve the Problem?

● Feature engineering

● ML Model

● Feedback Loop

Page 34: Time Predictions in Uber Eats - QCon New York · Time Predictions in Uber Eats Zi Wang@Uber QCon New York 2019. 1. ML in Uber Eats •Goals & Challenges •ML Platform @ Uber 2. How

Feature Engineering

● Historical features ○ Avg prep-time for 1 week, ...

● Real-time (Contextual) features○ Time of day, day of week, order size, location, ...

● Near real-time features ○ Avg prep-time for last 10 mins, ...

Page 35: Time Predictions in Uber Eats - QCon New York · Time Predictions in Uber Eats Zi Wang@Uber QCon New York 2019. 1. ML in Uber Eats •Goals & Challenges •ML Platform @ Uber 2. How

Representation Learning

Page 36: Time Predictions in Uber Eats - QCon New York · Time Predictions in Uber Eats Zi Wang@Uber QCon New York 2019. 1. ML in Uber Eats •Goals & Challenges •ML Platform @ Uber 2. How

Sensor Signals

Page 37: Time Predictions in Uber Eats - QCon New York · Time Predictions in Uber Eats Zi Wang@Uber QCon New York 2019. 1. ML in Uber Eats •Goals & Challenges •ML Platform @ Uber 2. How

Conditional Random Field Model

37

Page 38: Time Predictions in Uber Eats - QCon New York · Time Predictions in Uber Eats Zi Wang@Uber QCon New York 2019. 1. ML in Uber Eats •Goals & Challenges •ML Platform @ Uber 2. How

Data preparation pipelines push data into the Feature Store tables and training data repositories.

Time of day, day of week, order size, location, ...

Sensing & Perception

Bluetooth Data

Feature Engineering (Cont’d) - Data Pipeline

Preparation time

Page 39: Time Predictions in Uber Eats - QCon New York · Time Predictions in Uber Eats Zi Wang@Uber QCon New York 2019. 1. ML in Uber Eats •Goals & Challenges •ML Platform @ Uber 2. How

ML Model

● Model: Gradient boosting decision trees (XGBoost)

● Historical features● Realtime (Contextual)s features ● Near real-time features

Page 40: Time Predictions in Uber Eats - QCon New York · Time Predictions in Uber Eats Zi Wang@Uber QCon New York 2019. 1. ML in Uber Eats •Goals & Challenges •ML Platform @ Uber 2. How

Hyperparameter tuning

Image source: www.nature.com/articles/nature14541

Page 41: Time Predictions in Uber Eats - QCon New York · Time Predictions in Uber Eats Zi Wang@Uber QCon New York 2019. 1. ML in Uber Eats •Goals & Challenges •ML Platform @ Uber 2. How

Model Training

Model training jobs use Feature Store and training data repository data sets to train models and then push them to the model repository.

Page 42: Time Predictions in Uber Eats - QCon New York · Time Predictions in Uber Eats Zi Wang@Uber QCon New York 2019. 1. ML in Uber Eats •Goals & Challenges •ML Platform @ Uber 2. How

Model Training (Cont’d) - Model Deployment

Page 43: Time Predictions in Uber Eats - QCon New York · Time Predictions in Uber Eats Zi Wang@Uber QCon New York 2019. 1. ML in Uber Eats •Goals & Challenges •ML Platform @ Uber 2. How

Model Training (Cont’d) - Make Predictions

Page 44: Time Predictions in Uber Eats - QCon New York · Time Predictions in Uber Eats Zi Wang@Uber QCon New York 2019. 1. ML in Uber Eats •Goals & Challenges •ML Platform @ Uber 2. How

Historical featuresE.g. average prep-time in last week

Near real time featuresE.g. average prep-time in last few minutes

Real time featuresE.g. order size, time of day

Michelangelo model training

Production model(GBDT)

Predicted prep-time

Updated Data

Online prediction

Offline training

ML Model with Feedback Loop

Page 45: Time Predictions in Uber Eats - QCon New York · Time Predictions in Uber Eats Zi Wang@Uber QCon New York 2019. 1. ML in Uber Eats •Goals & Challenges •ML Platform @ Uber 2. How

● Ground truth exploration○ Experiment in restaurants○ ...

● Improving ML model○ Feature engineering

■ Exploration of places, weather, and event data■ Model partitioning■ ...

○ Leverage ensemble learning (stacking)○ Collaboration with AI Labs on more deep learning models

Future Improvements

Page 46: Time Predictions in Uber Eats - QCon New York · Time Predictions in Uber Eats Zi Wang@Uber QCon New York 2019. 1. ML in Uber Eats •Goals & Challenges •ML Platform @ Uber 2. How

Delivery Time Estimation

Page 47: Time Predictions in Uber Eats - QCon New York · Time Predictions in Uber Eats Zi Wang@Uber QCon New York 2019. 1. ML in Uber Eats •Goals & Challenges •ML Platform @ Uber 2. How

Eater-facing ETD

EATER

RESTAURANT

DELIVERY PARTNER

0) eyeball 1) order 10) foodcreated received

2) order 6) foodaccepted ready

4) accepted trip 8) begun trip 11) ended trip

3) dispatched 5) arrived 7) departed 9) arrived

restaurant-leg delivery-leg

observable statenot-observable state

Page 48: Time Predictions in Uber Eats - QCon New York · Time Predictions in Uber Eats Zi Wang@Uber QCon New York 2019. 1. ML in Uber Eats •Goals & Challenges •ML Platform @ Uber 2. How

Why is predicting ETD difficult?

EATER

RESTAURANT

DELIVERY PARTNER

0) eyeball 1) order 10) foodcreated received

2) order 6) foodaccepted ready

3) dispatched 5) arrived 7) departed 9) arrived

4) accepted trip 8) begun trip 11) ended trip

restaurant-leg delivery-leg

observable statenot-observable state

delay early pick request

Page 49: Time Predictions in Uber Eats - QCon New York · Time Predictions in Uber Eats Zi Wang@Uber QCon New York 2019. 1. ML in Uber Eats •Goals & Challenges •ML Platform @ Uber 2. How

Travel Time Estimation

Page 50: Time Predictions in Uber Eats - QCon New York · Time Predictions in Uber Eats Zi Wang@Uber QCon New York 2019. 1. ML in Uber Eats •Goals & Challenges •ML Platform @ Uber 2. How

Rider

Rider - Request Ride

Driver

Rider - On Trip

Page 51: Time Predictions in Uber Eats - QCon New York · Time Predictions in Uber Eats Zi Wang@Uber QCon New York 2019. 1. ML in Uber Eats •Goals & Challenges •ML Platform @ Uber 2. How

CreditsTeams @ Uber

Special thanks to:

● Engineers

● Data Scientists

● Product managers

● Product Ops

● Data Analysts

Page 52: Time Predictions in Uber Eats - QCon New York · Time Predictions in Uber Eats Zi Wang@Uber QCon New York 2019. 1. ML in Uber Eats •Goals & Challenges •ML Platform @ Uber 2. How

THANK YOU

Q & A

Page 53: Time Predictions in Uber Eats - QCon New York · Time Predictions in Uber Eats Zi Wang@Uber QCon New York 2019. 1. ML in Uber Eats •Goals & Challenges •ML Platform @ Uber 2. How