CourseAI / ML Engineer: The Complete Course · Module 14: Responsible ML · part 85 of 93
Part 85 · Module 14: Responsible ML

Lab: Fairness, explanations and the model card for v2

202 min read·
Module 14 · Lab · About 60 minutes · Needs: lessons 1 and 2 of this module, and the Module 13 lab (or nothing: Step 1 rebuilds Modules 1 to 13)

What you are building

Responsible ML, on the real v2 Measure, explain, trace, decide Active flow 1 Processing step number Model v2 ModelV2() hash 8c7d74ca8275 two adapters AsLesson, TreeView Lessons' tools fairness by island, nation, depot explanations SHAP, what-if audit trail record to rebuild deploy checks five limits Evidence and decision reports/ fairness.md docs/ model-card.md ADR-010 mainland routes only 1 2 3 4
Model v2 enters the lessons' fairness, explanation, audit and deploy tools through two adapters (blue, teal); the measured results become the generated fairness report, the model card and ADR-010 (gold); circles give the order.

Adaeze signs the model card on Monday, and Hannah wants to know first whether v2 is fair to the customers it serves worst. This lab produces the evidence for both on the model Kestrel actually runs: the fairness report reports/fairness.md, generated from v2's scores; explanations a customer and a regulator could read; an audit trail that traces one warning back to a registered model and rebuilds it; and the documents that close the module, docs/model-card.md and ADR-010, which decides whether v2's warnings go to island routes.

Both lessons fitted a stand-in they called "v2": a plain LightGBM with other settings and no calibration. The lab uses the real model v2 from kestrel/train_v2.py, through two small adapters, and reports where the lessons' numbers and v2's differ. No cell calls a hosted model.

Open a new Colab notebook, call it module-14-lab.ipynb, and run each cell in order.

The rest of this course is yours to keep

This course is bought on its own, once, and stays readable afterwards, including the parts added to it later.

Or open everything with a plan