← All projects
AnalyticsMachine Learning

Bank Marketing - Logistic Regression and Threshold Tuning

Logistic regression and KNN on 41,188 bank marketing records, with leakage prevention and threshold tuning that trades precision for recall on purpose.

Role
Student / Data Analyst
Team
Individual project
Precision, recall, F1, specificity and accuracy as the classification threshold varies from 0.2 to 0.8
F1, ROC-AUC and average precision compared across baseline, LASSO and Ridge logistic regression
Client segments with the highest observed term-deposit subscription rate
Class distribution showing the ~11.3% positive-class imbalance

Overview

A classification assignment for Deakin's SIT720 Machine Learning unit, predicting whether a bank client will subscribe to a term deposit, with a deliberate focus on data leakage, class imbalance and the business trade-offs behind choosing a decision threshold.

The problem

The bank-marketing dataset is only about 11.3% positive, so accuracy alone is misleading, and the most predictive raw feature (call duration) is only known after the call ends - using it as-is would silently leak the outcome into the model and make it useless for real campaign targeting.

My approach

Removed the duration feature to keep the model realistic for pre-call scoring, and recoded the pdays=999 sentinel into a separate was_contacted_before flag so scaling didn't treat it as a genuine distance. Compared baseline, L1 (LASSO) and L2 (Ridge) logistic regression against KNN using ROC-AUC, precision, recall, F1 and specificity rather than accuracy, then swept the classification threshold from 0.2 to 0.8 to show how precision, recall and workload trade off - and profiled which client segments (by job, age band, contact month and prior campaign outcome) have the highest observed subscription rate.

Tech stack

PythonScikit-learnPandasLogistic RegressionKNN