Skip to content
academia.sh

Course Advanced

Model Evaluation, Interpretability and Ethics

Published Updated

By the end of this course

Start course

01

Evaluation Design

Designing the measurement itself and writing down which subgroup every number holds for: the inflated number produced when the same subscriber lands in two sets and the group-based split that undoes it, the same model making two different operating points and two different decisions under two cost matrices, how many baselines a problem has and how the choice of baseline makes the same model read two different ways, how much narrower a margin the paired comparison gives for the difference between two models than the independent comparison, the difference between the training distribution and the production distribution reduced to a single number, and covariate shift and label shift calling for different fixes.

  1. 01 Validation Strategies Measuring the same number separately on the whole and on thirteen subgroups, and testing whether the held-out set was truly held out: a depth-6 decision tree beats the baseline on the test set by 0.0198 yet falls below the baseline in five of the subgroups, and the gap among the twelve subgroups with an n above 25 comes out at 0.3576. The same subscriber landing in both sets in the 3,199-row reading table splits 416 subscribers across them and raises the difference above the baseline at depth 12 from 0.0108 to 0.1000; the group-based split undoes this 0.0892 inflation. The inflation corrupts not only the overall number but the gap as well: the subgroup gap that reads 0.1718 in the row split is 0.3846 in the group-based split.
  2. 02 Metric Selection The same model taking two separate operating points and making two separate decisions under two cost matrices: in the structure where inspection is costly the selected threshold is 0.95 and 17 of 252 subscribers are flagged, in the structure where illicit use is costly the threshold is 0.25 and 77 are flagged; the decision of 60 subscribers flips between the two structures. The baseline moves with the cost as well — flagging nobody is 0.2421 in one, flagging everybody is 0.7579 in the other. A single threshold spreads the gain across subgroups from +0.4138 to -0.4468, the gap is 0.8606 and in four of twelve subgroups the model stays below its own baseline; choosing a subgroup-specific threshold lowers the test cost in only four of them.
  3. 03 Baseline Model Measuring that the baseline is not a tool but a design object: the same depth-6 decision tree reads between -0.0119 and +0.5357 against eight baseline candidates, and the choice alone moves the number by 0.5476. A lookup-table baseline has a capacity of its own — with five cells it ties the model at 0.7579, with fifteen cells it beats the model at 0.7897, with thirty-nine cells it drops to 0.7500. The choice of baseline changes direction in the subgroups too: the model that falls below the most-frequent-class baseline in four of twelve subgroups falls below the region-and-tier lookup table in eight, and the difference gap shrinks from 0.2173 to 0.1351. The baselines chosen in the seven courses of the Machine Learning and Data Science curriculum are collected in a single table.
  4. 04 Statistical Significance Measuring the margin of the difference between two models and counting how much narrower a margin the paired comparison gives than the independent comparison: the margins of all the differences between the depth-6 decision tree and its four rivals contain zero, and only the 0.5357 difference stays outside. On the same 252 subscribers the paired margin runs from 0.0476 to 0.0794 and the independent margin from 0.1190 to 0.1310; the more the two models agree, the narrower the margin. As the set grows from 63 to 504, the paired margin falls from 0.1111 to 0.0556. Among the subgroups, the margin excludes zero for only four of thirteen differences, and +0.1389, one of the largest subgroup contributions of the course, is not one of them.
  5. 05 Distribution Shift Reducing the difference between training and production data to a single number and placing that number next to the drop in performance: a discriminator model reads a shift score of 0.1172 under covariate shift and the model's difference above the baseline falls from 0.0198 to 0.0066, but under label shift the same indicator stays at 0.0063 while the suspicious rate climbs from 0.2421 to 0.4865. The two shifts call for two separate fixes: prior correction raises accuracy from 0.6306 to 0.6622 under label shift while changing no decision under covariate shift, and retraining on the input distribution raises 0.7318 to 0.7384 under covariate shift and drops label shift to 0.6261. On the time-ordered production set the subgroup gap falls from 0.3576 to 0.2573, and in none of the twelve subgroups does the model stay below the baseline.

