πŸ“±
Scenario
Head of Retention, Safaricom Consumer

You work in the retention team at Safaricom, East Africa's largest mobile operator. It's mid-Q1, and the head of consumer products suspects churn is creeping up among prepaid subscribers. Leadership needs your answer by Thursday EOD:

  • Which segments are churning fastest?
  • What's driving the churn?
  • How much revenue is at risk?
  • What's your recommended intervention, and what's the ROI?

Your deliverable: A one-page executive brief with KPIs, a key chart, and a recommendation backed by the data.

8,012
Subscriber Records
21.9%
Overall Churn Rate
Q1 2024
Data Period

What You'll Build

Your Capstone Deliverable

Data quality audit: Load, inspect shape/types, identify missing data (1 chart).
Exploratory Deep Dive: Churn by plan, tenure curve (month-3 cliff), usage patterns (3 charts).
Segmentation & Drivers: RFM-style segments, correlation heatmap, cohort retention (2 charts).
Recommendation: Target high-risk segment (month 2–4, <1GB data) with a cost-effective intervention.
Executive Deliverable: One-page summary (cover + 4 KPIs + key chart + recommendation) ready for leadership.

Step 0: The Brief β€” Turn Business Questions into Analytics

Before you open your notebook, frame the problem. The business asks: "Why are customers leaving?" You turn that into:

  • Churn rate by segment: Which plan + region + tenure cohort has the worst retention?
  • Behavioral drivers: Does low data usage, high support friction, or short tenure predict churn?
  • Intervention hypothesis: If we boost data allowance for month 2–4 prepaid users, how many churn cases can we prevent? What's the payback?

This is the analytical frame that will guide your EDA, segmentation, and modeling.

Step 1: Load & Inspect β€” Know Your Data

Start by loading the 8,012-row Safaricom subscribers CSV. Your first job: understand the shape, types, and quality.

Step 1: Load & explore (from Lessons 4–7: Pandas Fundamentals) Run ↻
Output (first 5 rows and basic info)
Shape: (8012, 13) Data types: subscriber_id object region object plan object tenure_months int64 monthly_arpu_kes float64 data_gb_last_month float64 voice_mins_last_month float64 sms_last_month float64 support_tickets_90d int64 nps_last_survey float64 has_mpesa bool churned bool churn_date object Missing values: nps_last_survey 2389 (30%) All others: 0 Overall churn rate: 21.9%

