Making Credit Decisions Explainable
A loan default model with an explanation layer for the people who must rely on it: analysts, executives and regulators. Its most useful result was showing what needed fixing.

A credit model that cannot explain itself is hard to trust, hard to validate and hard to defend to an applicant who has been declined. I built a loan default model, then built the part most modelling projects skip: a layer that explains each decision to the people who have to rely on it.
What I built
An XGBoost model trained on about 144,000 loans, 9% of which defaulted, tuned with Hyperopt and tracked in Neptune. On top of it sit four kinds of explanation, each answering a different question:
- Deepchecks: where does the model go wrong? It isolates the segments where wrong declines and missed defaults cluster.
- SHAP: what drives the model, and what drove this decision? A global view across all loans, and a breakdown of any single prediction.
- Anchors: which simple rule holds a decision in place? For example, the model predicted default whenever principal repaid was 2,039 or less, a rule that held for 98% of the loans it covered, about a quarter of the sample.
- Counterfactuals: what would have to change to flip a decision? Generated with Alibi and Microsoft’s DiCE.
Three audiences, three kinds of explanation
- Analysts use the global view and the weak segments to debug and improve the model.
- Executives need the model’s errors as business trade-offs: the revenue lost when a good borrower is declined, against the loss when a default is missed.
- Regulators and model validators need every decision traceable to its factors, in order, and evidence that the model behaves consistently across segments.

What the explanations revealed
This is the part I value most. The global view shows that the model’s strongest signal by far is principal already repaid: information that only exists after a loan has been made, and that a lender would not have when deciding on an application. The accuracy figures gave no hint of this; one SHAP chart made it obvious.
The same chart shows gender and marital status among the inputs. Their influence is close to zero, which is reassuring, but in U.S. lending they should not be inputs at all.
That is the real case for explainability in banking: it shows not only why a model decides, but whether it should be trusted to.
What I would change before using it in a bank
- Train only on information available at the moment of application.
- Use protected characteristics only to test for fairness, never as inputs.
- Oversample only the training data, so test results reflect real loans.
- Feed the explanations into the reasons given to declined applicants, and into independent model validation.