Customer churn is when customers stop using a company's services. Predicting churn helps businesses retain customers by identifying at-risk individuals and addressing their concerns.
The Churn Prediction project utilizes machine learning to forecast customer churn based on historical data. It includes data preprocessing, exploratory analysis, feature engineering, model training, and deployment through a Flask web application.
- Data Cleaning: Handles missing values and encodes categorical variables.
- Exploratory Data Analysis: Visualizes data distributions and correlations.
- Model Training: Implements Decision Tree, Random Forest, and ANN models.
- Deployment: Provides a Flask web app for real-time predictions.
- Language: Python 3.8+
- Libraries: pandas, numpy, matplotlib, seaborn, scikit-learn, torch, Flask, pickle
Thanks to these amazing people for contributing to this repository:
Prabal Patra |
Nazim Saifi |
Muhammad Bilal |
- Python 3.8+
- pip
-
Clone the Repository:
git clone https://github.com/yourusername/Churn_Prediction.git cd Churn_Prediction
-
Create and Activate Virtual Environment:
python -m venv venv # Windows venv\Scripts\activate # macOS/Linux source venv/bin/activate
-
Install Dependencies:
pip install -r requirements.txt
-
Prepare Dataset:
Place
train.csv
andtest.csv
in thedataset/
folder. -
Train Models (Optional):
Run the notebook in
notebooks/Churn_Prediction.ipynb
to train and save models.
-
Navigate to App Directory:
cd app
-
Ensure Model is Present:
Verify
models/random_forest_model.pkl
exists. -
Start the App:
python app.py
-
Access the Application:
Open http://127.0.0.1:5000/ in your browser.
Send a POST request to http://127.0.0.1:5000/predict
with the required data to receive churn predictions.
Contributions are welcome! Follow these steps:
-
Fork the Repository
-
Clone Your Fork:
git clone https://github.com/yourusername/Churn_Prediction.git cd Churn_Prediction
-
Create a Branch:
git checkout -b feature/YourFeature
-
Commit Changes:
git commit -m "Description of your feature"
-
Push and Create Pull Request:
git push origin feature/YourFeature
This project is licensed under the MIT License.