营销分析:用 Python 预测客户流失
Mark Peterson
Director of Data Science, Infoblox
telco['Churn'].value_counts()
no 2850
yes 483
Name: Churn, dtype: int64












| 指标 | 公式 |
|---|---|
| 精确率(Precision) | True Positives / (True Positives + False Positives) |
| 指标 | 公式 |
|---|---|
| 召回率/敏感度(Recall/Sensitivity) | True Positives / (True Positives + False Negatives) |

from sklearn.metrics import confusion_matrixcm = confusion_matrix(y_test, y_pred)
营销分析:用 Python 预测客户流失