This project implements an end-to-end customer churn prediction system using structured customer data.
Rather than focusing only on model accuracy, the project emphasizes decision-aware modeling, showing how predicted probabilities are converted into actionable decisions through threshold tuning and model comparison.
The goal is to demonstrate how real-world machine learning systems are built, evaluated, and justified — not just how models are trained.
Customer churn is costly for subscription-based businesses.
The objective of this project is to:
- Predict the probability that a customer will churn
- Convert predictions into business-relevant decisions
- Compare multiple model families fairly
- Select a final model based on evidence, not complexity
- Pipeline-safe feature engineering
- Class imbalance handling
- Probability-based evaluation
- ROC–AUC vs Precision–Recall tradeoffs
- Threshold tuning for decision-making
- Model comparison across different algorithms
- Interpretable conclusions
- Telco Customer Churn Dataset (Kaggle)
- Contains customer demographics, subscription details, and service usage
- Binary target variable: Churn (Yes / No)
project/ │ ├── notebooks/ │ ├── baseline.ipynb │ ├── 04_threshold_analysis.ipynb │ ├── 05_tree_models.ipynb │ ├── 06_boosting.ipynb │ ├── src/ │ └── pipelines/ │ └── feature_engineering.py │ ├── artifacts/ │ ├── y_test.npy │ ├── y_proba.npy │ └── test_indices.npy │ └── README.md
- Cleaned raw columns and handled missing values
- Encoded binary and categorical features
- Engineered tenure buckets
- Built a custom sklearn-compatible transformer
- Ensured no data leakage and full pipeline compatibility
All feature engineering is reusable, deterministic, and production-safe.
- Implemented using a full sklearn pipeline
- Class imbalance handled via
class_weight="balanced" - Evaluation metric: ROC–AUC ≈ 0.84
This confirmed that the data contains strong predictive signal.
- Used predicted probabilities instead of hard labels
- Analyzed precision–recall tradeoffs
- Performed threshold sweeping from 0.1 → 0.9
- Selected a high-recall operating point (~0.35)
This step demonstrated how one threshold choice dramatically changes outcomes, even with the same model.
Models evaluated using ROC–AUC and PR–AUC:
| Model | Key Observation |
|---|---|
| Logistic Regression | Strong, well-calibrated baseline |
| Decision Tree | Underperformed due to high variance |
| Random Forest | Comparable to logistic regression |
| XGBoost / LightGBM | Modest improvements (~1–3% PR–AUC) |
Key Insight:
Feature engineering and threshold tuning contributed more to performance than model complexity.
Logistic Regression was selected as the final model because it offers:
- Competitive performance
- Stable and interpretable probabilities
- Easy deployment
- Clear decision control via threshold tuning
- ROC–AUC ≈ 0.84
- PR–AUC ≈ 0.61
- High recall achievable with controlled precision
- Clear, explainable decision tradeoffs
This project shows the ability to:
- Build ML pipelines correctly
- Evaluate models beyond accuracy
- Make threshold-based decisions
- Compare models fairly
- Communicate tradeoffs clearly
- Think like a real ML practitioner
- Model explainability (coefficients / SHAP)
- Hyperparameter tuning
- Deployment as a REST API
- Cost-sensitive optimization
- Real-time inference simulation
In practical machine learning, decision-making strategy often matters more than model complexity.
Sanjay Sriram
Computer Engineering Undergraduate
Machine Learning & AI Projects