Customer Churn Prediction
Project Information
- Category: Machine Learning
- Type: Binary Classification
- Status: Completed
- GitHub: View Repository β
Python Pandas Scikit-learn Matplotlib Seaborn Random Forest SHAP Method
E-commerce Customer Churn Prediction
This project presents the development of a predictive system to combat customer turnover (churn) in an e-commerce operation. The work covers the entire life cycle of a predictive model: data ingestion and cleaning, exploratory analysis, feature engineering, model training, hyperparameter optimization, and interpretability analysis using SHAP. The central focus was transforming behavioral data (hours in the app, registered devices) and satisfaction history into a decision support tool, allowing the company to act proactively with targeted and personalized loyalty campaigns.
The development focused on the incremental evolution of Random Forest-based models, with an emphasis on overcoming overfitting to ensure applicability in real-world scenarios. The final version of the model (V2) prioritized generalization capacity, achieving an increase in Recall for the churn class from 78% to 80% in the test set. This strategic adjustment ensures that the company captures a larger share of at-risk customers, optimizing the ROI of retention actions and reducing the Customer Acquisition Cost (CAC) by focusing on preserving the current base.
Key Highlights
- End-to-End Cycle: Complete implementation from handling heterogeneous bases to exporting the optimized final model.
- Hyperparameter Optimization: Fine-tuning via GridSearch for overfitting mitigation, ensuring the model learns real patterns.
- Interpretability with SHAP: Use of SHAP values to breakdown the influence of variables such as "distance from warehouse" and "tenure" on the propensity to churn.
- Focus on Business Metrics: Prioritization of Recall over simple Accuracy, aiming to maximize the identification of customers who are actually likely to leave.
- Robustness Analysis: Rigorous comparison between model versions (V1 vs V2), validating stability and predictive reliability for production use.