MatanYehudaDataAnalyst commited on
Commit
9efcc7e
Β·
verified Β·
1 Parent(s): 1557a10

Update README.me

Browse files
Files changed (1) hide show
  1. README.me +44 -40
README.me CHANGED
@@ -1,69 +1,73 @@
1
  ---
2
  license: mit
3
  ---
 
 
4
 
5
- # Project: Bank Customer Churn Analysis
 
 
 
6
 
7
- This project is an end-to-end data science analysis of a bank customer dataset. The goal is to understand the factors that lead to customer churn (leaving the bank) and to build a predictive model.
 
8
 
9
- This work was completed as part of the "Introduction to Data Science" course.
10
 
11
  ---
12
 
13
- ## 1. The Dataset: Bank Customer Churn
 
 
14
 
15
- * **Source:** Kaggle (`Churn_Modelling.csv`)
16
- * **Size:** 10,000 rows (customers)
17
- * **Key Features:** `CreditScore`, `Geography`, `Gender`, `Age`, `Tenure`, `Balance`, `NumOfProducts`, `IsActiveMember`, `EstimatedSalary`.
18
- * **Target Variable:** `Exited` (1 = Churned, 0 = Stayed).
 
19
 
20
  ---
21
 
22
- ## 2. Data Cleaning & Decisions
 
23
 
24
- A full data cleaning process was performed. Here are the key decisions:
25
-
26
- 1. **Irrelevant Columns:** Dropped `RowNumber`, `CustomerId`, and `Surname` as they are unique identifiers and not predictive features.
27
- 2. **Missing Values:** No missing values (NaN) were found in the dataset.
28
- 3. **Duplicate Entries:** No duplicate rows were found.
29
- 4. **Outlier Handling (Decision):** Outliers were **KEPT**.
30
- * **Justification:** In a churn problem, outliers (e.g., very high `Age` or very low `CreditScore`) are often valid and highly informative data points. A 90-year-old customer is a real customer, and their behavior is important to model. Removing them would bias the model and lose valuable insights.
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. Research Questions & Visual Insights
36
-
37
- We posed two key questions to understand churn behavior.
38
 
39
- ### Question 1: Does geography impact the churn rate?
 
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
  ![Churn Rate by Geography](plot_geography_churn.png)
45
 
46
- **Answer & Insight:**
47
- Yes, geography has a clear impact. From the plot, we can see that while France has the most customers, **Germany has a visibly higher proportion of churned customers** compared to France and Spain. This suggests that the bank's operations or competition in Germany may be leading to higher customer dissatisfaction.
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
  ![Age Distribution by Churn Status](plot_age_density.png)
57
 
58
- **Answer & Insight:**
59
- Age is a major factor.
60
- * The 'Stayed' (0) customers show a large peak around **30-40 years old**.
61
- * The 'Churned' (1) customers show a distinct, separate peak around **45-55 years old**.
62
- * **Decision:** This insight is critical. It identifies a high-risk demographic (middle-aged customers) that the bank should target with retention campaigns.
63
 
64
  ---
65
 
66
- ## 4. Project Files
 
 
 
 
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
+ ![Python](https://img.shields.io/badge/Python-3.8%2B-blue?style=for-the-badge&logo=python&logoColor=white)
8
+ ![Pandas](https://img.shields.io/badge/Pandas-Data%20Analysis-150458?style=for-the-badge&logo=pandas&logoColor=white)
9
+ ![Scikit-Learn](https://img.shields.io/badge/scikit--learn-Machine%20Learning-F7931E?style=for-the-badge&logo=scikit-learn&logoColor=white)
10
+ ![Status](https://img.shields.io/badge/Status-Completed-success?style=for-the-badge)
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
  ![Churn Rate by Geography](plot_geography_churn.png)
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
  ![Age Distribution by Churn Status](plot_age_density.png)
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