Customer Churn Prediction

Explainable ML System with XGBoost, SHAP, and Actionable Retention Insights

XGBoost SHAP Explainability Feature Engineering A/B Testing
94.2%
Model Accuracy
0.89
AUC-ROC Score
23%
Churn Reduction
$2.4M
Revenue Saved

System Architecture

Data Pipeline

  • ETL from CRM, billing, support systems
  • Real-time feature computation
  • Data quality validation
  • Feature store integration

ML Engine

  • XGBoost gradient boosting
  • Hyperparameter optimization
  • Class imbalance handling
  • Model versioning & registry

Explainability

  • SHAP TreeExplainer
  • Local & global explanations
  • Feature interaction analysis
  • Counterfactual explanations

Interactive Demos

Explore churn prediction capabilities

Tools & Utilities

Development and deployment tools

Documentation

Learn and integrate

Quick Start

# Install dependencies
pip install xgboost shap pandas scikit-learn

# Load and prepare data
import pandas as pd
from churn_model import ChurnPredictor

# Initialize predictor
predictor = ChurnPredictor(model_path='models/xgboost_v2.json')

# Single customer prediction with explanation
customer_data = {
    'tenure': 24,
    'monthly_charges': 70.50,
    'total_charges': 1692.0,
    'contract_type': 'Month-to-month',
    'payment_method': 'Electronic check',
    'support_tickets': 3
}

result = predictor.predict_with_explanation(customer_data)
print(f"Churn Probability: {result['probability']:.2%}")
print(f"Risk Level: {result['risk_level']}")
print(f"Top Factors: {result['top_factors']}")
print(f"Recommended Actions: {result['recommendations']}")