VOOZH about

URL: https://thenewstack.io/how-uber-eats-uses-machine-learning-to-estimate-delivery-times/

⇱ How Uber Eats Uses Machine Learning to Estimate Delivery Times - The New Stack


TNS
SUBSCRIBE
Join our community of software engineering leaders and aspirational developers. Always stay in-the-know by getting the most important news and exclusive content delivered fresh to your inbox to learn more about at-scale software development.
REQUIRED
It seems that you've previously unsubscribed from our newsletter in the past. Click the button below to open the re-subscribe form in a new tab. When you're done, simply close that tab and continue with this form to complete your subscription.
The New Stack does not sell your information or share it with unaffiliated third parties. By continuing, you agree to our Terms of Use and Privacy Policy.
Welcome and thank you for joining The New Stack community!
Please answer a few simple questions to help us deliver the news and resources you are interested in.
REQUIRED
REQUIRED
REQUIRED
REQUIRED
REQUIRED
Great to meet you!
Tell us a bit about your job so we can cover the topics you find most relevant.
REQUIRED
REQUIRED
REQUIRED
REQUIRED
REQUIRED
Welcome!

We’re so glad you’re here. You can expect all the best TNS content to arrive Monday through Friday to keep you on top of the news and at the top of your game.

What’s next?

Check your inbox for a confirmation email where you can adjust your preferences and even join additional groups.

Follow TNS on your favorite social media networks.

Become a TNS follower on LinkedIn.

Check out the latest featured and trending stories while you wait for your first TNS newsletter.

PREV
1 of 2
NEXT
VOXPOP
As a JavaScript developer, what non-React tools do you use most often?
Angular
0%
Astro
0%
Svelte
0%
Vue.js
0%
Other
0%
I only use React
0%
I don't use JavaScript
0%
Thanks for your opinion! Subscribe below to get the final results, published exclusively in our TNS Update newsletter:
NEW! Try Stackie AI
From clobbered drafts to real-time sync
Apr 14th 2026 10:00am, by David Moore
TypeScript 6.0 RC arrives as a bridge to a faster future
Mar 14th 2026 9:00am, by Darryl K. Taft
Mastra empowers web devs to build AI agents in TypeScript
Jan 28th 2026 11:00am, by Loraine Lawson
2019-07-19 10:17:05
How Uber Eats Uses Machine Learning to Estimate Delivery Times
feature,
AI / Operations

How Uber Eats Uses Machine Learning to Estimate Delivery Times

Jul 19th, 2019 10:17am by Joab Jackson
👁 Featued image for: How Uber Eats Uses Machine Learning to Estimate Delivery Times
Feature image by Rudy and Peter Skitterians from Pixabay.

Estimating the perfect times for drivers to pick up food delivery orders for a number of different restaurants can be one of the most difficult of computational problems. Think of it like the Traveling Salesperson NP-Hard combinatorial optimization problem: The customer wants food delivered in a timely manner, and the delivery person wants to food ready when they roll-up. If the estimates are off by even a tiny bit, then customers are unhappy and delivery people will work elsewhere.

Yet, car-sharing service Uber is building a global service, called Uber Eats, that will rely on accurate predictions to succeed. The secret to its success will be machine learning, built from the company’s in-house ML platform, nicknamed Michelangelo.

👁 Image

Zi Wang, Uber senior software engineer at Uber who leads the company’s time prediction work, offered a explained at QCON New York last month that explained the process of using AI to make these time estimates.

Launched in 2015 in Toronto, Uber Eats is already available in 400 cities worldwide, with 220,000 participating restaurants. It provides a food delivery service for restaurants, using freelance drivers from its car-sharing service. The ability to predict delivery times — both when the food is ready and how long it takes to deliver it — are paramount to the service’s success. It booked over $8 billion in orders for 2018.

Wang’s lessons could be valuable to other businesses in the emerging O2O (online-to-offline) e-commerce vendors, who must squeeze their profits from narrow and unpredictable tolerances.

Wang started at Uber in 2015 to refine the company’s dispatch system, but the work led him into ML.

