Skip to content
Aditya Aryan — home

/ live dashboard / 43,193 contacts / in your browser

Who actually says yes.

A Portuguese bank ran a telemarketing campaign for term deposits and logged 45,211 calls. Only 11.6% of them ended in a subscription. This is the dashboard from that analysis, rebuilt to run in the page: every filter re-aggregates all 43,193 rows on the spot, with no server and no pre-baked combinations.

Python · scikit-learn · SQLite · originally Dash and Plotly

Loading the dashboard…

Three models, one held-out split.

Trained on 80% of the cleaned rows and scored on the remaining 20%, stratified so both splits carry the same subscription rate. Accuracy alone flatters every one of them — 88% of these contacts said no, so a model that always says no scores 88. F1 and ROC AUC are the honest columns.

Classifier performance on the held-out test split.
ModelAccuracyPrecisionRecallF1ROC AUC
Logistic regressionScaled features, 1000 iterations.0.90290.64760.36060.46320.9095
Decision treeUnpruned, on unscaled features.0.86790.43600.46510.45010.6930
Gradient boostingScikit-learn defaults, scaled features.0.90510.64290.41240.50240.9162

What gradient boosting leaned on

  1. duration50.5%
  2. poutcome_success19.7%
  3. pdays7.0%
  4. housing_yes4.9%
  5. age4.6%
  6. month_mar4.6%
  7. month_oct1.6%
  8. month_sep1.3%
  9. balance1.0%
  10. month_may0.8%

What the statistics say.

Hypothesis tests run against the cleaned dataset.
QuestionTestStatisticpn
Balance by previous outcomeMean balance of contacts whose last campaign succeeded against those where it failed.Welch t-test4.291.91e-56,133
Job against subscriptionWhether subscription rate is independent of job.Chi-squared772.491.69e-15943,193
Education against subscriptionWhether subscription rate is independent of education.Chi-squared233.402.08e-5143,193
Housing loan against subscriptionWhether subscription rate is independent of housing loan.Chi-squared825.281.72e-18143,193
Previous outcome against subscriptionWhether subscription rate is independent of previous outcome.Chi-squared4027.72< 1e-30043,193

How the rows got here.

The dashboard above is not reading the raw file. These are the steps between it and the chart, in order, with what each one cost.

  1. 01loaded bank-full.csv45,211 rows
  2. 02dropped campaign and day45,211 rows
  3. 03removed unknown job44,923 rows · −288
  4. 04removed unknown education43,193 rows · −1,730
  5. 05reassigned unknown contact in proportion43,193 rows · 12,286 moved
  6. 06poutcome unknown folded into other43,193 rows

Source: UCI Bank Marketing (bank-full.csv). UCI Machine Learning Repository. Moro, S., Cortez, P. and Rita, P. (2014). A data-driven approach to predict the success of bank telemarketing. Decision Support Systems.

Back to selected work