All Data Labs

Machine learning

Delivery Time Prediction

hard4–5 hours2 datasets
Company
DoorDash
Job positions
Data ScientistML Engineer
Topics
RegressionFeature engineeringscikit-learnModel evaluationModel explanation

The scenario

DoorDash: Build and evaluate a model that predicts food delivery times, then explain what makes deliveries slow.

DoorDash shows customers an estimated delivery time when they place an order. You're a data scientist on the logistics team. The current estimate is a flat average that's often far off, and late deliveries lead to refunds and bad reviews, so the product team wants a model that predicts delivery time from what's known when the order is placed.

Your task

Train a model that predicts delivery time in minutes, evaluate it honestly, predict the held-out test orders, and explain which factors matter most.

Instructions

  1. 1Explore the training data: look at the target's distribution, extreme values, missing values and how each feature relates to delivery time.
  2. 2Handle missing values and extreme delivery times, and explain your choices. Only use information that would be known when the order is placed.
  3. 3Engineer useful features, such as time of day and day of week from the order time, and combinations of features that make physical sense.
  4. 4Set up a validation approach on the training data and a simple baseline to beat, such as predicting the average delivery time.
  5. 5Train at least two different models, compare them using mean absolute error (MAE) in minutes, and pick one.
  6. 6Explain what drives delivery time in your chosen model, and show where it makes its largest errors.
  7. 7Predict delivery_minutes for every order in deliveries_test.csv and save the results as predictions.csv with the columns order_id and predicted_minutes.

Datasets

The data is synthetic and does not come from DoorDash, but it's modeled on how real companies record it, including the mess. All files come in one download.

deliveries_train.csv

8,000 delivered orders from March to August 2025, with the actual delivery time.

8,000 rows · 13 columns · 635 KB

ColumnTypeDescription
order_idintegerUnique ID of the order.
order_placed_atdatetimeWhen the customer placed the order (local time).
restaurant_idintegerThe restaurant.
cuisinetextType of food the restaurant serves.
restaurant_avg_prep_minutesdecimalThe restaurant's average food prep time from past orders.
city_zonetextPart of the city the restaurant is in.
distance_kmdecimalRoute distance from restaurant to customer, in kilometers.
items_countintegerNumber of items in the order.
order_subtotaldecimalFood total before fees, in USD.
courier_vehicletextHow the assigned courier travels: bike, scooter or car.
courier_trips_completedintegerDeliveries the courier had completed before this one.
weathertextWeather when the order was placed.
delivery_minutesintegerMinutes from order placed to delivered. This is what you predict.
Preview the first 5 rows
order_idorder_placed_atrestaurant_idcuisinerestaurant_avg_prep_minutescity_zonedistance_kmitems_countorder_subtotalcourier_vehiclecourier_trips_completedweatherdelivery_minutes
7000012025-03-01 10:00:0010pizza12.9suburbs_north2.2219.24scooter50cloudy29
7000032025-03-01 11:06:005mexican12.4uptown5.318.36bike1255clear36
7000042025-03-01 11:15:0059pizza11.7suburbs_south2.6327.38scooter276clear31
7000052025-03-01 11:28:0051indian17downtown3.318bike664cloudy34
7000062025-03-01 11:40:00104thai11.5suburbs_south11.6218.96car38rain54

deliveries_test.csv

2,000 held-out orders from the same period, without the delivery time.

2,000 rows · 12 columns · 153 KB

ColumnTypeDescription
order_idintegerUnique ID of the order.
order_placed_atdatetimeWhen the customer placed the order (local time).
restaurant_idintegerThe restaurant.
cuisinetextType of food the restaurant serves.
restaurant_avg_prep_minutesdecimalThe restaurant's average food prep time from past orders.
city_zonetextPart of the city the restaurant is in.
distance_kmdecimalRoute distance from restaurant to customer, in kilometers.
items_countintegerNumber of items in the order.
order_subtotaldecimalFood total before fees, in USD.
courier_vehicletextHow the assigned courier travels: bike, scooter or car.
courier_trips_completedintegerDeliveries the courier had completed before this one.
weathertextWeather when the order was placed.
Preview the first 5 rows
order_idorder_placed_atrestaurant_idcuisinerestaurant_avg_prep_minutescity_zonedistance_kmitems_countorder_subtotalcourier_vehiclecourier_trips_completedweather
7000022025-03-01 11:04:0015indian18.1midtown1.4222.03car181rain
7000072025-03-01 11:52:0037pizza17.5midtown1.8345.44car501cloudy
7000132025-03-01 12:30:003pizza20.9suburbs_north4.3216.97bike235rain
7000292025-03-01 16:15:004pizza14suburbs_south3.2215.96scooter28rain
7000302025-03-01 16:17:00145pizza12.3suburbs_south4.4228.96car108heavy_rain

Hint

Learn missing-value fills and category encodings from the training data only, then apply the same steps to the test orders. A scikit-learn pipeline does both in one object.

model = make_pipeline(preprocess, GradientBoostingRegressor())
model.fit(X_train, y_train)
predictions = model.predict(X_test)

Deliverable

A public GitHub repo with your notebook or scripts, a predictions.csv file for the test orders, and a README explaining your approach, validation results and the main drivers of delivery time.

When you're done, post your repo in the Solutions tab to share it with other learners.

What grading checks

Use this checklist to review your own work before you post and share it.

  • Submitted GitHub repo is public and reachable.
  • Repo contains at least one notebook or script file.
  • Repo contains predictions.csv with order_id and predicted_minutes for all 2,000 test orders.
  • Predictions have a mean absolute error at least 30% lower than always predicting the training average.
  • A validation approach and a baseline are used to compare at least two models.
  • Missing values and extreme delivery times are handled with explained choices.
  • README explains the main drivers of delivery time and where the model makes its largest errors.