02

Interpretability

Measuring whether what the model bases its number on can be read: how many of the questions that can be asked about a decision are answered by the output and how many by an explanation, in how many ranks the importance ranking read from the model and the ranking measured by permuting disagree, and how two correlated features split the importance, how many examples the local surrogate describes the decision of the original model correctly and how two methods give two different explanations for the same example, how a partial dependence that looks flat overall slopes in opposite directions in two subgroups, where the accuracy arrives as the rule list grows, and in which subgroup the best family cannot be approached.

  1. 01 The Need for Interpretability Counting how many of the twelve questions that can be asked about a decision are closed by the model's output, how many by an explanation, and how many by neither: the output alone closes 4 questions, the explanation raises the average to 8.58, and three questions are closed by no explanation. The one-step change at which the decision flips exists for 159 subscribers of the test set and for 2 of the thirty-two subscribers in the west region; thirteen subgroups were examined, and among the twelve that pass the threshold the number of closed questions ranges from 8.89 at best to 7.88 at worst, a gap of 1.02 questions.
  2. 02 Feature Importance Measuring two global importance rankings side by side on the same model: the ranking read from the coefficients and the ranking measured by permuting the column disagree on ten of the twelve columns, and the largest shift is five ranks. Volatility is third in the coefficient ranking and eighth in the permutation ranking. Two correlated columns split the importance: the importance of consumption per person is 0.0018 in the full model and rises to 0.0387 when mean consumption is removed and the model is retrained. Across thirteen subgroups, the loss increase of the most important column ranges from 0.0162 to 0.1882, and in one subgroup the first place changes.
  3. 03 Local Explanation Methods Asking two methods that explain a single prediction about the same subscribers and measuring the faithfulness of the explanation: the local surrogate gets an average of 0.9417 of the neighborhood decisions right, but for 41 of the 252 subscribers the neighborhood holds a single label, so the explanation comes out empty. The contribution share points to a different column than the surrogate in 145 of the 211 filled explanations. Faithfulness is highest in the west region at 0.9664, where the empty-explanation rate is 0.4688; the lowest faithfulness, 0.9027, is in the top tariff tier, and the gap is 0.0637.
  4. 04 Partial Dependence and Interaction Printing what a column does to the model as a whole as numbers and counting what the average hides: in the decision tree, three of the five columns look flat in the whole, and in two of them the subgroups slope in opposite directions. The partial dependence of household size is flat in the whole at -0.0069, +0.1301 in the third tariff tier, -0.1891 in the east region, and the gap is 0.3192. In satisfaction the gap is 0.2189. The number of readings has a slope of exactly 0.0000 both in the whole and in all twelve subgroups: not every number that looks flat hides an interaction.
  5. 05 Inherently Interpretable Models Measuring the cost of building the model readable from the start instead of producing the explanation afterward: a sequential list of two rules and four conditions gives 0.7897 on the test set, leaving a gap of 0.0159, that is, four subscribers, to the 0.8056 of the best family with thirty-three columns. Extending the list to three and four rules does not get closer; it drops back to 0.7857. Thirteen subgroups were examined, and in six of the twelve read, the best family cannot be approached within 0.02; the farthest is the central region, 0.6552 instead of 0.7414, a gap of 0.0862. In three subgroups the rule list beats the best family.

03

Ethics and Responsibility

