Loan default prediction · XGBoost

Will they pay it back?
A model that explains its answer.

CreditRisk AI scores a loan application's probability of default in real time, then states its decision — approve, review, or reject — alongside the three reasons that drove it.

92.4%
Test AUC
92.0%
Precision
63.9%
Recall
32,581
Applications trained on
01

Lenders are flying blind

In the dataset behind this model, 7,102 of 32,581 borrowers — better than one in five — defaulted on their loan. Traditional underwriting struggles to catch them ahead of time.

  • Many applicants, especially MSMEs, have no formal credit history to score against.
  • Manual underwriting is slow, and two reviewers rarely agree on the same case.
  • When a loan is rejected, there's usually no record of why — so nothing improves.
21.8%
of applicants in the training data defaulted — 7,102 out of 32,581 loans. That base rate is what any underwriting process, manual or automated, has to beat.
02

How the model decides

An XGBoost classifier reads ten features off the application — income, loan size, interest rate, credit grade, employment and credit history — and outputs a single probability of default. That probability is then routed through three fixed thresholds:

Approve
PD < 30%
Safe borrower. About 70% of applicants land here.
Review
30% – 50%
Moderate risk, sent to a human. ~10% of applicants.
Reject
PD > 50%
High risk of default. ~20% of applicants.

What the model learned matters most

Loan-to-income ratioborrowing 50% of income vs. 10%
174.3
Credit gradegrade A rarely defaults, grade F often does
142.5
Home ownershiprenters carry more risk than owners
129.3
03

Try an application

Move the sliders to sketch out a borrower. The read-out below reconstructs the trained model's logic and thresholds from the project's documented feature weights, so you can feel how each factor moves the decision — the full XGBoost + SHAP pipeline lives in the repo's notebook.

$80,000
$5,000
5.0%
A
10 yrs
5 yrs
0

Probability of default

0.7%
Loan-to-income: 6%
APPROVE
Illustrative reconstruction for this showcase — not the production model artifact (credit_risk_model.pkl) from the repo.
04

Checked against five real profiles

ProfileProbability of defaultDecisionResult
Perfect borrower0.40%Approve✓ correct
Good borrower0.52%Approve✓ correct
Moderate risk borrower9.79%Approve✓ correct
High risk borrower99.46%Reject✓ correct
Worst case borrower99.42%Reject✓ correct
0.9241
Validation AUC
0.9237
Test AUC
64%
Defaulters caught (recall)
8%
Good borrowers wrongly flagged
05

Where this model stops

By design, it does not

  • Guarantee accuracy — no model can.
  • Consider gender, race, or other demographic factors.
  • Replace human judgment on borderline cases.
  • Optimize the loan amount itself, only assess the one requested.

Known limitations

  • Recall sits at 64% — about a third of true defaulters slip through.
  • Trained on U.S. data; may not transfer to other markets as-is.
  • No alternative data yet (UPI, GST, telecom) for thin-file applicants.
  • Static weights — doesn't adapt as economic conditions shift.