Skip to content

Latest commit

Β 

History

11 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“Š Telco Customer Churn Analysis & Prediction

Python scikit-learn Power BI

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).


🎯 What's Inside

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

πŸ”¬ Modeling Pipeline (notebook)

  1. Load the cleaned dataset and drop non-predictive columns (customerID, index).
  2. Encode 19 categorical features with LabelEncoder; map the target Churn (No β†’ 0, Yes β†’ 1).
  3. Split into features/target with an 80/20 train-test split (random_state=42).
  4. Train a RandomForestClassifier (n_estimators=100, random_state=42).
  5. Evaluate with a confusion matrix and a full classification report.
  6. Rank drivers using the model's feature-importance scores.
  7. Engineer a Lifetime Value feature: LTV = MonthlyCharges Γ— tenure.

πŸ“ˆ Results

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

πŸ”‘ Key Insights (from the notebook)

  • 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.

πŸ› οΈ Tools & Libraries

Python Β· pandas Β· NumPy Β· scikit-learn (RandomForestClassifier, LabelEncoder, train_test_split, classification_report, confusion_matrix) Β· matplotlib Β· seaborn Β· joblib Β· Jupyter Notebook Β· Power BI (dashboard)


πŸš€ Run It

pip install pandas numpy scikit-learn matplotlib seaborn joblib jupyter
jupyter notebook Customer_Churn-prediction-analysis.ipynb

Open Churn_Analysis.pbix in Power BI Desktop to explore the interactive dashboard.


πŸ“„ License

MIT

About

End-to-end customer churn analysis using SQL, Power BI, and Machine Learning

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages