A Data Mining project in R analyzing e-commerce shipment factors (discounts, product weights) to predict late deliveries using Decision Trees, Logistic Regression, and Naïve Bayes.
An end-to-end Data Mining project in R analyzing historical e-commerce shipment data to identify key factors contributing to late deliveries and predict delivery performance.
Delayed shipments impact customer satisfaction and increase operational costs. This project evaluates 10,999 e-commerce transactions to determine which factors (e.g., product weight, discounts, warehouse blocks, carrier mode) drive delivery delays.
Using supervised learning, we benchmarked multiple classification models to build a predictive framework for identifying high-risk shipments prior to dispatch.
- Primary Delay Drivers: High promotional discounts (
Discount_offered) and package weight (Weight_in_gms) are the strongest predictors of late delivery. - Volume Spikes: Orders with higher discounts exhibit sharp, non-linear increases in delay rates due to fulfillment bottlenecks during promotional events.
- Operational Irrelevance: Factors like
Warehouse_block,Mode_of_Shipment(Flight vs. Ship vs. Road), andGendershowed no statistically significant impact on on-time delivery performance.
- Language: R (v4.3+)
- Data Manipulation:
dplyr,readr - Visualization:
ggplot2,viridis - Machine Learning & Modeling:
caret,rpart,e1071,fastDummies,pROC - Reporting:
knitr,kableExtra, R Markdown
Models were evaluated on an independent holdout/test set (20%) using a 50/30/20 split:
| Model | Holdout Accuracy | Strengths |
|---|---|---|
Decision Tree (rpart) |
68.36% | Best Overall: Captures non-linear feature cutoffs (weight & discount thresholds) |
| Naïve Bayes | 66.68% | Fast baseline probabilistic classification |
| Logistic Regression (Stepwise) | 65.82% | High interpretability for statistical significance ( |
Conclusion: The Decision Tree model is recommended for deployment as it handles complex interaction effects between weights and promotional volumes without requiring linear assumptions.
An end-to-end Data Mining project in R analyzing historical e-commerce shipment data to identify key factors contributing to late deliveries and predict delivery performance.

