File size: 3,842 Bytes
74f458f 13f5ff8 9348411 483d241 9348411 3e6d95f 0273a51 483d241 74f458f 13f5ff8 74f458f 9efcc7e 74f458f 9efcc7e 74f458f 9efcc7e 74f458f 9efcc7e 74f458f 9efcc7e 74f458f 9efcc7e 74f458f 9efcc7e 74f458f 9efcc7e 74f458f 9efcc7e 74f458f 9efcc7e f452209 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
---
license: mit
---
# π¦ Bank Customer Churn Analysis




## π₯ Project Walkthrough (Video)
Click the image below to watch the full explanation of the data analysis:
[](https://www.youtube.com/watch?v=Syatg5hxqLc)
> **In this video:** I explain the data cleaning process, outlier handling, and the key insights about customer churn.
---
## π Project Overview
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.
> **Context:** This work was completed as **Assignment 1** for the "Introduction to Data Science" course.
---
## π 1. The Dataset
**Dataset:** Bank Customer Churn (Kaggle)
**Target Variable:** `Exited` (1 = Churned, 0 = Stayed)
| Metric | Details |
| :--- | :--- |
| **Source** | `Churn_Modelling.csv` |
| **Size** | 10,000 Rows |
| **Key Features** | `CreditScore`, `Geography`, `Gender`, `Age`, `Tenure`, `Balance`, `NumOfProducts`, `EstimatedSalary` |
---
## π§Ή 2. Data Cleaning & Preprocessing
A rigorous cleaning process was applied to ensure data quality. Below are the **critical decisions** made during this phase:
* **β Dropping Irrelevants:** Columns `RowNumber`, `CustomerId`, and `Surname` were removed as they are unique identifiers with no predictive power.
* **β
Missing Values:** Confirmed 0 null values in the dataset.
* **β
Duplicates:** Confirmed 0 duplicate rows.
* **β οΈ Outlier Strategy:**
* **Decision:** Outliers were **KEPT**.
* **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.
* **βοΈ Feature Scaling:** Identified significant scale differences (e.g., `Balance` vs. `Age`). Applied `StandardScaler` to normalize features for model performance.
---
## π 3. Exploratory Data Analysis (EDA)
We focused on two main research questions to derive business insights.
### π Q1: Does geography impact the churn rate?
*Investigation:* Analyzing the proportion of churned customers across France, Germany, and Spain.

> **π‘ Insight:**
> 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.
### π΄ Q2: What is the relationship between Age and Churn?
*Investigation:* Using Kernel Density Estimation (KDE) to compare age distributions of retained vs. churned customers.

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