Explainable Artificial Intelligence (VTR UGE 21), day 1 of 5
Prof. Dr. Utku Kose, Süleyman Demirel University
Part A places eight explanations from practice on the map of methods. Parts B and C repeat two calculations of the lecture step by step, with sliders for their numbers: one prediction of a logistic regression and the first question of a tree. Part D follows five patients through a small decision tree by hand. Part E compares interpretable models on simulated tumours with two measurements and records accuracy against the number of values a reader must hold in mind. Part F repeats the area under the curve (AUC) by counting pairs step by step, also with sliders. In Parts B, C and F every intermediate value is rounded, and the next step continues with the rounded value, as in a calculation by hand. Part G trains a spam filter by hand on eight e-mails, which move between the inbox and the spam folder as the weights change.
Each card describes an explanation used in practice. Decide whether it describes the whole model or one prediction, and whether it comes from a model that is readable by design or is computed after training. Then press Check the cards.
Back to the lecture: A map of explanation methods, where the text continues after the box of this part.
The worked example of the lecture: a logistic regression with three features, the weights \(-0.9\), \(-1.2\) and \(0.7\) and the bias \(b = 0.3\). The sliders set the scaled values of one patient, each counted in standard deviations from the mean of the training tumours, and the bias. The steps compute the contributions, the score, the probability of benign and the odds. The left figure adds the contributions up to the score, and the right one places the score on the logistic curve.
Back to the lecture: Models that explain themselves. The lecture continues there with Section 3 of the Colab notebook: Open it from the next orange box.
The worked example of the lecture: The root of the tree holds the 426 training tumours, 159 malignant and 267 benign. A question sends some of them to the left and the rest to the right. The sliders set how many malignant and how many benign tumours go to the left. The steps compute the Gini impurity of the root, of both sides and of the split, and the share of training tumours that the question alone classifies correctly. The left figure shows the classes at the root and on both sides, and the right one places the three nodes on the curve \(G = 2p(1 - p)\).
Back to the lecture: Models that explain themselves, where the text continues after the box of this part.
The tree below is a small illustrative classifier for tumours. Follow each patient from the top question to a leaf, choose the prediction and press Check the paths. The feedback shows the path the tree takes.
Is worst concave points at most 0.14?
├─ yes: Is worst radius at most 17.0?
│ ├─ yes: benign
│ └─ no: malignant
└─ no: Is worst texture at most 19.0?
├─ yes: benign
└─ no: malignant
| Patient | Worst concave points | Worst radius | Worst texture | Your prediction | Feedback |
|---|
Back to the lecture: Models that explain themselves. The lecture continues there with Section 4 of the Colab notebook: Open it from the next orange box.
Choose a model family and its setting, then press Run and add to scoreboard. The panel shows the decision regions on held-out tumours. Every run is added to the scoreboard below as one point: Test accuracy against the number of values a reader must hold in mind to reproduce a prediction.
Find the run with the highest accuracy for the fewest values. Then increase the depth until the accuracy stops improving: The point where the frontier flattens is the place to stop adding complexity.
| Run | Model | Values to read | Test accuracy |
|---|
Back to the lecture: Accuracy and readability, where the text continues after the box of this part.
The worked example of the lecture: three benign and two malignant tumours with their probabilities of benign. Every pair of one benign and one malignant tumour is checked. It counts as correctly ordered when the benign tumour has the higher probability, and as one half when both probabilities are equal. The sliders set the five probabilities, and the figure places the tumours on the axis of probabilities and draws every pair that has been checked.
Back to the lecture: Accuracy and readability. The lecture continues there with Section 5 of the Colab notebook: Open it from the next orange box.
The filter is a logistic regression on five words: Each e-mail gets the score \(z = b + \sum_j w_j x_j\), where \(x_j\) counts how often word \(j\) occurs, and it lands in the spam folder when \(p = \sigma(z) > 0.5\), that is when \(z > 0\). The tag on each card gives its true class. Set the weights so that every e-mail lands in the right folder, and use as few words as possible: A weight of 0 means that the filter ignores the word, so a filter with few words is easier to read. Click a card to see the contributions of its words.
Back to the lecture: Explanations in your field. The lecture continues there with Section 7 of the Colab notebook: Open it from the next orange box.
Answer each question, rate your confidence and check the answer. Results stay in this browser.
Write a short answer to each question. The text is saved in this browser and is included when you export the learning log.