A comprehensive web application for customer churn prediction combining classification models and survival analysis with personalized retention strategies
Retainly is a full-stack web application that enables businesses to upload customer data and receive comprehensive churn analysis through multiple machine learning approaches. The platform processes CSV files, applies pre-trained models, and delivers actionable insights across multiple interactive dashboards.
Streamlit-based web application with separate model pipelines for classification and survival analysis:
# Data Processing Pipeline
def process_uploaded_data(uploaded_file):
df = pd.read_csv(uploaded_file)
# Automated preprocessing
df_processed = preprocess_features(df)
return df_processed
# Multi-Model Prediction
def generate_predictions(processed_data):
# Classification predictions
lr_proba = logistic_model.predict_proba(processed_data)
# Survival analysis predictions
survival_curves = survival_model.predict_survival_function(processed_data)
time_to_churn = survival_model.predict_median(processed_data)
return {
'classification_proba': lr_proba,
'survival_curves': survival_curves,
'time_to_churn': time_to_churn
}
# Retention Strategy Engine
def generate_retention_strategies(customer_data, predictions):
strategies = []
for i, customer in enumerate(customer_data):
if predictions['classification_proba'][i] > 0.7:
if predictions['time_to_churn'][i] < 30:
strategies.append("Immediate intervention: Personalized offer")
else:
strategies.append("Proactive engagement: Loyalty program")
else:
strategies.append("Maintenance: Regular communication")
return strategies
Executive summary displaying overall churn risk, high-risk customer count, average time-to-churn, and key performance indicators across the entire dataset.
Interactive survival curves, hazard functions, median survival times, and cohort analysis showing how different customer segments behave over time.
Model performance metrics, feature importance plots, confusion matrices, and probability distribution analysis for the classification models.
Individual customer profiles with churn probability scores, expected time-to-churn, key risk factors, and personalized retention strategies.
Retainly is a full-stack web application that enables businesses to upload customer data and receive comprehensive churn analysis through multiple machine learning approaches. The platform processes CSV files, applies pre-trained models, and delivers actionable insights across multiple interactive dashboards.
Streamlit-based web application with separate model pipelines for classification and survival analysis:
# Data Processing Pipeline
def process_uploaded_data(uploaded_file):
df = pd.read_csv(uploaded_file)
# Automated preprocessing
df_processed = preprocess_features(df)
return df_processed
# Multi-Model Prediction
def generate_predictions(processed_data):
# Classification predictions
lr_proba = logistic_model.predict_proba(processed_data)
# Survival analysis predictions
survival_curves = survival_model.predict_survival_function(processed_data)
time_to_churn = survival_model.predict_median(processed_data)
return {
'classification_proba': lr_proba,
'survival_curves': survival_curves,
'time_to_churn': time_to_churn
}
Executive summary displaying overall churn risk, high-risk customer count, average time-to-churn, and key performance indicators across the entire dataset.
Interactive survival curves, hazard functions, median survival times, and cohort analysis showing how different customer segments behave over time.
Model performance metrics, feature importance plots, confusion matrices, and probability distribution analysis for the classification models.
Individual customer profiles with churn probability scores, expected time-to-churn, key risk factors, and personalized retention strategies.