This project predicts customer churn (whether a customer will leave the service or not) using machine learning models. The model is deployed using Flask, allowing users to upload a CSV file and get predictions.
- Python (For model training and prediction)
- Flask (For deployment)
- Pandas, NumPy (For data processing)
- Scikit-learn, XGBoost, DecisionTree, RandomForest (For machine learning)
- SMOTE & ENN (For handling imbalanced data)
- Data Preprocessing:
- Handled missing values
- Converted categorical data using One-Hot Encoding
- Scaled numerical data
- Applied SMOTEENN to balance the dataset
- Model Training:
- Tried different models (Decision Tree, XGBoost, Random Forest)
- Selected Random Forest as the final model (best accuracy ~98%)
- Saved the trained model using Pickle
- Flask Web App:
- Users can upload a CSV file
- The model processes the data and returns predictions
- Deployment:
- Flask app can be tested locally using Anaconda/Command Prompt
- Can be hosted on cloud platforms (like Render, Heroku, or AWS)
git clone https://github.com/sayed-ashfaq/Customer-Churn-Prediction.git
cd Customer-Churn-Prediction
conda create --name churn_env python=3.9
conda activate churn_env
pip install -r requirements.txt
python app.py
The app will start running at http://127.0.0.1:5000/
- Go to the browser and open http://127.0.0.1:5000/
- Upload a CSV file with customer data
- The model will predict whether the customer will churn or not
- It is uploaded as test_data in the git repo
- Deploy the Flask app to Render, AWS, or Heroku
- Improve the UI using HTML & CSS
- Experiment with more ML models for better accuracy