This is my first attempt at predicting customer churn using a Deep Learning model built with TensorFlow & Keras. The dataset used is Churn_Modelling.csv, and the goal is to classify whether a customer will exit (churn) or stay with the bank.
- Built a Sequential Neural Network with TensorFlow/Keras
- Achieved ~80% accuracy
- Applied One-Hot Encoding & Feature Scaling
- Used ReLU & Sigmoid activations
- Trained for 100 epochs
The dataset consists of customer details, such as Geography, Gender, Credit Score, Balance, etc.
| Feature Name | Description |
|---|---|
| CreditScore | Customer's credit score |
| Geography | Country of residence |
| Gender | Male/Female |
| Age | Customer's age |
| Tenure | Years of account ownership |
| Balance | Account balance |
| NumOfProducts | Number of bank products used |
| HasCrCard | Whether the customer has a credit card |
| IsActiveMember | Whether the customer is active |
| EstimatedSalary | Estimated salary |
Exited(1 = Churn, 0 = No Churn)
# Build the neural network
model = Sequential([
Input(shape=(X_train.shape[1],)),
Dense(3, activation='relu'),
Dense(11, activation='relu'),
Dense(1, activation='sigmoid')
])- Optimizer: Adam
- Loss Function: Binary Crossentropy
- Epochs: 100
- Validation Split: 20%
- Accuracy on Test Set: ~80%
- Validation Accuracy fluctuated across epochs
- The model could be further optimized by adjusting layers, neurons, and hyperparameters.
✅ Hyperparameter Tuning (Neurons, Layers, Regularization, Dropout) ✅ Reduce Overfitting (Better architecture) ✅ Increase Accuracy (Aim for 85-90%)
📌 Neural networks require careful tuning to improve performance. 📌 Feature scaling & encoding are crucial for better training. 📌 Churn prediction can benefit from additional feature engineering.
📂 Churn_Prediction_DL
├── 📄 Churn_Modelling.csv
├── 📄 churn_prediction.ipynb
├── 📄 requirements.txt
├── 📄 README.md
To install dependencies, run:
pip install -r requirements.txttensorflow
keras
numpy
pandas
matplotlib
scikit-learn
I plan to improve this model with better hyperparameter tuning & architecture adjustments. Stay tuned for a follow-up post! 🎯
📌 Follow me on LinkedIn for updates! 😊

