Globe Bank International — Customer Retention Analysis

Python Portfolio Project | End-to-End Customer Churn Analysis

🎯 The Challenge

Banks face a costly and persistent problem: customers leave without warning. As a retention manager, you might only see monthly reports that arrive too late. Key questions include:

  • Which customers are most likely to churn next month?
  • Are certain demographic groups leaving at higher rates?
  • What behaviours distinguish churned customers from retained ones?
  • Where should the retention budget be prioritised for maximum impact?

This was the business problem I set out to solve.

💡 My Solution

I built a four-stage Python analysis pipeline that transforms raw customer data into actionable retention insights. The solution moves from data exploration to polished dashboards and prioritised recommendations — demonstrating a full analytical workflow.


📊 Project Architecture

Stage 1 — Setup and Exploration

Notebook: 01_setup_exploration.ipynb

  • Loaded 10,127 customer records across 23 raw columns
  • Dropped 2 Naive Bayes classifier columns and the CLIENTNUM identifier
  • Confirmed zero missing values and duplicates
  • Encoded Attrition_Flag (0 = Retained, 1 = Churned)
  • Visualised churn distribution, numeric histograms, and categorical breakdowns

Key finding: 16.1% churn rate — 1,627 customers left out of 10,127.


Stage 2 — Cleaning and Transformation

Notebook: 02_cleaning_transformation.ipynb

Encoding applied:

Column Method Detail
Attrition_Flag Binary Existing Customer = 0, Attrited Customer = 1
Education_Level Ordinal Uneducated (0) → Doctorate (6)
Income_Category Ordinal < $40K (0) → $120K+ (5)
Card_Category Ordinal Blue (0) → Platinum (3)
Gender Binary M = 1, F = 0
Marital_Status One-hot Dummy variables, drop first

Features engineered:

Feature Meaning
Trans_Freq_Ratio Transaction activity relative to tenure
Inactivity_Rate Proportion of year spent inactive
Contact_Intensity Contact frequency relative to tenure
Utilisation_Band Utilisation ratio binned: Very Low / Low / Medium / High

Output: data/processed/bank_churners_clean.csv — 10,127 rows × 30 columns


Stage 3 — Analysis and Insights

Notebook: 03_analysis_insights.ipynb

Techniques used:

  1. Correlation Analysis — Total_Trans_Ct, Total_Trans_Amt, and Trans_Freq_Ratio predict retention; Months_Inactive_12_mon and Contacts_Count_12_mon predict churn
  2. Churn by Demographics — Platinum card holders churn most (25.0%); differences across gender, income, education and marital status are smaller (13.5%–21.1%)
  3. Statistical Comparisons — Welch’s t-tests with Cohen’s d for numeric features
  4. Random Forest Feature Importance

Top 5 churn predictors:

Rank Feature Importance
1 Total_Trans_Amt 17.7%
2 Total_Trans_Ct 14.5%
3 Total_Ct_Chng_Q4_Q1 11.2%
4 Total_Revolving_Bal 10.5%
5 Total_Relationship_Count 7.5%

Insight: Transaction behaviour dominates churn prediction over demographics.

Top 10 churn drivers from Random Forest feature importance

Transaction amount, transaction count and the Q4–Q1 change in transaction count are the three strongest predictors, together accounting for 43.4% of the model’s feature importance.

Top 10 features by effect size (Cohen's d), churned vs retained customers

Total transaction count shows the largest difference between the groups (Cohen’s d about −1.1, higher in retained customers), while contact frequency and inactivity are higher among churned customers.


Stage 4 — Visualisation and Storytelling

Notebook: 04_visualisation_storytelling.ipynb

Outputs:

Output Description
Executive Dashboard KPI cards, churn split, transaction comparison, distribution charts
Top Churn Drivers Chart Ranked horizontal bar chart with colour-coded importance
Demographic Breakdown Interactive Plotly and static PNGs
Recommendations Card Prioritised business actions in a visual card

🗂️ Project Structure

globe-bank-retention-analysis/
├── data/
│   ├── raw/
│   └── processed/
├── notebooks/
│   ├── 01_setup_exploration.ipynb
│   ├── 02_cleaning_transformation.ipynb
│   ├── 03_analysis_insights.ipynb
│   └── 04_visualisation_storytelling.ipynb
├── outputs/
│   ├── figures/
│   └── reports/
├── .gitignore
├── README.md
└── requirements.txt

🛠️ Tools and Libraries

Category Tools
Language Python 3.13
Data manipulation pandas, numpy
Visualisation matplotlib, seaborn, Plotly
Statistical analysis scipy (Welch’s t-test, Cohen’s d)
Machine learning scikit-learn (Random Forest)
Environment Jupyter Notebook, VS Code

💡 Business Recommendations

Priority Finding Recommended Action
HIGH 🔴 Low transaction activity Trigger automated re-engagement campaigns when transaction count drops below the 3-month rolling average
HIGH 🔴 Inactive customers churn Implement 60-day inactivity alerts with personal outreach
MEDIUM 🟠 Fewer bank products Cross-sell complementary products to single-product customers
MEDIUM 🟠 High contact frequency Flag customers with 3+ contacts in 12 months for proactive satisfaction review
LOW 🟡 Platinum card holders churn most (25.0%) Review card benefits and product fit for Platinum holders

🎓 Reflections and Key Takeaways

Technical lessons:

  • Transaction behaviour dominates demographic features
  • Effect size matters as much as p-values
  • Feature engineering captures real behavioural patterns

Design lessons:

  • Storytelling is separate from analysis
  • Consistent visual design builds trust

Process lessons:

  • Working notebook by notebook keeps complexity manageable
  • Clear structure and documentation make the analysis easy to review and reproduce

📂 Project Resources


📧 Let’s Connect

Built with Python 3.13 pandas matplotlib seaborn Plotly scikit-learn Jupyter VS Code
Project Duration: March 2026 Status: Complete and Portfolio-Ready            

2026

Back to Top ↑

2025

Sales Insights

SQL analysis of sales and customer data for H+ Sport, a fictitious nutrition and activewear company, focusing on mineral water sales and data accuracy.

Healthcare Insights

SQL analysis of a hospital database covering patient demographics, hospital stays, outpatient visits, lab results and risk factors to support hospital operat...

Back to Top ↑