Back to Projects
Marketing Analytics / ML

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.

Type
Classification
Domain
Marketing / Banking
Methods
Tree Ensembles, SHAP
Origin
Cambridge DS Career Accelerator coursework

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

01
Data
41,188 contacts with 48 pre-processed, one-hot-encoded features; strong class imbalance.
02
Model comparison
Six classifiers compared on test ROC AUC: logistic regression, decision tree, random forest, AdaBoost, Gradient Boosting and XGBoost.
03
Tuning
Decision tree tuned with grid search over pre-pruning settings (5-fold cross-validation).
04
Interpretation
SHAP values on the Gradient Boosting model to show which features drove predictions, and in which direction.

Results

ModelTest ROC AUC
Gradient Boosting0.9485
XGBoost0.9446
Random Forest0.9393
AdaBoost0.9341
Logistic Regression0.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

TEST REPORTTEST REPORTBANK MARKETINGBANK MARKETING
Checked
  • 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.
Found
  • 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.
Limits
  • A deployable model would be re-trained without call duration and judged on precision among the contacts it ranks highest.

Technology Stack

Python scikit-learn XGBoost SHAP GridSearchCV pandas
Interested in this work or something similar?