Marketing Analytics: Predicting Customer Churn in Python
Mark Peterson
Director of Data Science, Infoblox
telco['Churn'].value_counts()
no 2850
yes 483
Name: Churn, dtype: int64












| Metric | Formula |
|---|---|
| Precision | True Positives / (True Positives + False Positives) |
| Metric | Formula |
|---|---|
| Recall/Sensitivity | True Positives / (True Positives + False Negatives) |

from sklearn.metrics import confusion_matrixcm = confusion_matrix(y_test, y_pred)
Marketing Analytics: Predicting Customer Churn in Python