Update README.md
Browse files
README.md
CHANGED
|
@@ -10,4 +10,76 @@ metrics:
|
|
| 10 |
library_name: keras
|
| 11 |
tags:
|
| 12 |
- finance
|
| 13 |
-
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
library_name: keras
|
| 11 |
tags:
|
| 12 |
- finance
|
| 13 |
+
---
|
| 14 |
+
# 💰 Bank Churn Prediction — AI for Smarter Customer Retention
|
| 15 |
+
|
| 16 |
+
## 🧩 Overview
|
| 17 |
+
Businesses like banks which provide service have to worry about the problem of *Customer Churn* — i.e. customers leaving and joining another service provider.
|
| 18 |
+
It is important to understand which aspects of the service influence a customer's decision in this regard.
|
| 19 |
+
Management can concentrate efforts on improvement of service, keeping in mind these priorities.
|
| 20 |
+
|
| 21 |
+
**Objective**
|
| 22 |
+
You as a Data Scientist with the bank need to build a neural network–based classifier that can determine whether a customer will leave the bank or not in the next 6 months.
|
| 23 |
+
|
| 24 |
+
---
|
| 25 |
+
|
| 26 |
+
## 🤖 Model Details
|
| 27 |
+
- **Model Type:** Feed-forward ANN (Artificial Neural Network) — Binary Classifier
|
| 28 |
+
- **Framework:** TensorFlow / Keras
|
| 29 |
+
- **Dataset:** `Churn.csv` *(Bank Customer Churn Dataset, 10,000+ customers)*
|
| 30 |
+
- **Input:** Structured customer profile (credit score, age, balance, tenure, activity, salary, etc.)
|
| 31 |
+
- **Output:** Binary churn prediction (`0 = stays`, `1 = churn`)
|
| 32 |
+
|
| 33 |
+
---
|
| 34 |
+
|
| 35 |
+
## 📊 Data Dictionary
|
| 36 |
+
| Feature | Description |
|
| 37 |
+
|---------------------|----------------------------------------------------------------------------|
|
| 38 |
+
| `CustomerId` | Unique ID assigned to each customer |
|
| 39 |
+
| `Surname` | Customer’s last name |
|
| 40 |
+
| `CreditScore` | Customer credit history |
|
| 41 |
+
| `Geography` | Customer location |
|
| 42 |
+
| `Gender` | Gender of the customer |
|
| 43 |
+
| `Age` | Age of the customer |
|
| 44 |
+
| `Tenure` | Number of years with the bank |
|
| 45 |
+
| `NumOfProducts` | Number of bank products purchased |
|
| 46 |
+
| `Balance` | Account balance |
|
| 47 |
+
| `HasCrCard` | Whether the customer has a credit card |
|
| 48 |
+
| `EstimatedSalary` | Estimated salary |
|
| 49 |
+
| `IsActiveMember` | Whether the customer is an active member |
|
| 50 |
+
| `Exited` | Target label — 0: No (customer stays), 1: Yes (customer churns) |
|
| 51 |
+
|
| 52 |
+
---
|
| 53 |
+
|
| 54 |
+
## 🌟 Why It Matters
|
| 55 |
+
✅ Detects early signs of potential churn
|
| 56 |
+
✅ Enables targeted retention strategies
|
| 57 |
+
✅ Improves customer engagement and loyalty
|
| 58 |
+
✅ Helps maximize profitability and reduce attrition rates
|
| 59 |
+
|
| 60 |
+
📘 **Full Source Notebook:**
|
| 61 |
+
The complete training and evaluation notebook is available on GitHub:
|
| 62 |
+
👉 [View on GitHub](https://github.com/joyjitroy/Machine_Learning/blob/main/Bank_Customer_Churn_Prediction_using_Artificial_Neural_Networks.ipynb)
|
| 63 |
+
|
| 64 |
+
---
|
| 65 |
+
|
| 66 |
+
## 🚀 Example Usage
|
| 67 |
+
```python
|
| 68 |
+
from tensorflow.keras.models import load_model
|
| 69 |
+
import numpy as np
|
| 70 |
+
|
| 71 |
+
# Load trained model
|
| 72 |
+
model = load_model("bank_churn_model.h5")
|
| 73 |
+
|
| 74 |
+
# Example customer record (normalized)
|
| 75 |
+
# [CreditScore, Age, Tenure, Balance, NumOfProducts, HasCrCard, IsActiveMember, EstimatedSalary, Geography_Germany, Geography_Spain, Gender_Male]
|
| 76 |
+
sample = np.array([[600, 40, 3, 60000, 2, 1, 1, 50000, 0, 1, 1]])
|
| 77 |
+
|
| 78 |
+
# Get churn probability
|
| 79 |
+
pred = model.predict(sample)
|
| 80 |
+
print("Churn Probability:", pred[0][0])
|
| 81 |
+
|
| 82 |
+
if pred[0][0] > 0.5:
|
| 83 |
+
print("Prediction: Customer likely to churn")
|
| 84 |
+
else:
|
| 85 |
+
print("Prediction: Customer likely to stay")
|