Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# 🐱 CatBoost Models for Churn, Tenure, and LTV Prediction
|
| 2 |
+
|
| 3 |
+
This repository contains three CatBoost models trained to predict:
|
| 4 |
+
|
| 5 |
+
- **Churn** (`clf_churn.pkl`) – Binary classification (likelihood of customer churn)
|
| 6 |
+
- **Tenure** (`RegTenure.pkl`) – Regression (expected number of months a customer stays)
|
| 7 |
+
- **Lifetime Value (LTV)** (`reg_ltv.pkl`) – Regression (predicted total value of a customer)
|
| 8 |
+
|
| 9 |
+
Each model is saved using Python's `pickle` module and can be loaded easily for inference.
|
| 10 |
+
|
| 11 |
+
---
|
| 12 |
+
|
| 13 |
+
## 🧠 Model Overview
|
| 14 |
+
|
| 15 |
+
| Model File | Task | Type |
|
| 16 |
+
|-------------------|--------------------|----------------|
|
| 17 |
+
| `clf_churn.pkl` | Churn Prediction | Classification |
|
| 18 |
+
| `RegTenure.pkl` | Tenure Estimation | Regression |
|
| 19 |
+
| `reg_ltv.pkl` | LTV Prediction | Regression |
|
| 20 |
+
|
| 21 |
+
---
|
| 22 |
+
|
| 23 |
+
## 💾 How to Use
|
| 24 |
+
|
| 25 |
+
### 1. Install Requirements
|
| 26 |
+
|
| 27 |
+
```bash
|
| 28 |
+
pip install catboost pandas
|
| 29 |
+
|
| 30 |
+
|
| 31 |
+
import pickle
|
| 32 |
+
|
| 33 |
+
with open("clf_churn.pkl", "rb") as f:
|
| 34 |
+
clf_cb = pickle.load(f)
|
| 35 |
+
|
| 36 |
+
with open("RegTenure.pkl", "rb") as f:
|
| 37 |
+
reg_tenure_cb = pickle.load(f)
|
| 38 |
+
|
| 39 |
+
with open("reg_ltv.pkl", "rb") as f:
|
| 40 |
+
reg_ltv_cb = pickle.load(f)
|
| 41 |
+
|
| 42 |
+
|
| 43 |
+
# Predict churn probability
|
| 44 |
+
churn_proba = clf_cb.predict_proba(X_test)[:, 1]
|
| 45 |
+
|
| 46 |
+
# Predict tenure
|
| 47 |
+
tenure_pred = reg_tenure_cb.predict(X_test)
|
| 48 |
+
|
| 49 |
+
# Predict lifetime value
|
| 50 |
+
ltv_pred = reg_ltv_cb.predict(X_test)
|
| 51 |
+
|
| 52 |
+
print("🔁 Churn:", churn_proba[:5])
|
| 53 |
+
print("📅 Tenure:", tenure_pred[:5])
|
| 54 |
+
print("💰 LTV:", ltv_pred[:5])
|