Customer Churn Prevention Initiative

Driving Revenue Protection Through Predictive Analytics
S
Situation

We were losing valuable customers without warning, directly impacting our bottom line and growth trajectory. The challenge was clear: our customer data lived in disconnected systems, making it nearly impossible to spot at-risk accounts before they left.

  • Customer information scattered across multiple platforms meant we couldn't see the full picture of customer health
  • Missing or incomplete data created blind spots in understanding customer behavior and satisfaction
  • Only 3-5% of customers churned, but without early warning signals, we couldn't intervene in time to save these relationships
  • Our retention team was working reactively rather than proactively, often discovering churn only after it was too late
T
Task

My mission was to build an intelligent early-warning system that would identify at-risk customers before they churned, giving our team the runway needed to save these valuable relationships and protect revenue.

  • Transform fragmented customer data into actionable intelligence our team could actually use
  • Develop reliable predictions despite dealing with incomplete information and rare churn events
  • Deliver accurate enough insights to justify dedicated retention investments and guide strategic decisions
  • Make the system practical and easy for our customer success team to integrate into their daily workflows
A
Action

Building a Unified Customer Intelligence Platform:

  • Connected and consolidated customer data from sales, billing, and product usage systems into a single source of truth
  • Developed smart strategies to handle missing information without losing critical insights about customer behavior
  • Created meaningful indicators of customer health, including engagement patterns, usage trends, and value metrics that predict future behavior
  • Identified the most predictive signals of churn by analyzing patterns across thousands of customer journeys

Developing the Predictive Intelligence Engine:

  • Built a machine learning model specifically tuned to catch at-risk customers while minimizing false alarms
  • Rigorously tested the system to ensure consistent, reliable predictions across diverse customer segments
  • Fine-tuned the model to balance catching the most churners while keeping the team's workload manageable
  • Measured success using business-relevant metrics that align with revenue protection goals, not just technical accuracy

Deploying a Practical, Scalable Solution:

  • Implemented the system into production with robust tracking and version control for continuous improvement
  • Automated daily customer scoring to provide fresh, actionable insights every morning for the retention team
  • Created dashboards to monitor system performance and ensure prediction quality remains high over time
  • Ran controlled experiments to measure the real-world impact of retention campaigns guided by the predictions
R
Results

Measurable Business Impact:

15%
Churn Reduction
82%
Alert Precision
5:1
Return on Investment
40%
Efficiency Gain
System Performance Metrics
82%
Alert
Precision
78%
At-Risk Customer
Identification Rate
89%
Ranking Quality
(AUC-PR)
80%
Balanced Score
(F1)

Revenue Protection & Growth:

  • Saved 15% more customers through targeted retention efforts guided by the predictive system, verified through rigorous A/B testing over three months
  • Provided 1-2 weeks advance notice before customers were likely to leave, giving the team critical time to intervene with personalized outreach
  • Made our retention team 40% more efficient by focusing their efforts on customers who truly needed attention, rather than spraying resources broadly
  • Generated $5 in retained revenue for every $1 spent on retention campaigns, proving the business case for data-driven customer retention

Organizational Impact:

  • Transformed our approach from reactive firefighting to proactive relationship management
  • Empowered customer success teams with daily actionable insights, not just historical reports
  • Established a repeatable framework for using data to drive business decisions and protect revenue
  • Created a scalable system that automatically processes 500,000+ customer records daily without manual intervention

Customer Churn Prediction System

End-to-End ML Pipeline for Retention Analytics
S
Situation

The organization faced significant technical challenges in operationalizing churn prediction:

  • High missingness rates across critical features: 20-30% null values in engagement metrics, 15-25% in billing attributes, and sporadic gaps in product telemetry data
  • Heterogeneous data sources with schema inconsistencies: Salesforce CRM, Stripe billing, Segment event streams, and internal PostgreSQL databases requiring complex joins and transformations
  • Severe class imbalance with churn rate of 3-5% (1:19 to 1:31 positive-to-negative ratio), making standard classification approaches ineffective
  • No existing ML infrastructure for model training, versioning, deployment, or monitoring—requiring ground-up development
  • Temporal data leakage risks due to asynchronous data updates and varying latency across source systems
T
Task

Design and deploy a production-grade ML system capable of:

  • Ingesting and harmonizing data from disparate sources with varying schemas, update frequencies, and quality profiles
  • Handling missing data intelligently without introducing bias or significantly degrading feature informativeness
  • Achieving strong performance on imbalanced classification with optimization for both precision (minimize wasted outreach) and recall (maximize churn capture)
  • Meeting latency requirements for batch scoring (nightly runs) and potential near-real-time inference (<100ms p95)
  • Supporting model iteration, A/B testing, monitoring, and automated retraining workflows
A
Action

