All Projects
TabularClassificationGradient Boosting
Predicting Loan Payback
Binary classification: will a borrower repay their loan?
Given a borrower's financial profile and the terms of a loan, predict the probability that they default rather than repay in full — a standard tabular classification problem that mirrors how lenders screen applications before approval.
Dataset
Source
Kaggle binary classification competition — synthetic tabular loan data
- •593,994 train rows
- •254,569 test rows
- •11 raw features: annual_income, debt_to_income_ratio, credit_score, loan_amount, interest_rate, gender, marital_status, education_level, employment_status, loan_purpose, grade_subgrade
- •5-fold stratified cross-validation (StratifiedKFold, shuffled)
- •~79.9% paid back vs. ~20.1% defaulted (~4:1 class imbalance)
- •No missing values requiring imputation
Approach
- •LightGBM with 5-fold stratified cross-validation
- •Native categorical handling for gender, marital_status, education_level, employment_status, loan_purpose, and grade_subgrade
- •Engineered grade_letter / grade_num / grade_ordinal from grade_subgrade
- •Engineered loan_to_income, debt_service_ratio, and dti_x_rate (debt-to-income × interest rate)
- •Binned credit_band feature
- •scale_pos_weight=3.97 to correct for the ~4:1 class imbalance
Training
- •Baseline: num_leaves=127, learning_rate=0.05, feature_fraction/bagging_fraction=0.8 — hand-set, not searched
- •Tuned via Optuna (Bayesian optimization, TPE sampler, 40 trials, 2-fold CV per trial): num_leaves=93, learning_rate=0.036, feature_fraction=0.856, bagging_fraction=0.997
- •Tuning found a much stronger L1 penalty and weaker L2 penalty than the manual guess (reg_alpha 0.1 → 9.23, reg_lambda 1.0 → 0.016) — an interaction effect unlikely to be found by hand-tuning one parameter at a time
- •Up to 1000 boosting rounds with early stopping (patience 50 rounds) for both configurations
Results
CV AUC0.9222
- •Baseline (manual params): 5-fold mean AUC 0.92118 ± 0.00058
- •Tuned (Optuna): 5-fold mean AUC 0.92218 ± 0.00061, overall OOF AUC 0.92217 — a genuine +0.00100 AUC gain, consistent across all 5 folds
- •Top features by gain unchanged after tuning: employment_status and debt_to_income_ratio, well ahead of the raw grade and income columns