Credit-Default Scorecard
A loan-level model that estimates how likely a borrower is to default. I built it the way banks actually build credit models, with weight-of-evidence (WOE) binning and logistic regression, so every prediction can be explained. Then I benchmarked it against an XGBoost challenger with SHAP. It's trained on public LendingClub data, which stands in for the kind of proprietary credit-risk work I do day to day.
credit-risk-scorecard/train.py to populate it with values learned from real data.
Try it live
Adjust an applicant’s profile and the model scores it right in your browser, instantly. No server, nothing sent anywhere.
Each bar is that feature’s exact contribution to the score (points added or removed). Because the model is additive, the pieces add up to the total. It's the same idea as a SHAP explanation, just computed out in the open.
Model performance





Charts appear after you run train.py (it writes them into public/credit-risk/).
How it works
- Label. Completed LendingClub loans are labelled default (charged-off) vs. paid; in-flight loans are dropped to avoid unknown outcomes.
- WOE binning. Each feature is binned and mapped to its weight-of-evidence (the log-odds of good vs. bad), which linearises the relationship and keeps the model monotonic and easy to read.
- Scorecard. A logistic regression on the WOE features produces calibrated probabilities, scaled into a familiar points-based credit score (PDO scaling).
- Challenger + SHAP. An XGBoost model is trained as a performance ceiling; SHAP confirms the drivers agree with the scorecard’s logic.
- Validation. Held-out ROC-AUC, KS, Gini, and a calibration curve, the metrics a model-risk review actually asks for.