Predict customer churn using a deep learning model built with TensorFlow and Keras. This project provides an end-to-end pipeline for analyzing customer attributes, engineering features, training a model, and making predictionsβall interactively demonstrated within a Jupyter notebook.
Customer churn prediction aims to identify customers who are likely to leave (churn) a business. By anticipating churn, companies can proactively engage at-risk users and improve retention.
Key Steps:
- Data loading and inspection
- Feature engineering (including one-hot encoding)
- Data scaling (StandardScaler)
- Model building with Keras (Dense, Dropout layers)
- Training and evaluation (metrics, confusion matrix, ROC curve)
Interactive Demo:
See the Jupyter notebook: Customer_Churn_Prediction.ipynb
The notebook uses the Churn_Modelling.csv dataset.
Example features:
CreditScore,Geography,Gender,Age,Tenure,BalanceNumOfProducts,HasCrCard,IsActiveMember,EstimatedSalary- Target:
Exited(1 = churn, 0 = retained)
- Language: Python 3.x
- Data Manipulation: numpy, pandas
- Visualization: seaborn, matplotlib
- Deep Learning: tensorflow, keras
- Model:
Sequential,Dense,Dropout - Optimization:
Adam - Callbacks:
EarlyStopping
- Model:
pip install numpy pandas seaborn matplotlib tensorflow-
Download
Customer_Churn_Prediction.ipynbandChurn_Modelling.csvto the same directory. -
Launch Jupyter:
jupyter notebook # or jupyter lab -
Open the notebook and run cells sequentially.
- Fork this repo
- Create a new branch (
git checkout -b feature-branch) - Make your changes
- Commit and push
- Open a pull request
- End-to-end pipeline: Data cleaning β Feature engineering β Deep learning.
- Interactive visualizations: Data exploration and evaluation plots.
- Easy to extend: Modular code, well-commented.
- No missing values: Data integrity checks included.
- Customizable architecture: Quickly tune layers, activations, and callbacks.
- Dataset: Kaggle - Churn Modelling Dataset
- TensorFlow & Keras documentation
- Community tutorials on customer churn prediction
Q: Can I use my own data?
A: Yes! Just format your CSV file with similar columns and update the data loading cell in the notebook.
Q: How do I interpret the results?
A: The notebook explains model predictions with evaluation metrics and plots.
Feel free to open issues or contribute improvements!