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.
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.



