This project implements a machine learning solution to predict customer churn using various classification algorithms. The model helps identify customers who are likely to discontinue services, enabling proactive retention strategies.
- Data preprocessing and exploratory data analysis
- Implementation of multiple machine learning models:
- XGBoost Classifier
- Random Forest Classifier
- Decision Tree Classifier
- Support Vector Machine (SVM)
- K-Nearest Neighbors (KNN)
- Neural Network
- Model evaluation and comparison
- Interactive web interface using Streamlit
- Model persistence using pickle
- Handling imbalanced data using SMOTE
- Python 3.11
- Conda (recommended for environment management)
conda create -n churn-prediction python=3.11
conda activate churn-prediction
pip install -r requirements.txt
- numpy
- pandas
- scikit-learn
- streamlit
- xgboost
- imbalanced-learn
- python-dotenv
- matplotlib
- seaborn
- plotly
jupyter notebook churn.ipynb
streamlit run main.py
customer-churn/ ├── churn.ipynb # Main notebook with model development ├── main.py # Streamlit application ├── churn.csv # Dataset ├── models/ # Saved model files │ ├── dt_model.pkl │ ├── knn_model.pkl │ ├── rf_model.pkl │ ├── svm_model.pkl │ └── xgb_model.pkl ├── requirements.txt # Project dependencies └── README.md # Project documentation
The project implements and compares several machine learning models for churn prediction. Each model is evaluated using metrics such as accuracy, precision, recall, and F1-score.
Create a .env
file in the project root with the following variables:
GROQ_API_KEY=<your-groq-api-key>
- Fork the repository
- Create a new branch
- Make your changes
- Submit a pull request
This project is licensed under the MIT License. See the LICENSE file for details.