The goal of the service is to make food delivery reliable, effortless, and affordable for end-users. “We want to sure the food will be delivered seamlessly, which requires us to predict the future and balance between orders and delivery partners,” Wang said. For each order, the system must make three predictions: the time of delivery, the time it takes to deliver the food, and the time it takes for the restaurant to prepare the order. Predictions are made more difficult, given that Uber doesn’t have any insight into how long it takes for a restaurateur to prepare any given meal.

Timing is the key. Uber Eats wants to dispatch the delivery person to arrive just when the order is ready. If it is too early then the delivery person will wait around unnecessarily, losing money from other possible orders. But wait too long and the food may arrive late, or cold, to the hungry customers.

👁 Image

When users open the app and peruse a selection of restaurants, they are given a general estimate of how long it will take for the food to arrive. It also offers restaurants the ability to estimate of how long it would take the food to be prepared, which the restaurants can adjust if they want.

All data is collected by Kafka and pushed to a streaming engine for pre-processing and storage in a Cassandra data store, where it is processed by Spark for data modeling. Models that are trained and are ready to use are stored in Cassandra model repository.

👁 Image

Finding the optimal state for the dispatch system’s problem space, with so many moving pieces, is a NP hard computer problem, Wang admits. “For every decision we are making, we are taking into consideration all the partners,” Wang said, referring to the eater, the delivery person and the restaurant. The optimal state is one in which each stakeholder gets the most desirable possible outcome: fastest delivery time for the eater, most accurate arrival time for the delivery person, and the most accurate food preparation estimate for the restaurant.

Once an order is placed, the dispatch system must generate the most accurate time to send the driver to the restaurant.

“We want the food delivery partner to arrive at the exact time the food will be ready. We don’t want them to arrive too late because the food will be cold. we don’t want them to arrive too early because they waste their time waiting there, and also they would take the parking and dining spaces from the restaurant,” Wang said.

Prior to ML, Uber Eats used a Greedy algorithm for determining when to dispatch a delivery person, which solved the problem by estimating the best local answer for each delivery, without optimizing the problem space for all the drivers in that area. This did not work well for the service as a whole, as it led to late deliveries and delivery people waiting in the restaurant parking lot for orders to be finished.
👁 Image

A greedy algorithm will simply find the closest driver for a particular order. In contrast, a global optimization would resolve the best times for all the drivers and all the pickups. Wang offered a hypothetical example: A greedy algorithm would match two drivers to their closest orders, for a total travel time of six minutes, might switch the pickups for those two drivers so that the total time for both orders would only be four minutes.

With ML in place, a travel time estimate can be taken from the history of all travel times, and for all restaurants in the area, given all the jobs and all the available drivers. Uber Eats’ approach combines historical data, near-real-time data and real-time data. “With a global matching algorithm, we are able to consider all jobs and supplies at the same time,” he said. “We are able to solve the entire set of jobs and supplies in a single global optimization problem.”

👁 Image

The order preparation time, however, can be tricky, in no small part because there is no way for Uber to be there to see how long it takes the kitchen staff to prepare the food. It can be estimated by when the delivery person leaves the restaurant, though this is of limited value, as the food may already be finished by the time the delivery person arrives.

This is where ML can provide insight, with additional contextual clues, both historical, and in near real-time: This system draws from such factors as average food prep time in the past week, the number of outstanding orders and how much each order cost, and even what day of the week it is. Even real-time indicators can be used, such as how many other orders are being handled at the time, even those from other delivery services.

“Combining all these features helps us make much more accurate predictions than just relying on a single one of them,” he said.

TRENDING STORIES
Joab Jackson is a senior editor for The New Stack, covering cloud native computing and system operations. He has reported on IT infrastructure and development for over 30 years, including stints at IDG and Government Computer News. Before that, he...
Read more from Joab Jackson
SHARE THIS STORY
TRENDING STORIES
SHARE THIS STORY
TRENDING STORIES
TNS DAILY NEWSLETTER Receive a free roundup of the most recent TNS articles in your inbox each day.
The New Stack does not sell your information or share it with unaffiliated third parties. By continuing, you agree to our Terms of Use and Privacy Policy.