rshewatkar/shipment-delay-predictor
0
๐ Shipment Delay Predictor โ Logistics ML System
๐ Live Demo
๐ [Click Here to Try the App](https://rshewatkar-shipment-delay-predictor.hf.space)
Deployed on Hugging Face Spaces with CI/CD (GitHub Actions)
๐ Project Overview
An end-to-end Machine Learning system that predicts shipment delay risk before dispatch.
Built for logistics and courier companies to:
- Reduce late deliveries
- Improve customer satisfaction
- Enable proactive decision-making
โ ๏ธ Key Insight: ~60% of shipments are delayed โ this model flags high-risk orders early.
๐ Dashboard Overview
๐ฎ Prediction Flow
โ ๏ธ Risk Analysis
๐ฏ Problem Statement
Late deliveries lead to:
- Refunds & penalties
- Customer dissatisfaction
- Operational inefficiencies
This system predicts delay probability at booking time โ enabling early intervention.
๐ Dataset Overview
๐ Key Insights (EDA)
- ๐ฏ Discount > 10% โ High delay probability
- โ๏ธ 2โ4 kg weight โ Highest delay rate
- ๐ข Ship mode โ Most delays
- ๐ Customer calls โฅ 4 โ Strong delay signal
โ๏ธ Feature Engineering
๐ค Model Performance
๐ก Business Impact
- ๐ 69% of delayed shipments correctly identified
- ๐ฏ 73% precision in delay prediction
- ๐ Potential 15โ25% reduction in late deliveries
๐ฅ๏ธ App Features
๐ Project Structure
shipment-delay-predictor/
โ
โโโ app.py # Streamlit app (entry point)
โโโ requirements.txt
โโโ README.md
โ
โโโ .github/
โ โโโ workflows/
โ โโโ sync-to-hub.yml # CI/CD pipeline (GitHub โ Hugging Face)
โ
โโโ data/
โ โโโ raw/
โ โโโ processed/
โ
โโโ notebooks/
โ โโโ EDA.ipynb
โ โโโ preprocessing.ipynb
โ โโโ modeling.ipynb
โ
โโโ src/
โ โโโ preprocess.py
โ โโโ train.py
โ โโโ predict.py
โ โโโ utils.py
โ
โโโ models/ # Trained ML models
โ โโโ best_model.pkl
โ โโโ scaler.pkl
โ โโโ label_encoders.pkl
โ
โโโ reports/
โ โโโ figures/
โ โ โโโ01_target_distribution.png
โ โ โโโ02_delay_by_warehouse.png
โ โ โโโ03_delay_by_mode.png
โ โ โโโ04_discount_effect.png
โ โ โโโ05_weight_effect.png
โ โ โโโ06_customer_calls.png
โ โ โโโ07_correlation_heatmap.png
โ โ โโโ08_model_comparison.png
โ โ โโโ09_confusion_matrix.png
โ โ โโโ10_roc_curve.png
โ โ โโโ11_feature_importance.png
โ โ
โ โโโ screenshots/
โ โโโdashboard-main.png
โ โโโdashboard-result.png
โ โโโdashboard-risk.png
โ๏ธ How to Run Locally
1. Clone the repository
git clone https://github.com/rshewatkar/shipment-delay-predictor.git
cd shipment-delay-predictor2. Install dependencies
pip install -r requirements.txt3. Run the app
streamlit run app.py๐ ML Pipeline
- Data Collection
- Data Preprocessing
- Feature Engineering
- Model Training (XGBoost)
- Model Evaluation
- Deployment (Streamlit + Hugging Face)
๐ ๏ธ Tech Stack
๐ค Author
Rahul Shewatkar
- ๐ผ LinkedIn
- ๐ GitHub
- ๐ค Hugging Face
๐ License
MIT License
