AIToday
Qiita 機械学習Published: Oct 13, 2026, 22:00 JST

bank-full.csv test: random forest tops 8 models, but duration must go

bank-full.csv test: random forest tops 8 models, but duration must go

3 Key Points

  1. What happened

    Using bank-full.csv (45,211 records, 16 predictors), the author compared eight classifiers and reported random forest with the highest cross-validated ROC-AUC of 0.9271, while a single decision tree scored lowest at 0.7022.

  2. Why it matters

    Models that include duration post far higher scores, yet the dataset's own documentation says it should be excluded from realistic pre-call prediction, so a working model drops to a ROC-AUC of 0.7766 with random forest and 0.7648 with logistic regression.

Not sure about something? Ask the AI

Questions and answers are published on this page.

Summaries like this, in your inbox every morning.

Context & Analysis

The Bank Marketing dataset comes from a Portuguese bank's direct phone marketing campaign, and the target is binary: whether the customer eventually subscribed to a term deposit. The data has a strong class imbalance, with only about 11.70% of the 45,211 records labeled yes, which is why plain accuracy is misleading. The tutorial shows that simply predicting no for everyone would already give roughly 88.3% accuracy while finding none of the interested customers, so ROC-AUC and PR-AUC are used instead.

The exercise also draws a line between correlation and cause. Education level, job, housing loans, and call counts all show different sign-up rates, but the tutorial stresses that these patterns are starting points for hypotheses, not proof that any one factor drives the decision. To settle questions like how many times to call, it says randomized tests or past-campaign causal analysis would be needed.

Beyond the classifier comparison, the piece emphasizes workflow choices: preprocess after splitting the data to avoid leakage, use stratified sampling and StratifiedKFold for the imbalanced target, and reserve the test set for a single final evaluation. The most important design decision, it argues, is defining when the prediction is made and what information is genuinely available then.

FAQ
Why is call duration excluded from the practical model?
Duration is the length of the last call, which is unknown before the call is made, so it cannot be used when deciding whom to contact. UCI's own description says it should be excluded from a realistic predictive model.
How imbalanced is the target variable?
Only about 11.70% of customers in the dataset signed up for a term deposit, while 88.30% did not.
Does a high ROC-AUC mean the campaign plan is decided?
No. A threshold is still needed, and it should be set by business conditions such as daily call capacity, cost per call, and the expected profit per deposit.
Qiita 機械学習Read Original Article

AI news that matters for your work, delivered every morning.

Pick your industry and the AI tools you use, and get news related to your work every day.

Free · 30 seconds with Google · unsubscribe anytimeWhat is AIToday? →

Ask AI

Ask AI anything about this article. The AI reads this article, earlier AIToday articles, and Wikipedia, and cites its sources. Q&As are published on this page for other readers too.

Questions and answers are published on this page.

Next articlePyTorch "dynamic notch attention filter" targets hallucination via PEQ math