Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Chapter 12 — Assignment Project: Auditing a Credit Model

Open in Colab

Overview

A bank asks you to audit a credit model before it is used. The model must be understood (which features drive it, and how), explainable to applicants (why was I refused, and what would change it?), and fair across two groups of applicants. You end with a model card.

The data are generated below. Group membership is not a feature of the model, but you may use it for the audit.

PartTaskPoints
AGlobal explanation20
BLocal explanations for three applicants25
CFairness audit and two remedies30
DModel card25

Part A — Global Explanation (20 points)

  1. Compute the permutation importance of each feature on the test set (accuracy drop, 20 repeats).

  2. age, years_at_job and district_risk all differ by group. Shuffle them together and report the drop.

  3. In a short paragraph: which features drive the model? Which of them could stand in for group membership?

Your paragraph:


Part B — Local Explanations (25 points)

  1. Write a function that estimates Shapley values by sampling 200 feature orders (as in the implementation notebook), with a background of 100 training rows, for the model’s predicted probability of repayment.

  2. Explain three applicants: the one the model is most sure will repay, the one it is most sure will not, and one refused applicant with a probability near 0.4.

  3. For the refused applicant, find the smallest change to one actionable feature (income, debt_ratio or late_payments) that gets them approved. Explain why age and district_risk should not be used for this.

Your explanations:


Part C — Fairness Audit (30 points)

  1. For groups A and B on the test set: base rate of repayment, approval rate, true positive rate and false positive rate. Report the demographic parity and equal opportunity differences.

  2. Remedy 1: retrain without district_risk. Remedy 2: keep the model and choose a separate threshold for B that equalises the true positive rates. Report the same numbers for each, and the accuracy.

  3. Which remedy would you recommend to the bank, and what would you tell them about its costs?

Your recommendation:


Part D — Model Card (25 points)

Write the model card (Section 7 of the implementation notebook): purpose and intended users; data; performance with uncertainty; global and local explanation methods available to applicants; fairness results and the remedy chosen; known limits; human oversight; monitoring plan.

Grading Rubric

CriterionExcellentAdequateInsufficient
A (20)single and group importances, proxies identifiedimportances onlymissing
B (25)three correct explanations, an actionable counterfactual, the non-actionable features arguedexplanations without counterfactualmissing
C (30)full audit, both remedies, a reasoned recommendation with costsnumbers without recommendationmissing
D (25)complete, honest, specificgenericmissing