← Back
University courseworkMachine Learning — Final projectGroup project

Predicting on-time delivery in e-commerce

Random Forest, logistic regression and K-Means to anticipate delays

Problem

Classify whether an order arrives on time and find which factors and segments concentrate delays.

Data

Train.csv: 10,999 orders with warehouse, shipment mode, customer-care calls, rating, cost, prior purchases, importance, gender, discount and weight; target Reached.on.Time_Y.N.

Methods

  • EDA with charts
  • Encoding (LabelEncoder) and scaling
  • Random Forest and logistic regression
  • K-Means with K chosen by silhouette
  • Business reading of coefficients and feature importance

Results

  • Random Forest: 65.73% accuracy on 3,300 test orders and 0.63 recall on late orders, vs 0.51 for logistic regression (64.73% accuracy).
  • Most important features: weight (Weight_in_gms), discount offered and product cost.
  • K-Means (3 clusters, K chosen by silhouette): Cluster 0 (2,254 orders) has a 99.47% late-delivery rate; it is characterised by high discounts and lower average weight.

Tools

Pythonpandasscikit-learnmatplotlibseabornDatabricks

University work; no claim of sole individual authorship.