All Data Labs

Forecasting

Parcel Volume Forecasting

medium3–4 hours3 datasets
Company
UPS
Job positions
Data ScientistData AnalystBusiness Analyst
Topics
Time seriesDemand forecastingSeasonalityHoliday effectspandas

The scenario

UPS: Forecast daily parcel volume for each sort hub through December, and turn the forecast into a staffing plan.

UPS sorts parcels at eight hubs, and December brings far more of them than any other month. Each hub books seasonal crews weeks ahead, so it needs a daily forecast rather than a monthly total, and running short is worse than running over because parcels then miss their delivery date. You're an analyst on the industrial engineering team, and the crew bookings have to go in before peak starts.

Your task

Forecast daily outbound parcels per hub for December 1 to December 28, 2025, beat a naive forecast on a held-out window, and turn the result into planned crew hours.

Instructions

  1. 1Load and clean the three years of history. Check for repeated rows and missing days, and explain how you handled each.
  2. 2Plot each hub's daily volume. Describe the weekly pattern, the yearly growth, the days the building effectively closes, and the shape December takes.
  3. 3Look for days whose volume does not fit the pattern, decide whether each is real demand or a problem in the building, and say how you treated it.
  4. 4Check whether every hub has grown the same way, and build your forecast on the level each one runs at now.
  5. 5Work out when a sale actually moves parcels, using the days around Black Friday and Cyber Monday.
  6. 6Hold out the last few weeks and forecast them, against a naive forecast of the same date a year earlier. Score both with weighted absolute percentage error, or WAPE, which is total absolute error divided by total actual volume, so the near-empty holidays do not dominate.
  7. 7Forecast December 1 to December 28 for all eight hubs and turn each day into planned crew hours, given that a missed parcel costs $2.80 and an idle crew hour costs $38. Save forecast.csv with the columns hub_id, date, parcels_outbound_forecast and crew_hours_planned.

Datasets

All files come in one download.

daily_volume.csv

Daily sort volume for eight hubs from January 1, 2023 to November 30, 2025.

8,524 rows · 7 columns · 349 KB

ColumnTypeDescription
hub_idtextThe sort hub.
datedateThe sort day.
parcels_inboundintegerParcels delivered into the building that day.
parcels_outboundintegerParcels sorted and sent on that day. This is what you forecast.
trailers_unloadedintegerTrailers unloaded at the inbound dock.
sort_hours_staffedintegerCrew hours the hub actually staffed that day.
parcels_missortedintegerParcels sent to the wrong destination and handled again.
Preview the first 5 rows
hub_iddateparcels_inboundparcels_outboundtrailers_unloadedsort_hours_staffedparcels_missorted
LOU2023-01-01101339790942218
LOU2023-01-02511590511361483211049631
LOU2023-01-03439720425289421173485793
LOU2023-01-04420356401037377160054573
LOU2023-01-05414748416808372193114489

hubs.csv

The eight sort hubs and what each one can handle.

8 rows · 7 columns · 1 KB

ColumnTypeDescription
hub_idtextUnique ID of the hub.
hub_nametextName of the building.
citytextCity the hub is in.
statetextUS state the hub is in.
regiontextOperating region the hub reports to.
sort_capacity_per_hourintegerParcels the hub can sort in an hour at full crew.
crew_sizeintegerPeople on a full sort crew.
Preview the first 5 rows
hub_idhub_namecitystateregionsort_capacity_per_hourcrew_size
LOULouisville Air HubLouisvilleKYCentral460001750
DFWDallas Regional SortDallasTXSouth21000860
ONTOntario West SortOntarioCAWest23500940
PHLPhiladelphia Metro SortPhiladelphiaPANortheast18000720
CHIHodgkins Area HubHodgkinsILCentral20500810

calendar_days.csv

Every date from January 1, 2023 to December 28, 2025, including the dates you forecast.

1,093 rows · 6 columns · 34 KB

ColumnTypeDescription
datedateThe calendar date.
day_of_weektextDay name, from Sunday to Saturday.
is_holidaytextWhether the day is a holiday the network observes: yes or no.
holiday_nametextName of the holiday. Empty on days that are not holidays.
is_peak_seasontextWhether the day falls in peak season: yes or no.
retail_promo_eventtextblack_friday, cyber_monday, prime_day or none.
Preview the first 5 rows
dateday_of_weekis_holidayholiday_nameis_peak_seasonretail_promo_event
2023-01-01SundayyesNew Year's Daynonone
2023-01-02Mondaynoemptynonone
2023-01-03Tuesdaynoemptynonone
2023-01-04Wednesdaynoemptynonone
2023-01-05Thursdaynoemptynonone

Hints

A forecast of the same date a year ago lands on a different day of the week, which is most of why it does badly. Handling the day of the week and the shape of December separately avoids that.

volume["weekday"] = pd.to_datetime(volume["date"]).dt.day_name()
volume.groupby("weekday")["parcels_outbound"].mean()

A day with normal volume arriving into the building and nothing leaving it is not a quiet day. Comparing inbound against outbound separates the two.

Deliverable

A public GitHub repo with your analysis (a notebook or scripts), forecast.csv covering every hub and date in December, and a README with the patterns you found, your held-out error and the reasoning behind the staffing plan.

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.
  • forecast.csv has a forecast and planned crew hours for all eight hubs on every date from December 1 to December 28.
  • WAPE is 18 percent or better on December, against 30 percent for the naive forecast.
  • Under the cost assumptions in the brief, the staffing plan costs less than a flat crew level every day.
  • The days that do not fit the pattern are identified and kept out of the trained pattern, with the reasoning given.
  • Growth is checked per hub so the forecast follows the level each runs at now, and accuracy is reported on a held-out window rather than fitted history.