Update README.me
Browse files
README.me
CHANGED
|
@@ -1,69 +1,73 @@
|
|
| 1 |
---
|
| 2 |
license: mit
|
| 3 |
---
|
|
|
|
|
|
|
| 4 |
|
| 5 |
-
|
|
|
|
|
|
|
|
|
|
| 6 |
|
| 7 |
-
|
|
|
|
| 8 |
|
| 9 |
-
This work was completed as
|
| 10 |
|
| 11 |
---
|
| 12 |
|
| 13 |
-
## 1. The Dataset
|
|
|
|
|
|
|
| 14 |
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
|
|
|
| 19 |
|
| 20 |
---
|
| 21 |
|
| 22 |
-
## 2. Data Cleaning &
|
|
|
|
| 23 |
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
5. **Scaling Issues (Identification):** Numeric features (`Balance`, `Age`, `EstimatedSalary`) were identified as having vastly different scales. This was addressed during preprocessing (after the train-test split) using `StandardScaler`.
|
| 32 |
|
| 33 |
---
|
| 34 |
|
| 35 |
-
## 3.
|
| 36 |
-
|
| 37 |
-
We posed two key questions to understand churn behavior.
|
| 38 |
|
| 39 |
-
###
|
|
|
|
| 40 |
|
| 41 |
-
To answer this, we visualized the count of churned vs. stayed customers across the three countries in the dataset.
|
| 42 |
-
|
| 43 |
-
**Visualization:**
|
| 44 |

|
| 45 |
|
| 46 |
-
|
| 47 |
-
|
| 48 |
|
| 49 |
-
|
|
|
|
| 50 |
|
| 51 |
-
### Question 2: What is the relationship between customer age and the decision to churn?
|
| 52 |
-
|
| 53 |
-
We used a Kernel Density Plot (KDE) to visualize the age distribution for customers who stayed versus those who churned.
|
| 54 |
-
|
| 55 |
-
**Visualization:**
|
| 56 |

|
| 57 |
|
| 58 |
-
|
| 59 |
-
Age is a
|
| 60 |
-
*
|
| 61 |
-
*
|
| 62 |
-
* **
|
| 63 |
|
| 64 |
---
|
| 65 |
|
| 66 |
-
##
|
|
|
|
|
|
|
|
|
|
|
|
|
| 67 |
|
| 68 |
-
* **Jupyter Notebook:** `Your_Notebook_Name.ipynb` (Change this to your .ipynb file name)
|
| 69 |
-
* **Dataset:** `Churn_Modelling.csv`
|
|
|
|
| 1 |
---
|
| 2 |
license: mit
|
| 3 |
---
|
| 4 |
+
## WATCH THE VIDEO HERE - (https://www.youtube.com/watch?v=Syatg5hxqLc)
|
| 5 |
+
# π¦ Bank Customer Churn Analysis
|
| 6 |
|
| 7 |
+

|
| 8 |
+

|
| 9 |
+

|
| 10 |
+

|
| 11 |
|
| 12 |
+
## π Project Overview
|
| 13 |
+
This project is an **end-to-end data science analysis** of a bank customer dataset. The primary objective is to investigate the factors contributing to customer attrition (churn) and to identify patterns that distinguish customers who leave from those who stay.
|
| 14 |
|
| 15 |
+
> **Context:** This work was completed as **Assignment 1** for the "Introduction to Data Science" course.
|
| 16 |
|
| 17 |
---
|
| 18 |
|
| 19 |
+
## π 1. The Dataset
|
| 20 |
+
**Dataset:** Bank Customer Churn (Kaggle)
|
| 21 |
+
**Target Variable:** `Exited` (1 = Churned, 0 = Stayed)
|
| 22 |
|
| 23 |
+
| Metric | Details |
|
| 24 |
+
| :--- | :--- |
|
| 25 |
+
| **Source** | `Churn_Modelling.csv` |
|
| 26 |
+
| **Size** | 10,000 Rows |
|
| 27 |
+
| **Key Features** | `CreditScore`, `Geography`, `Gender`, `Age`, `Tenure`, `Balance`, `NumOfProducts`, `EstimatedSalary` |
|
| 28 |
|
| 29 |
---
|
| 30 |
|
| 31 |
+
## π§Ή 2. Data Cleaning & Preprocessing
|
| 32 |
+
A rigorous cleaning process was applied to ensure data quality. Below are the **critical decisions** made during this phase:
|
| 33 |
|
| 34 |
+
* **β Dropping Irrelevants:** Columns `RowNumber`, `CustomerId`, and `Surname` were removed as they are unique identifiers with no predictive power.
|
| 35 |
+
* **β
Missing Values:** Confirmed 0 null values in the dataset.
|
| 36 |
+
* **β
Duplicates:** Confirmed 0 duplicate rows.
|
| 37 |
+
* **β οΈ Outlier Strategy:**
|
| 38 |
+
* **Decision:** Outliers were **KEPT**.
|
| 39 |
+
* **Justification:** In churn analysis, extreme values (e.g., older age, high balance) are often the most informative. Removing a 90-year-old customer would result in losing valid behavioral data for that demographic.
|
| 40 |
+
* **βοΈ Feature Scaling:** Identified significant scale differences (e.g., `Balance` vs. `Age`). Applied `StandardScaler` to normalize features for model performance.
|
|
|
|
| 41 |
|
| 42 |
---
|
| 43 |
|
| 44 |
+
## π 3. Exploratory Data Analysis (EDA)
|
| 45 |
+
We focused on two main research questions to derive business insights.
|
|
|
|
| 46 |
|
| 47 |
+
### π Q1: Does geography impact the churn rate?
|
| 48 |
+
*Investigation:* Analyzing the proportion of churned customers across France, Germany, and Spain.
|
| 49 |
|
|
|
|
|
|
|
|
|
|
| 50 |

|
| 51 |
|
| 52 |
+
> **π‘ Insight:**
|
| 53 |
+
> Geography is a strong predictor. While France has the highest volume of customers, **Germany exhibits a significantly higher churn rate**. This suggests potential issues with local competition, customer service, or market fit specifically in the German region.
|
| 54 |
|
| 55 |
+
### π΄ Q2: What is the relationship between Age and Churn?
|
| 56 |
+
*Investigation:* Using Kernel Density Estimation (KDE) to compare age distributions of retained vs. churned customers.
|
| 57 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 58 |

|
| 59 |
|
| 60 |
+
> **π‘ Insight:**
|
| 61 |
+
> Age is a critical factor.
|
| 62 |
+
> * **Stayed (0):** Peak distribution around **30-40 years old**.
|
| 63 |
+
> * **Churned (1):** Distinct peak around **45-55 years old**.
|
| 64 |
+
> * **Action Item:** The bank is losing its mature, middle-aged customer base. Retention campaigns should specifically target the 45-60 age demographic.
|
| 65 |
|
| 66 |
---
|
| 67 |
|
| 68 |
+
## π οΈ Tech Stack
|
| 69 |
+
* **Language:** Python
|
| 70 |
+
* **Libraries:** Pandas, Matplotlib, Seaborn, Scikit-learn
|
| 71 |
+
* **Environment:** Jupyter Notebook
|
| 72 |
+
|
| 73 |
|
|
|
|
|
|