An end-to-end churn project on the Telco Customer Churn dataset: a Power BI dashboard for visual analysis and a Random Forest model in Python to predict which customers are likely to leave, plus business-focused EDA on tenure, contracts, and Lifetime Value (LTV).
| File | Description |
|---|---|
Customer_Churn-prediction-analysis.ipynb |
Full ML notebook β preprocessing, model, evaluation, EDA |
Customer-Churn_Telco_Clean.csv |
Cleaned dataset used as the model input |
Churn_Analysis.pbix |
Interactive Power BI dashboard |
- Load the cleaned dataset and drop non-predictive columns (
customerID, index). - Encode 19 categorical features with
LabelEncoder; map the targetChurn(No β 0, Yes β 1). - Split into features/target with an 80/20 train-test split (
random_state=42). - Train a
RandomForestClassifier(n_estimators=100,random_state=42). - Evaluate with a confusion matrix and a full classification report.
- Rank drivers using the model's feature-importance scores.
- Engineer a Lifetime Value feature:
LTV = MonthlyCharges Γ tenure.
Overall accuracy: 80% (on 1,409 test records)
| Metric | Class 0 (Retained) | Class 1 (Churned) |
|---|---|---|
| Precision | 0.83 | 0.67 |
| Recall | 0.92 | 0.46 |
| F1-score | 0.87 | 0.55 |
- Tenure: churned customers stay ~18 months on average vs ~38 months for retained customers.
- Contract type: month-to-month customers churn far more than one- or two-year contract holders.
- Internet service: fiber-optic users show the highest churn rate; customers with no internet service churn least.
- Lifetime Value: average LTV is $18,266 for churned vs $27,810 for retained customers β churn directly erodes revenue.
- LTV drivers: Contract type and Internet Service influence LTV the most; gender has negligible impact.
Python Β· pandas Β· NumPy Β· scikit-learn (RandomForestClassifier, LabelEncoder, train_test_split, classification_report, confusion_matrix) Β· matplotlib Β· seaborn Β· joblib Β· Jupyter Notebook Β· Power BI (dashboard)
pip install pandas numpy scikit-learn matplotlib seaborn joblib jupyter
jupyter notebook Customer_Churn-prediction-analysis.ipynbOpen Churn_Analysis.pbix in Power BI Desktop to explore the interactive dashboard.
MIT