Explainable ML System with XGBoost, SHAP, and Actionable Retention Insights
Explore churn prediction capabilities
Explore customer datasets with interactive visualizations and statistics
Create and transform features with automated feature selection
Train XGBoost models with hyperparameter tuning
Interactive SHAP visualizations for model interpretability
Real-time churn scoring for individual customers
Analyze churn patterns across customer segments
Design and analyze retention experiments
AI-powered retention recommendations
KPI tracking and business intelligence
Development and deployment tools
# 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']}")