โ† Back to Portfolio

Project 4 ยท Machine Learning

Online Retail Customer Churn Prediction

End-to-end churn workflow using feature engineering, Logistic Regression and Random Forest models, ROC evaluation, and SHAP interpretation artifacts.

Pythonscikit-learnSHAPRandom ForestChurn Analytics

Business Problem & Objectives

  • Estimate which customers are likely to churn and rank the major risk signals.
  • Compare an interpretable baseline model against a tree-based classifier.
  • Translate model outputs into retention-oriented actions.

Dataset

  • Raw file: online_retail_churn_raw.csv from the project data folder.
  • 9,000 customer rows, 17 fields; churn count 1,776 (19.73%).
  • Date field span: 2024-06-20 to 2025-06-20.
  • Includes demographics, spending, engagement, support, and churn label.

Methodology

  • Data prep and engineered features: Total_Spend, Engagement_Score, High_Support, Income_Band, Days_Since_Last_Purchase.
  • Train/test split with class weighting.
  • Models: Logistic Regression and Random Forest (300 estimators).
  • Evaluation: ROC AUC, confusion-focused metrics, feature importance, and SHAP summaries.

Key Findings (From Reports)

  • Random Forest ROC AUC: 0.5305; Logistic Regression ROC AUC: 0.4882.
  • Top RF importance features: Avg_Time_Per_Visit_Minutes, Days_Since_Last_Purchase, Annual_Income_USD.
  • Top SHAP drivers include Avg_Purchase_Value, Annual_Income_USD, and Avg_Time_Per_Visit_Minutes.
  • Project documentation explicitly frames this as a baseline on synthetic-style signal quality.

Model Visuals

ROC curve comparison for churn models
ROC comparison between Logistic Regression and Random Forest pipelines.
Feature importance chart for churn model
Top-20 impurity-based feature importances from the Random Forest model.
SHAP summary plot of churn feature impacts
SHAP summary indicating direction and magnitude of feature-level churn influence.