Data Engineering & Feature Pipeline:

  • Built ETL pipelines using Python (pandas, PySpark for large datasets) and SQL to extract from Salesforce API, Stripe webhooks, and event streams, then loaded into a centralized feature store (PostgreSQL with TimescaleDB extension)
  • Implemented point-in-time correctness using temporal joins to prevent data leakage—ensured all features reflect information available at prediction time
  • Applied multiple imputation strategies:
    • MICE (Multivariate Imputation by Chained Equations) for continuous engagement metrics
    • Mode imputation with missingness indicators for categorical attributes
    • Forward-fill with decay for temporal features like last login date
    • Created explicit "missing" flags as features to capture information in the missingness itself
  • Engineered 120+ features including:
    • RFM features (recency, frequency, monetary value) with multiple time windows (7d, 30d, 90d)
    • Behavioral trend indicators: engagement velocity, feature adoption curves, support ticket sentiment scores
    • Interaction terms (e.g., plan_tier × usage_rate) and ratio features (e.g., actual_usage / expected_usage)
    • Temporal aggregations: rolling means, standard deviations, percentile changes
  • Implemented feature selection using mutual information, SHAP values, and recursive feature elimination to reduce to 45 core features

Modeling & Optimization:

  • Selected XGBoost after benchmarking against Random Forest, LightGBM, and Neural Networks—XGBoost showed best precision-recall tradeoff and feature interpretability
  • Addressed class imbalance using:
    • Scale_pos_weight parameter set to negative/positive class ratio (~20:1)
    • Custom objective function with asymmetric loss (FP cost = 1, FN cost = 5 based on business value)
    • Threshold optimization via precision-recall curve analysis (selected threshold 0.35 vs default 0.5)
  • Used stratified 5-fold cross-validation with temporal splitting (train on months 1-10, validate on month 11) to ensure no future information leakage
  • Hyperparameter tuning with Optuna (Bayesian optimization):
    • Optimized learning_rate, max_depth, min_child_weight, subsample, colsample_bytree
    • Custom objective: maximize F1-score subject to precision ≥ 0.80 constraint
    • 100 trials with early stopping based on validation F1
  • Evaluation metrics: AUC-PR (more informative than AUC-ROC for imbalanced data), F1-score, precision@k, recall@k, and custom business metric (expected value of intervention)

Deployment & MLOps:

  • Model versioning and tracking with MLflow: logged hyperparameters, metrics, artifacts, and model signatures for reproducibility
  • Containerization using Docker with multi-stage builds (separate training and inference images) for portability and consistency across environments
  • Orchestration via Apache Airflow:
    • Daily scoring DAG: data extraction → feature generation → model inference → result storage → notification
    • Weekly monitoring DAG: drift detection, performance evaluation, alert generation
    • Monthly retraining DAG: data extraction → preprocessing → model training → evaluation → conditional deployment
  • Inference optimization:
    • Model serialization using joblib and ONNX for faster loading (reduced cold start from 3s to 200ms)
    • Batch prediction vectorization achieving <50ms p95 latency for single predictions
    • Feature caching layer using Redis for frequently accessed customer profiles
  • Monitoring & observability:
    • Prediction drift tracking via PSI (Population Stability Index) on score distributions
    • Feature drift detection using KL divergence between training and production feature distributions
    • Performance degradation monitoring via delayed label feedback (tracked actual churn 30 days post-prediction)
    • Grafana dashboards displaying real-time inference volume, latency percentiles, error rates, and drift metrics
    • PagerDuty integration for critical alerts (drift exceeds threshold, performance drops, pipeline failures)
  • A/B testing framework:
    • Randomized 50/50 split of predicted churners into treatment (received intervention) and control (no intervention)
    • Tracked conversion rates, retention lifts, and statistical significance using two-proportion z-test
    • Implemented guardrail metrics to ensure no negative impact on non-targeted customers
R
Results

Model Performance Metrics:

82%
Precision (PPV)
78%
Recall (TPR)
0.89
AUC-PR
0.80
F1-Score
Classification Performance (Held-out Test Set)
82%
Precision
(PPV)
78%
Recall
(Sensitivity/TPR)
89%
AUC-PR
(×100)
80%
F1-Score
(×100)

Business Impact:

  • 15% relative reduction in churn rate (from 4.2% to 3.57% monthly churn) measured via randomized A/B test over 90-day period, statistically significant with p < 0.001
  • 7-14 day prediction window providing actionable early warning—model predicts churn probability 1-2 weeks before actual churn event occurs
  • Retention team efficiency improved by 40%—reduced outreach volume by 60% while maintaining higher intervention success rate
  • ROI of 5.2:1 on retention campaigns: $520K in retained revenue per $100K spent on targeted interventions (calculated using LTV estimates)

Technical Achievements:

  • Successfully handled severe class imbalance (1:23.5 ratio) through ensemble of techniques: weighted loss, threshold optimization, and cost-sensitive learning
  • Built production-ready data pipelines processing 500K+ customer records daily with 99.8% uptime and <5 minute SLA for batch scoring
  • Achieved <50ms p95 inference latency enabling potential real-time use cases (current implementation uses nightly batch scoring)
  • Implemented automated retraining pipeline with monthly model refresh, automated validation, and conditional deployment based on performance thresholds
  • Deployed comprehensive monitoring with drift detection, performance tracking, and automated alerting reducing MTTR from days to hours
  • Feature engineering pipeline reduced dimensionality from 300+ raw features to 45 core features while maintaining 95% of predictive power (measured via ablation studies)
  • Model interpretability via SHAP values enabled business stakeholders to understand top churn drivers: low engagement velocity (SHAP = 0.18), decreasing usage trends (0.15), and increased support tickets (0.12)