Key observations: Your dataset has 8,012 rows, 13 columns, mostly complete except NPS (30% missingβ€”we'll impute). The target column churned is boolean. You have behavioral features (data, voice, SMS), plan type, tenure, region, and M-Pesa adoption.

Data Quality Heatmap: Missing Values Before Cleaning
Null heatmap showing NPS at 30% missing

Step 2: Clean β€” Prepare for Analysis

Data is 95% clean, but we'll handle missing NPS and prepare derived columns.

Step 2: Data cleaning (from Lessons 8–12: Data Wrangling & QA) Run ↻
Output
Cleaned dataset: Shape: (8012, 14) Missing: 0 Churn rate: 21.9%

Step 3: Explore β€” Uncover Patterns

Now dive into segmentation and distributions. We're hunting for the churn cliff and high-risk segments.

Step 3: Exploratory Data Analysis (from Lessons 13–17: EDA & Distributions) Run ↻
Output
=== CHURN RATES === Overall: 21.9% By Plan: Prepaid: 27.9% Postpaid Lite: 20.6% Postpaid Plus: 12.3% By Region (top 5): Nairobi: 24.8% Mombasa: 18.3% Kisumu: 19.4% Nakuru: 21.2% Eldoret: 22.1% Churn by Tenure Cohort (month 1–12): Month 1: 18% Month 2: 28% Month 3: 32% Month 4: 26% Month 5: 18% Month 6+: 16% Data Usage: <1 GB: 33.4% 1–2 GB: 19.2% 2+ GB: 8.1% M-Pesa Impact: With M-Pesa: 9.7% Without M-Pesa: 37.0%
Churn Rate by Plan (Prepaid leads at 27.9%)
Bar chart: Prepaid 27.9%, Postpaid Lite 20.6%, Postpaid Plus 12.3%
The Prepaid plan has 2.3Γ— the churn rate of Postpaid Plus. Month 2–4 tenure shows a striking cliff, with month 3 hitting 32% churn (vs 16% for month 6+). This is the onboarding cliff: new prepaid users often churn within 90 days of signup.
Tenure Churn Curve: The Onboarding Cliff (month 3 peak)
Line chart showing churn peaking at month 3
Data Usage Distribution: Churned vs Retained
Histogram showing churned customers use much less data
Customers who churned averaged 0.2 GB/month; retained users averaged 1.8 GB/month. Low data usage (<1 GB) predicts 3.3Γ— churn odds. This is your biggest behavioral signal.

Step 4: Analyze β€” Segmentation & Drivers

Move from exploration to segmentation and correlation. Build your analytical model.

4.1 Cohort Retention Analysis

Recall Lesson 19 (Cohort Analysis): Track how monthly acquisition cohorts retain over time.

Cohort retention by acquisition month (from Lesson 19: Cohort Analysis) Run ↻
Output
Cohort Retention Summary: acq_month churned_count total retention_rate 2023-09 8.0 42 0.81 2023-10 14.0 51 0.73 2023-11 18.0 58 0.69 2023-12 22.0 67 0.67 2024-01 36.0 142 0.75 2024-02 67.0 278 0.76
Cohort Retention Matrix: Monthly acquisition cohorts Γ— age in months
Heatmap showing retention declining from acquisition month

4.2 RFM-Style Segmentation

Segment customers by Recency (tenure), Frequency (data usage), and Monetary (ARPU). Identify your Champions, At-Risk, New, and Dormant segments.

RFM segmentation (from Lesson 20: RFM Segmentation) Run ↻
Output
Segment Profile & Churn Rates: Champions: Count: 1203 | Churn: 8.2% | Avg ARPU: 1245 KES | Avg Data: 2.8 GB At-Risk: Count: 2156 | Churn: 38.7% | Avg ARPU: 680 KES | Avg Data: 0.4 GB New: Count: 1875 | Churn: 29.4% | Avg ARPU: 650 KES | Avg Data: 1.1 GB Dormant: Count: 2778 | Churn: 16.3% | Avg ARPU: 680 KES | Avg Data: 1.2 GB
RFM Segments: ARPU vs Data Usage (Colors show segment membership)
Scatter plot: ARPU vs data usage, colored by segment

4.3 Feature Correlation with Churn

Which features most strongly correlate with churn? Use Lesson 22 (Correlation & Covariance).

Correlation analysis (from Lesson 22: Correlation & Causation) Run ↻
Output
Feature Correlations with Churn: data_gb_last_month............... -0.348 support_tickets_90d.............. +0.215 tenure_months.................... -0.156 monthly_arpu_kes................. -0.124 voice_mins_last_month............ -0.089 sms_last_month................... -0.042
Correlation Heatmap: Features vs Churn
Heatmap showing data usage has strongest negative correlation
Data usage is the strongest predictor (r = βˆ’0.35). Support tickets also predict churn (r = +0.22). Long tenure protects against churn (r = βˆ’0.16). These align with business intuition: engaged users stay; struggling or new users leave.

4.4 Logistic Regression for Churn Prediction

Build a simple logistic regression to quantify churn drivers. (Lesson 24: Regression fundamentals applies; this extends to classification.)

Logistic regression model (from Lessons 23–24: Regression + Classification intro) Run ↻
Output
Logistic Regression Coefficients: data_gb_last_month.............. -0.832 ↓ churn (strong protector) support_tickets_90d............. +0.456 ↑ churn (strong driver) tenure_months................... -0.287 ↓ churn nps_last_survey................. -0.156 ↓ churn has_mpesa....................... -0.623 ↓ churn (strong protector) monthly_arpu_kes................. -0.041 ↓ churn Model Performance (AUC-ROC): Train AUC: 0.750 Test AUC: 0.738
The model confirms: Data usage and M-Pesa adoption strongly protect against churn (negative coefficients). Support tickets and churn risk (positive coefficient). Your model has an AUC of 0.74, meaning it separates churners from retained users reasonably well.

Step 5: Ship β€” The Executive Deliverable

Translate your analysis into a one-page exec brief. This is Lesson 28 (Notebook to Report) in practice: clarity, brevity, recommendation.

Executive Deliverable: One-Page Churn Analysis Summary
One-page exec summary with KPIs and recommendation
Generate the executive summary (from Lesson 28: Notebook to Report) Run ↻
Output
EXECUTIVE BRIEF ============================================================ Safaricom Subscriber Churn Analysis Executive Summary: Q1 Churn Drivers & Retention Opportunity KEY METRICS: β€’ Overall Churn Rate........................ 21.9% (vs 15% target) β€’ At-Risk Subscribers...................... 1,755 (27.9% prepaid churners) β€’ Revenue @Risk....................... KES 45M (annual if trend continues) β€’ Campaign NPV......................... KES +12M (targeting onboarding cliff) KEY FINDING: Onboarding Cliff Month 2–4 subscribers show 1.5Γ— baseline churn (peak 32% in month 3). Low data users (<1GB) have 3.2Γ— churn odds. M-Pesa adoption cuts churn by 75%. RECOMMENDATION: Action: Target month 2–4 prepaid subscribers with <1GB usage with 1GB free data + KES 50 incentive (total cost ~KES 12M for 240k users). Expected: Rescue 38% of at-risk cohort (913 users). Payback: 90 days. NPV: KES +12M (vs 0 baseline). Confidence: high (correlation with data usage is r = βˆ’0.35).

Skills You've Demonstrated

Each step of the capstone maps back to a lesson in the track. You've now done a complete analysis cycle:

Step Skill Lessons
Load Read CSV, inspect shape, dtypes, .describe() 4–7
Clean Handle missing data, coerce types, outlier caps, derived features 8–12
Explore Groupby, distributions, segmentation, correlation 13–17
Analyse Cohort retention, RFM segmentation, logistic regression, feature importance 18–24
Ship Compose KPI cards, charts, exec brief, narrative clarity 25–28

Interview Talking Points

When a hiring manager asks "Tell me about a data analysis project you've done," use this capstone. Here's your 90-second pitch:

"I ran a churn analysis on 8,000 prepaid and postpaid subscribers from a large African telecom. The business wanted to know which segments were leaving and why. I loaded and cleaned the data, then explored patterns across tenure, data usage, and plan type. I found a striking onboarding cliff in months 2–4, plus a 3.2Γ— churn multiplier for low-data users. I built an RFM segmentation and a logistic regression model (AUC 0.74) to rank feature importance. Data usage and M-Pesa adoption were strong churn preventors. My recommendation was to target month 2–4 prepaid users with a low-cost data boost, which would rescue 38% of the at-risk cohort and deliver KES +12M NPV. I delivered a one-page executive brief with KPI cards and charts, which landed with leadership."

That story demonstrates: business acumen, SQL/Python, EDA, segmentation, modeling, and communication. It's a complete portfolio piece.

Common Capstone Pitfalls

  • Overfitting on a story: Don't cherry-pick a narrative. Let the data lead. (Here, the onboarding cliff emerged from groupby + visualization, not hypothesis-first.)
  • Ignoring tenure confound: If you compare month 3 to month 6, you're mixing a cohort effect with an age effect. Use acquisition cohorts and age-in-cohort to decouple.
  • Pitching without ROI: "We should reduce churn" is nice. "Target cohort X, cost Y, save Z, NPV = W" wins budget.
  • Skipping the one-pager: A 50-cell spreadsheet is not a deliverable. Compress to a one-page brief with 4–5 KPIs and a single killer chart.
  • Hiding assumptions: State them: "I imputed NPS with the median because 30% was missing and no external signal existed." Transparency builds trust.
1/8
Test your understanding
What is the approximate churn rate for prepaid subscribers in this dataset?
12.3%
21.9%
27.9%
37%
In which month does the churn rate peak (the onboarding cliff)?
Month 1
Month 3
Month 6
Month 12
By what factor does M-Pesa adoption reduce churn?
2Γ—
3.2Γ—
3.8Γ—
10Γ—
What is the strongest predictor of churn in the logistic regression model?
Tenure (months)
Data usage (GB)
ARPU (KES)
SMS count
The recommended intervention targets which segment?
Postpaid Plus customers with high data usage
Prepaid, month 2–4, <1GB data
All Dormant customers
High-NPS customers
What is the projected NPV of the recommended campaign?
KES βˆ’5M
KES +12M
KES +45M
KES 0
Which method did you use to identify customer segments?
RFM (Recency, Frequency, Monetary)
K-means clustering
Random forest feature importance
PCA (Principal Component Analysis)
What is the test AUC of the logistic regression model?
0.50
0.65
0.738
0.95
Africa & India's Best AI Academy
πŸ€– AI-first πŸŽ“ Placement Assistance

You've built a capstone.
Now launch your analytics career.

Join the Best AI Program: The AI-Era Analyst β€” 5 months, fully online, with placement assistance. Week 1 is free.

Explore The AI-Era Analyst β†’