Skip to content

Latest commit

 

History

History
62 lines (40 loc) · 2.92 KB

README.md

File metadata and controls

62 lines (40 loc) · 2.92 KB

e-commerce-shipping-delay-prediction

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.

📦 E-Commerce Shipping Delay Prediction

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.


📌 Project Overview

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.


📊 Key Findings & Business Insights

  • 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), and Gender showed no statistically significant impact on on-time delivery performance.

🛠 Tech Stack & R Packages

  • Language: R (v4.3+)
  • Data Manipulation: dplyr, readr
  • Visualization: ggplot2, viridis
  • Machine Learning & Modeling: caret, rpart, e1071, fastDummies, pROC
  • Reporting: knitr, kableExtra, R Markdown

📈 Model Comparison & Results

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 ($p$-values)

Conclusion: The Decision Tree model is recommended for deployment as it handles complex interaction effects between weights and promotional volumes without requiring linear assumptions.

📦 E-Commerce Shipping Delay Prediction

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.


Decision Tree Structure

Decision Tree Plot

Model Performance Comparison (ROC Curve)

ROC Curve Comparison