Skip to content
james_tavita

~/projects/loan-default-prediction

Loan Default Prediction: CatBoost on Imbalanced Tabular Credit Data

Given a loan application's financial and demographic profile, predict whether the loan will ultimately be paid back — a standard credit-risk screening problem where the cost of a false negative (approving a loan that defaults) and a false positive (declining a loan that would have been repaid) are asymmetric and business-defined, not something the model itself can resolve.

Published ~/projects
01// problem.md

Problem

Given a loan application's financial and demographic profile, predict whether the loan will ultimately be paid back — a standard credit-risk screening problem where the cost of a false negative (approving a loan that defaults) and a false positive (declining a loan that would have been repaid) are asymmetric and business-defined, not something the model itself can resolve.

02// decision.md

Decision Supported

Whether an applicant's profile is risky enough to warrant manual underwriting review or a different loan term, ranked by predicted probability of repayment rather than a hard accept/reject cutoff.

03// dataset.md

Dataset

593,994 labeled training loans and 254,569 unlabeled test loans, each with 10 features: annual income, debt-to-income ratio, credit score, loan amount, interest rate, gender, marital status, education level, employment status, loan purpose, and a combined grade/subgrade risk tier (e.g. "C3"). The target is imbalanced — 474,494 loans paid back vs. 119,500 not (roughly 80/20).

04// architecture.md

Architecture

A single CatBoostClassifier (depth 6, learning rate 0.03, L2 leaf regularization 3, up to 3,000 boosting iterations with early stopping after 200 rounds without improvement) trained natively on the categorical columns with no manual encoding, inside a 5-fold stratified cross-validation loop — out-of-fold predictions are collected for an honest CV score, and the 5 fold models' test-set probabilities are averaged for the final submission.

05// baseline.md

Baseline

No explicit naive baseline (e.g. always predicting the ~80% majority class) was computed alongside CatBoost, though that trivial baseline would score roughly 80% accuracy while carrying no discriminative value — the ROC-AUC metric used instead is largely insensitive to this class imbalance.

06// evaluation.md

Evaluation Framework

5-fold stratified cross-validation (preserving the ~80/20 class ratio in every fold), scored on ROC-AUC with log-loss tracked alongside; CatBoost's built-in early stopping uses a held-out validation slice within each fold to decide when to stop boosting.

07// results.md

Results

The last completed fold's training log shows validation AUC ≈ 0.922 (log-loss ≈ 0.243) at iteration 3,000 — a strong score for this class of tabular credit problem. The blended, 5-fold-averaged test-set probabilities were written to a final submission file covering all 254,569 test loans.

08// error_analysis.md

Error Analysis

Only the final fold's training curve was persisted — CatBoost's diagnostic directory gets overwritten on each fold run — so the ≈0.922 figure is representative of one fold rather than a verified pooled out-of-fold score, even though the pooled score was computed in memory during the run. No confusion matrix, calibration check, or per-segment error breakdown (by grade/subgrade or income band) was generated to check whether errors concentrate in specific risk tiers.

09// deployment.md

Deployment Considerations

This is a one-shot competition-style submission pipeline, not a deployed service — no inference API, no monitoring, no retraining schedule. Moving this into a real underwriting workflow would require calibrating the raw CatBoost probabilities (boosted-tree outputs aren't automatically well-calibrated), setting a business-driven decision threshold instead of using AUC as an implicit ranking metric, and auditing the grade/subgrade feature for potential proxy discrimination given its likely correlation with protected characteristics in real credit data.

10// monitoring.md

Monitoring Approach

None — this is a static, one-time training run against a fixed historical dataset. A production version would need drift monitoring on the input distributions (income, credit score) and periodic re-validation of AUC against newly originated loans.

11// limitations.md

Limitations

The 0.922 AUC comes from the last fold's saved log, not a persisted pooled out-of-fold score — treat it as indicative of performance, not as the model's exact validated number.

AUC is threshold-independent and largely insensitive to the 80/20 class imbalance, so it doesn't reveal how well the model identifies the minority (defaulting) class specifically, which is usually the more business-critical error to control.

No calibration check was run on the output probabilities, and boosted-tree classifiers are not inherently well-calibrated — the raw probabilities in the submission file may not be directly interpretable as true default rates.

Categorical features like grade/subgrade, employment status, and marital status were used as-is without checking for correlation with protected characteristics (e.g. gender, marital status) that would need review before any real underwriting use.