An end-to-end Machine Learning ecosystem designed to identify at-risk customers using behavior analytics. This system includes a complete pipeline: Automated Data Synthesis -> Feature Engineering -> Model Training -> Real-time API Deployment.
Losing a customer costs 5x more than retaining one. This project utilizes the power of XGBoost to predict which customers are likely to churn in the next billing cycle, allowing businesses to take proactive retention actions.
- Modular Pipeline: Clean and industry-standard folder structure.
- Explainable AI: Feature importance visualization to understand churn drivers.
- Automated Analytics: Generates a 4-panel executive dashboard for stakeholders.
- Production-Ready API: Real-time prediction service built with FastAPI.
The model automatically outputs high-quality analytical reports to the images/ directory.
A comprehensive 4-panel view showing the overall health of the customer base.

- Engine: Python 3.14+
- Data Science: Pandas, NumPy, Scikit-learn
- Machine Learning: XGBoost (Extreme Gradient Boosting)
- Deployment: FastAPI, Uvicorn
- Visualization: Matplotlib, Seaborn
Customer-Churn-Prediction/
├── data/ # Raw and processed datasets
├── images/ # Automated visual reports (Pie, Bar, Dashboard)
├── models/ # Serialized ML models (.joblib)
├── src/ # Modular Python scripts (Loader, Preprocessor)
├── api_service.py # FastAPI Production Service
├── main.py # Main training pipeline execution
└── README.md # Professional documentation
🚀 How to Run locally
Clone the Repo:
Bash
git clone [https://github.com/dalimkumar452-sudo/Customer-Churn-Prediction-Model.git/Customer-Churn-Prediction.git]
Install Requirements:
Bash
pip install -r requirements.txt
Train & Generate Reports:
Bash
python main.py
Launch API Service:
Bash
uvicorn api_service:app --reload
👨💻 Developer
Dalim Kumar
GitHub: https://github.com/dalimkumar452-sudo/Customer-Churn-Prediction-Model.git
Project Scope: Machine Learning / Customer Analytics / Data Engineering

