--- license: mit --- # ๐Ÿฆ Bank Customer Churn Analysis ![Python](https://img.shields.io/badge/Python-3.8%2B-blue?style=for-the-badge&logo=python&logoColor=white) ![Pandas](https://img.shields.io/badge/Pandas-Data%20Analysis-150458?style=for-the-badge&logo=pandas&logoColor=white) ![Scikit-Learn](https://img.shields.io/badge/scikit--learn-Machine%20Learning-F7931E?style=for-the-badge&logo=scikit-learn&logoColor=white) ![Status](https://img.shields.io/badge/Status-Completed-success?style=for-the-badge) ## ๐ŸŽฅ Project Walkthrough (Video) Click the image below to watch the full explanation of the data analysis: [![Watch the Video](https://img.youtube.com/vi/Syatg5hxqLc/0.jpg)](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. ![Churn Rate by Geography](plot_geography_churn.png) > **๐Ÿ’ก 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. ![Age Distribution by Churn Status](plot_age_density.png) > **๐Ÿ’ก 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