— / 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.
| Model | Accuracy | Precision | Recall | F1 | ROC AUC |
|---|---|---|---|---|---|
| Logistic regressionScaled features, 1000 iterations. | 0.9029 | 0.6476 | 0.3606 | 0.4632 | 0.9095 |
| Decision treeUnpruned, on unscaled features. | 0.8679 | 0.4360 | 0.4651 | 0.4501 | 0.6930 |
| Gradient boostingScikit-learn defaults, scaled features. | 0.9051 | 0.6429 | 0.4124 | 0.5024 | 0.9162 |
What gradient boosting leaned on
- duration50.5%
- poutcome_success19.7%
- pdays7.0%
- housing_yes4.9%
- age4.6%
- month_mar4.6%
- month_oct1.6%
- month_sep1.3%
- balance1.0%
- month_may0.8%
What the statistics say.
| Question | Test | Statistic | p | n |
|---|---|---|---|---|
| Balance by previous outcomeMean balance of contacts whose last campaign succeeded against those where it failed. | Welch t-test | 4.29 | 1.91e-5 | 6,133 |
| Job against subscriptionWhether subscription rate is independent of job. | Chi-squared | 772.49 | 1.69e-159 | 43,193 |
| Education against subscriptionWhether subscription rate is independent of education. | Chi-squared | 233.40 | 2.08e-51 | 43,193 |
| Housing loan against subscriptionWhether subscription rate is independent of housing loan. | Chi-squared | 825.28 | 1.72e-181 | 43,193 |
| Previous outcome against subscriptionWhether subscription rate is independent of previous outcome. | Chi-squared | 4027.72 | < 1e-300 | 43,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.
- 01loaded bank-full.csv45,211 rows
- 02dropped campaign and day45,211 rows
- 03removed unknown job44,923 rows · −288
- 04removed unknown education43,193 rows · −1,730
- 05reassigned unknown contact in proportion43,193 rows · 12,286 moved
- 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.