Predicting which credit card customers will leave

A random forest trained on 10,127 bank customers in R (tidymodels + ranger), explained with DALEX. This page summarises how well it works and what drives its predictions.

Try the simulator →

Test-set performance

Measured on 20% of customers the model never saw during training. About of customers churned, so PR-AUC is the harder, more telling score.

Confusion matrix (threshold 0.5)

Test customers by risk band

High ≥ 60%, Medium 30-60%, Low < 30% churn probability.

Model quality curves

ROC curve

ROC curve

Precision-recall curve

Precision-recall curve

What drives churn?

Variable importance

Longer bars mean the model loses more accuracy when that feature is scrambled, so it relies on it more.

Highest-risk customers

See all 25 in a sortable table

Click a column header to sort.

Why those customers? (SHAP)

Bars to the right pushed the churn risk up; bars to the left pushed it down.

SHAP explanation for customer 1
SHAP explanation for customer 2
SHAP explanation for customer 3

Explore it yourself

Move sliders for transactions, inactivity and utilization and watch the predicted churn risk change.

Open the Customer Simulator →