RFM features log-transformed and scaled before clustering. PCA explains 95.1% of variance. Click a segment to see its profile and top products.
Segment explorer
PCA Cluster Scatter
800 sampled customers · PC1+PC2 = 95.1% variance
Revenue Share by Segment
Champions = 20% of customers → 65% of revenue
Churn Risk by Segment
Lost customers: 80% probability
Layer 3 · Random Forest · Time-Based Split · No Data Leakage
Churn Prediction Model
Predicts which customers will not purchase in the next 90 days. Trained on pre-Sep 2011 data; evaluated on the Sep–Dec 2011 holdout window.
ROC Curve
Random Forest AUC = 0.824
Confusion Matrix
Test set: 1,050 customers · holdout window
→ Predicted
↓ Actual
Retained
Churned
Feature importance & risk distribution
Top Churn Drivers
Recency dominates at 27.4% — how recently a customer purchased
Churn Risk Tiers
High (>65%) · Medium (35–65%) · Low (<35%)
Key Finding: Recency + Engagement = Churn Signal
The model identifies recency (27.4%) as the dominant churn predictor. Monetary value (13.2%) and active months (11.6%) are next. Champions churn at only 18.7% vs Lost at 80%. Target Medium-risk customers (35–65% probability) for highest expected return on retention spend — they're still reachable and have proven purchase history.
UCI Online Retail II · real UK gift-ware retailer · 2009–2011
Model Performance
All metrics on held-out test set — no data leakage
What Makes This Project Stand Out
Most analytics projects do one thing. This pipeline does four connected things: SQL-based RFM analysis feeds K-Means clustering; cluster labels enrich the churn model's features; churn scores inform retention priority; association rules produce per-segment recommendations. The time-based train/test split prevents data leakage — the most common mistake in student churn models that inflates accuracy to 99%+. Real performance on this dataset: 75.4% accuracy, 0.824 AUC.