Decision Trees and SHAP: Bank Marketing
A model comparison and SHAP interpretability study on a public bank telemarketing dataset, predicting which contacts subscribe to a term deposit under strong class imbalance.
The Challenge
Gradient Boosting predicted term-deposit subscriptions with 0.9485 ROC AUC, and SHAP showed which factors drove each prediction.
A bank's marketing team wanted to know which contacts were worth calling. Only 11.3% of contacts subscribed (88.7% did not), so accuracy alone would be misleading and the model's reasoning needed to be visible.
Approach
Results
| Model | Test ROC AUC |
|---|---|
| Gradient Boosting | 0.9485 |
| XGBoost | 0.9446 |
| Random Forest | 0.9393 |
| AdaBoost | 0.9341 |
| Logistic Regression | 0.9288 |
| Decision Tree (tuned) | 0.9213 |
| Decision Tree (baseline) | 0.7380 |
The ensembles were close together, and tuning lifted the single decision tree from 0.738 to 0.921. SHAP ranked call duration as by far the strongest predictor, followed by two macroeconomic indicators (employment variation rate and number employed).
Leakage note: call duration is only known after the call ends, so it cannot be used to decide whom to call. The high AUC therefore describes what successful calls looked like, rather than providing pre-call lead scoring. A deployable model would be re-trained without duration.
What This Means
Used descriptively, the analysis shows that engaged, longer conversations and favourable economic conditions go with subscriptions. For targeting before a call, the next step is a model without call duration, judged on precision among the contacts it ranks highest.
How it was tested
- Six classifiers compared on test ROC AUC, because only 11.3% of contacts subscribed and accuracy alone would mislead.
- Decision tree tuned with grid search and 5-fold cross-validation.
- SHAP used to show which features drove predictions, and in which direction.
- Call duration, the strongest predictor, is only known after the call ends. The high AUC describes successful calls rather than providing pre-call lead scoring.
- A deployable model would be re-trained without call duration and judged on precision among the contacts it ranks highest.