| | ---
|
| | title: Telco Customer Churn Prediction
|
| | emoji: π
|
| | colorFrom: blue
|
| | colorTo: red
|
| | sdk: gradio
|
| | sdk_version: 4.0.0
|
| | app_file: app.py
|
| | pinned: false
|
| | license: mit
|
| | tags:
|
| | - machine-learning
|
| | - customer-churn
|
| | - classification
|
| | - business-analytics
|
| | - scikit-learn
|
| | - telecommunications
|
| | datasets:
|
| | - telco-customer-churn
|
| | metrics:
|
| | - accuracy
|
| | - precision
|
| | - recall
|
| | - f1
|
| | - roc_auc
|
| | pipeline_tag: tabular-classification
|
| | ---
|
| |
|
| | # π Telco Customer Churn Prediction Model
|
| |
|
| | A machine learning model that predicts customer churn probability for telecommunications companies with **84.2% ROC-AUC** accuracy.
|
| |
|
| | ## π Quick Start
|
| |
|
| | ```python
|
| | import joblib
|
| | import pandas as pd
|
| |
|
| | # Load the model
|
| | model = joblib.load('model.joblib')
|
| |
|
| | # Make prediction (requires 45 features)
|
| | churn_probability = model.predict_proba(customer_data)[:, 1]
|
| | ```
|
| |
|
| | ## π Model Performance
|
| |
|
| | | Metric | Score |
|
| | |--------|-------|
|
| | | **ROC-AUC** | **0.8419** |
|
| | | **Accuracy** | 0.8055 |
|
| | | **Precision** | 0.6572 |
|
| | | **Recall** | 0.5588 |
|
| | | **F1-Score** | 0.6040 |
|
| |
|
| | ## π― Risk Categories
|
| |
|
| | - π¨ **High Risk (β₯80%)**: 49 customers - *Immediate action required*
|
| | - β οΈ **Medium Risk (50-79%)**: 1,512 customers - *Proactive retention*
|
| | - π **Low Risk (30-49%)**: 1,110 customers - *Loyalty programs*
|
| | - β
**Safe (<30%)**: 4,372 customers - *Upselling opportunities*
|
| |
|
| | ## π§ Features (45 total)
|
| |
|
| | The model uses 45 features including:
|
| | - Demographics (Age, Gender, Partner, Dependents)
|
| | - Services (Phone, Internet, Security, Streaming)
|
| | - Account (Contract, Payment method, Billing)
|
| | - Financial (Tenure, Monthly charges, Total charges)
|
| |
|
| | ## πΌ Business Impact
|
| |
|
| | - **Customer Retention**: Identify at-risk customers early
|
| | - **Revenue Protection**: Prevent churn-related revenue loss
|
| | - **Campaign Optimization**: Target retention efforts effectively
|
| | - **ROI**: Expected 300-400% return with targeted campaigns
|
| |
|
| | ## ποΈ Model Details
|
| |
|
| | - **Algorithm**: Logistic Regression
|
| | - **Training Data**: 5,634 samples
|
| | - **Test Data**: 1,409 samples
|
| | - **Training Date**: 2025-07-10
|
| |
|
| | ## π Usage
|
| |
|
| | See the demo above for interactive predictions!
|
| |
|
| | For batch processing:
|
| | ```python
|
| | # Load model
|
| | model = joblib.load('model.joblib')
|
| |
|
| | # Prepare data with all 45 features
|
| | results = model.predict_proba(customer_features)[:, 1]
|
| |
|
| | # Categorize risk
|
| | def categorize_risk(prob):
|
| | if prob >= 0.8: return "High Risk"
|
| | elif prob >= 0.5: return "Medium Risk"
|
| | elif prob >= 0.3: return "Low Risk"
|
| | else: return "Safe"
|
| | ```
|
| |
|
| | ## π License
|
| |
|
| | MIT License - Free for commercial and academic use.
|
| |
|