Counting who is harmed by a system whose measure looks good: measuring data, label and deployment bias separately and seeing all three hit the same number by different paths, the impossibility of satisfying demographic parity, equal opportunity and predictive parity at the same time and how much fixing one breaks the others, how much adding or removing a single record moves the output, and reading side by side what is lost from accuracy and what is lost from recall as the noise level is swept, why anonymization alone is not enough, how many of the questions of a person who inherits a model are answered by the documentation, the number moved by the single item that is not pinned and the total number of items accumulated across the curriculum.

  1. 01 Sources of Bias Counting separately that the same harm arises in three different places: the linear model measured on thirteen subgroups gives 0.8194 accuracy and 0.3704 recall overall, while recall stays at 0.2222 for subscribers with few readings. Because of the 69 subscribers who never enter the table, the share of few-reading subscribers reads 0.3349 instead of 0.3695; a training set built only from full-reading subscribers lowers precision in that subgroup from 0.5455 to 0.3774, the 19 suspicious cases that never reach the record drop recall to 0.0370, and a capacity of forty visits applied to the same subgroup at a rate of 0.0359 leaves recall at 0.1111. In all three, overall accuracy moves by at most 0.0337.
  2. 02 Fairness Metrics Counting that three fairness criteria cannot be satisfied at the same time: with a base rate of 0.4578 in the east region against 0.1663 in the other four regions, a single threshold gives a parity gap of 0.3984, an opportunity gap of 0.4842 and a predictive gap of 0.1242. While the same number of subscribers is flagged, tuning the threshold pair to demographic parity raises the predictive gap to 0.4800, tuning it to equal opportunity raises it to 0.4262, and tuning it to predictive parity raises the opportunity gap to 0.7038. The identity that the selection rate is the product of recall and base rate divided by precision is verified, and when two criteria are equalized the ratio of selection rates is shown to lock to the ratio of base rates, 2.7535; with capacity fixed there is no threshold pair that gives all three together, and the best attempt leaves a gap of 0.2727.
  3. 03 Privacy-Preserving Learning Counting from the defense side what the model says about its own training records: in a 1,260-row table with the subscriber ID deleted, four subgroup axes produce 72 combinations and 6 records stand alone, and when the sixth field is added this number rises to 1,242, that is, to 0.9857. Removing a single training record moves the output of the linear model by at most 0.0313 and changes two predictions; the same record moves the output by 0.7778 and changes 14 predictions in the model built on the cell table, because 13 of the 66 cells hold a single record. When noise is swept over ten levels, masking the trace of the linear model asks for 0.04 noise and 0.0022 of accuracy, while that of the cell model asks for 0.80 noise and falling 0.1669 below the baseline.
  4. 04 Model Documentation Counting which of the questions of the person who takes over the model are closed by a written statement: the same model gives 0.7778 accuracy overall on the test set and 0.0198 above the baseline, while in 12 measurable subgroups of the 14 built on four axes the best reads 0.9688 and the worst 0.6111, the subgroup gap is 0.3576 and three subgroups fall below their own baseline. Of the handover question set of twenty-two questions, the statement that carries only the number measured overall closes 5, the statement that adds the subgroup table closes 12, and the statement that also writes the usage limit closes 18; the remaining 4 questions close in no version because none of them is a measurement question. In five usage decisions the first version produces 4 wrong decisions and the second 1, while the third produces none because it can say unknown for the unmeasured subgroup.
  5. 05 Reproducibility Counting the items that must be fixed for the same number to be produced a second time, and how much a single unfixed item moves it: 6 of the evaluation's own 9 items each move the test count on their own, the largest shift being 0.0370 or 7 subscribers; 8 of the same items move the subgroup gap, and the largest shift is 0.0989, 2.7 times what is read overall. When the minimum subgroup size is released, neither headline number changes at all but the measured subgroups fall from 12 to 11. On top of the 39 items of the Data Collection and Preparation course, the 9 of the Data Analysis with Python course, the 11 of the Visualization, Reporting and Analysis at Scale course, the 4 of the Data Preparation and Feature Engineering course and the 8 of the Deep Learning course, the evaluation's 9 items are added and the full list of the curriculum reaches 80. The course wrap-up gathers the fifteen lessons overall and in the worst subgroup, and the curriculum wrap-up gathers the eight courses and 121 lessons of the Machine Learning and Data Science curriculum in a single table.

Final exam

Model Evaluation, Interpretability and Ethics — Final Exam

In preparation

This course's question bank is not complete yet. The exam opens here automatically once enough questions are added.

Start typing to search.

↑↓ ↵ Esc navigate · open · close