Skip to content

End-to-end modelling on UCI Bank Marketing: logistic vs weighted logistic; improves minority-class recall. Includes notebook + PDF (no data).

License

Notifications You must be signed in to change notification settings

JimmyAung/bankmarketing-modelling-in-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bank Marketing — Modelling in Python

Model comparison overview

Binary classification on the Portuguese bank marketing dataset. I built and compared Logistic Regression (baseline) vs Weighted Logistic Regression with simple, interpretable features. The weighted model significantly improved recall on the minority class (term-deposit Yes).

TL;DR (Results)

  • Baseline Logistic Regression: Accuracy ≈ 0.900, Precision (Yes) 0.67, Recall (Yes) 0.22, F1 (Yes) 0.33.
  • Weighted Logistic Regression: Accuracy ≈ 0.833, Precision (Yes) 0.36, Recall (Yes) 0.64, F1 (Yes) 0.47.
  • Business take: Higher recall matters more than a small drop in accuracy for marketing outreach, so the weighted model is preferred.

Why weighted?

The dataset is imbalanced (~11% subscribed). Reweighting (class_weight='balanced') reduces false negatives (missed true subscribers) at the cost of more false positives, which is acceptable for outreach.

Repository Structure

  • notebooks/01_bank_marketing_models.ipynb
  • reports/ → project PDF + BankMarketing_lab_overview.png
  • data/README.md (no raw data committed)
  • requirements.txt, LICENSE, README.md

Dataset

Source: UCI Machine Learning Repository — Bank Marketing

Citation:
Moro, S., Cortez, P., & Rita, P. (2014). A data-driven approach to predict the success of bank telemarketing. Decision Support Systems, 62, 22–31.

Files used (locally, not committed):
bank-full.csv (or a subset). Place the CSV(s) in data/ before running the notebook.

Reproduce Locally

# 1) create & activate a venv (Windows)
python -m venv .venv
.venv\Scripts\activate

# 2) install deps
pip install -r requirements.txt

# 3) run
jupyter notebook
# open notebooks/01_bank_marketing_models.ipynb

About

End-to-end modelling on UCI Bank Marketing: logistic vs weighted logistic; improves minority-class recall. Includes notebook + PDF (no data).

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published