TL;DR Discovered the “delivery death zone” - a hidden pattern where mid-range distances (2-5km) were killing profitability for a major Danish grocery delivery service. My decision tree model exposed this counterintuitive insight that executives could actually understand and act on. The result? Dynamic pricing that transformed operations into a growth engine, with the model still running in production after 7+ years.
This Danish grocery delivery service operates a crowdsourced model where freelance couriers shop and deliver groceries to customers. The business was losing significant money on failed deliveries - either expensive last-minute cab interventions or complete cancellations that damaged customer trust. Management had no visibility into which orders would fail or why.
I deliberately chose a decision tree over more sophisticated models like XGBoost or neural networks. The executives needed to understand the mechanisms driving failures, not just predictions. The tree revealed a subtle pattern: mid-range deliveries (2-5km) had 2-4% lower success rates than both shorter and longer distances. Short trips attracted walking couriers, long trips were profitable for drivers, but the middle range fell into a dead zone - too far to walk, not lucrative enough to drive.
The model incorporated 24+ carefully engineered features spanning physical complexity (weight, SKUs, frozen items), temporal dynamics (lead time, peak periods, event calendars), geographic factors (store density transformed as 1/density²), courier behavior patterns, customer histories, and real-time market conditions. Every element that could impact the pick-pack-deliver cycle was quantified and tested.
Armed with these insights, the company implemented dynamic pricing that boosted fees for mid-range deliveries during low-supply periods. The model scored every order every 10 minutes in production, enabling both operational decisions and strategic planning. After 7+ years, the original decision tree is still running in production - a testament to choosing interpretability over accuracy when business understanding matters more than marginal performance gains.
Three delivery scenarios
Three example scenarios illustrate what the model sees:
- Delivery Death Zone — the problematic mid-range distance (3.5km) - too far to walk, not profitable to drive
- Rush Hour — Thursday evening rush - typical moderate delivery conditions
- Sweet Spot — Wednesday afternoon, short distance, ground floor - perfect conditions