Downloads · 30 days
0
faysal725/customer-churn-predictor
customer-churn-predictor is a tabular classification model from faysal725. Use it for the tabular classification task on the model card, and read the license before you ship it in a product. It is set up for scikit-learn. The card lists the license as mit.
Predicts which customers are likely to cancel, using behavioral and account data. Built for SaaS, subscription, telecom, and retail businesses with recurring customers.
Downloads · 30 days
0
Access
Public
Updated Jun 19, 2026
Repo size
488 KB
Likes
0
Public
Click a slice to open those files.
.pkl488 KB · 98%
From the Hugging Face model README
Predicts which customers are likely to cancel, using behavioral and account data. Built for SaaS, subscription, telecom, and retail businesses with recurring customers.
This is the free version. It gives you a single-customer churn probability and a risk band (low / medium / high) — useful for evaluating model quality before you commit to anything.
Losing a customer costs more than most teams think — replacing one is far more expensive than retaining one. A model that flags at-risk customers before they cancel lets you act while there's still time, instead of finding out from a cancellation email.
xgb_churn_model.pkl)predict.py)churn_probability (0–1) + risk_band (low/medium/high)→ Get the full version on Gumroad — SHAP explainability, batch scoring, Docker package, and docs included.
pip install -r requirements.txt
python predict.py
Edit the customer dict in predict.py with your own customer's data, or
import predict_churn() into your own script:
from predict import predict_churn
result = predict_churn({
"gender": "Female",
"SeniorCitizen": 0,
"Partner": "Yes",
"Dependents": "No",
"tenure": 2,
"PhoneService": "Yes",
"MultipleLines": "No",
"InternetService": "Fiber optic",
"OnlineSecurity": "No",
"OnlineBackup": "No",
"DeviceProtection": "No",
"TechSupport": "No",
"StreamingTV": "No",
"StreamingMovies": "No",
"Contract": "Month-to-month",
"PaperlessBilling": "Yes",
"PaymentMethod": "Electronic check",
"MonthlyCharges": 85.5,
"TotalCharges": 171.0,
})
# {'churn_probability': 0.8845, 'risk_band': 'high'}
See schema.json for the full list of accepted fields and their valid
values.
Trained and evaluated on the IBM Telco Customer Churn dataset (7,043 customers). Evaluated on imbalanced-aware metrics, not raw accuracy, since churners are the minority class.
| Metric | Score |
|---|---|
| ROC-AUC | 0.841 |
| PR-AUC | 0.658 |
| Recall (churners caught) | 78% |
| Precision (at default threshold) | 52% |
scale_pos_weight tuned to class ratioschema.json)MIT. Free for personal and commercial use. For batch scoring, explainable output, and a production-ready package, see the paid version linked above.