Predicting credit-card default from balance and income
Credit risk scoringA lender wants to estimate the probability that a customer will default on their credit-card debt, using features such as current balance, annual income, and student status (the Default dataset from An Introduction to Statistical Learning, with 10,000 customers). The positive class (default) is rare — only about 3% of customers — making it a classic imbalanced binary classification problem.
Fit a logistic regression , inspect each coefficient as a log-odds effect, and convert the predicted probabilities to decisions via a tuned threshold.
Balance is overwhelmingly the strongest predictor: its positive coefficient means the odds of default rise sharply with balance, and a customer with a 500 balance. Using the default threshold the model reaches roughly 97% overall accuracy, but because only ~3% of customers default, that headline accuracy is close to the naive "predict no one defaults" baseline — so the lender instead lowers the threshold to catch more true defaulters, trading a higher false-positive rate for far fewer costly missed defaults. The case study underscores that for imbalanced classification, probability calibration and threshold choice matter more than raw accuracy.
Source: An Introduction to Statistical Learning (Ch. 4, Default data) — James, G., Witten, D., Hastie, T. and Tibshirani, R.