22/08/2026
End-to-end Data Science & Machine Learning project: SaaS Customer Intelligence — Predictive Churn Modeling, Survival Analysis & LTV Forecasting.
In B2B SaaS, retaining customers is just as vital as acquiring them. This project transforms $121.9M ARR in enterprise telemetry into predictive churn intelligence, empirical retention drivers, and an interactive executive decision dashboard.
1. WHAT TYPE OF DATA DO WE HAVE?
We analyzed 500 B2B customer accounts across 6 core relational datasets:
-> 5,000 subscription & billing transaction cycles
-> 25,000 granular feature usage & error telemetry logs
-> 2,000 customer support tickets & CSAT ratings
-> Combined into a 32-column Master Customer 360 Feature Matrix
2. STEP-BY-STEP: HOW WE ANALYZED IT
-> Step 1: Data Modeling & Star Schema — Ingested 6 tables into an in-memory DuckDB warehouse with clean dimension & fact schemas.
-> Step 2: Feature Engineering — Engineered behavioral metrics: error rates per 100 events, support SLA first response minutes, session depth, feature adoption diversity, and MRR growth.
-> Step 3: Survival & Cohort Analysis — Fitted Kaplan-Meier survival curves S(t) and Cox Proportional Hazards regression; constructed a 24-month triangular retention heatmap.
-> Step 4: Machine Learning Churn Classification — Benchmarked XGBoost, Random Forest, and Logistic Regression with 5-Fold Stratified CV, evaluating ROC-AUC, Brier score calibration, and Gini feature importance.
-> Step 5: Statistical Driver Discovery & Forecasting — Ran OLS multiple regression on CSAT drivers and generated a 12-month forward ARR forecast ($144.3M projected).
3. HOW WE BUILT THE INTERACTIVE DASHBOARD
Using Python Streamlit and Plotly, we built an executive BI interface directly connected to DuckDB and our serialized ML model:
- Dynamic telemetry slicing across 5 industries, 3 plan tiers, and global markets
- Live "What-If" Churn Risk Simulator to predict real-time churn probability based on adjusted customer behavior
- Interactive cohort heatmaps, SLA benchmarks, and SQL workbench
4. KEY EMPIRICAL FINDINGS
- Product Reliability is #1: Error rate per 100 events is the top churn driver (7.39% importance).
- Support SLA Latency is #2: First response time accounts for 6.89% churn importance.
- Early Tenure Cliff: 62% of churn occurs between Months 3 & 6 post-onboarding.
- Best Model: XGBoost achieved 0.6160 ROC-AUC, 69.0% accuracy, and 0.1947 Brier score.
LIBRARIES & TECH STACK:
Python 3.10+, DuckDB, Pandas, NumPy, Scikit-Learn, XGBoost, Lifelines, Statsmodels, SciPy, Plotly, Streamlit, Seaborn, Matplotlib, Joblib.
GitHub Repository: https://github.com/HU8Trader
Kaggle Notebook : https://www.kaggle.com/code/himanshupadhyay/saas-executive-intelligence-analysis