Explainable Artificial Intelligence (VTR UGE 21), day 5 of 5

Practice, Tooling and Governance

Prof. Dr. Utku Kose, Süleyman Demirel University

Governance lab

Part A matches readers with the artefacts they need. Part B walks through the risk tiers of the Artificial Intelligence Act of the European Union (EU AI Act) and builds a model card. Parts C, E and F repeat three calculations of the case studies step by step, with sliders for their numbers: recourse for the applicant of the lecture, the slope of a window of readings, and how much a spurious token says about the label. Part D computes actionable recourse by hand for a linear credit score. Part G checks four copies of an archived explanation record against its digest. In Parts C, E and F every intermediate value is rounded, and the next step continues with the rounded value, as in a calculation by hand.

Part A: Which artefact for which reader?

Each reader needs a different artefact. Match every reader with the artefact that serves them best and press Check the matches.

ReaderArtefactFeedback

Back to the lecture: From findings to artefacts. The lecture continues there with Section 1 of the Colab notebook: Open it from the next orange box.

Part B: Risk tier and model card

This part has two steps. The first walks a system through a simplified version of the risk tiers of the EU AI Act and lists what the provider, the organisation that develops the system, must be able to produce. It is a teaching aid, not legal advice. The second builds a model card from your entries, attaches a fingerprint and lets you download it as a Markdown file. Its entries use terms of the lecture. The test AUC is the area under the receiver operating characteristic (ROC) curve of the model on test data. LIME stands for local interpretable model-agnostic explanations, and TreeSHAP computes Shapley additive explanations (SHAP) for models built from trees. The measured fidelity is the share of the behaviour of the model near a case that the explanation reproduces.

1. Indicative risk tier

2. Model card builder


Back to the lecture: Explanations and regulation. The lecture continues there with Section 4 of the Colab notebook: Open it from the next orange box.

Part C: Recourse for a linear score, step by step

The worked example of the lecture: a credit score of two features, each scaled to the range from 0 to 1, the income \(x_1\) and the length of the credit history \(x_2\). The score is \(f(x)\)​\({} = 7 (x_1 - 0.55)\)​\({} + 5 (x_2 - 0.5)\), and an application with a score of 0 or more is approved. The sliders place the applicant and set the years that may pass, and every year adds 0.05 to the history. The steps compute the score, the nearest point on the boundary, the change of income alone and the change of income when years pass. The figure shows the approved region, the boundary, the nearest point and the two actionable paths.

Back to the lecture: Case study A: credit scoring and actionable recourse, where the text continues after the box of this part.

Part D: Recourse by hand

A credit model scores applicants with a linear formula and approves a score of zero or more:

score = 2.0 x income (in tens of thousands) - 3.0 x debt ratio + 0.5 x years of credit history - 4.0

An applicant with an income of 18 thousand, a debt ratio of 0.6 and 2 years of history was rejected. Compute three pieces of recourse, each changing one input while the others stay the same.

Back to the lecture: Case study A: credit scoring and actionable recourse. The lecture continues there with Section 5 of the Colab notebook: Open it from the next orange box.

Part E: The slope of a window, step by step

The worked example of the lecture: a short window of five vibration readings at the positions 0 to 4. The sliders set the five readings, and the menu sets the time between two readings. The steps compute the two means, the distances from them, the slope of the least-squares line and the change per hour that a work order states. The figure shows the readings, their mean and the fitted line.

Back to the lecture: Case study B: predictive maintenance. The lecture continues there with Section 6 of the Colab notebook: Open it from the next orange box.

Part F: How much the token says, step by step

The worked example of the lecture: half of the reviews are positive, the token verified appears in 90 percent of the positive and in 10 percent of the negative reviews, and 5 percent of the labels are flipped. The sliders change these four shares. The steps compute how often the token appears, the probability that a review with the token is positive by Bayes' rule, the share of positive labels after the flips and how often a rule that reads nothing but the token is right. The figure divides all reviews by their sentiment and by the token.

Back to the lecture: Case study C: text classification. The lecture continues there with Section 7 of the Colab notebook: Open it from the next orange box.

Part G: Break the seal? Four copies of an archived record

The record of the Python step, case 340 with a fidelity of 0.69 and two attributions, was archived with its digest 8cce1406ba987a12: the first 16 characters of the hash that SHA-256, the Secure Hash Algorithm with an output of 256 bits, computes from its JSON text with the keys in alphabetical order. Four copies of it turn up in four places. Compute the digest of each copy, compare it with the archived digest and mark each copy as unchanged or altered. A copy may list its fields in another order: The digest is computed from the text with sorted keys, so the order of the lines does not matter, only their content.

Back to the lecture: The diagnosis case, stage 5: artefacts for the clinic, where the text continues after the box of this part.