By Fatskills Exam Guides Team — the exam nerds behind 28,500+ quizzes and 2.1M practice questions across 500+ global exams.
Model Governance and Responsible AI are the policies, tools, and practices that keep machine‑learning systems trustworthy, fair, and transparent. In a production pipeline you must detect bias, explain predictions, and measure fairness before you ship a model—otherwise you risk regulatory penalties, brand damage, or harmful decisions (e.g., a churn‑prediction model that systematically downgrades minority customers).
[ \underset{g \in G}{\arg\min}\; L\big(f, g, \pi_x\big) + \Omega(g) ]
where πₓ weights perturbed samples by proximity to x. - SHAP (SHapley Additive exPlanations) – assigns each feature i a contribution ϕᵢ based on Shapley values:
[ \phi_i = \sum_{S \subseteq N\setminus{i}} \frac{|S|!\,(|N|-|S|-1)!}{|N|!}\,\big[ f_{S\cup{i}}(x_{S\cup{i}}) - f_S(x_S) \big] ]
(N = set of all features). - Counterfactual Explanation – “What minimal change to input x would flip the prediction?” often solved by optimization:
[ \min_{\Delta x}\; |\Delta x|p \quad \text{s.t.}\; f(x+\Delta x)=y ]} - Fairness‑aware loss – e.g., Demographic Parity regularization:
[ \mathcal{L}{\text{fair}} = \mathcal{L} | ] }} + \lambda \,| \text{SPD
λ controls the trade‑off between accuracy and fairness. - Calibration Curve – plots observed frequency vs. predicted probability; mis‑calibration can hide bias. - Model Card – a concise documentation template (model name, intended use, metrics, ethical considerations) that accompanies any released model.
X, y, A = load_data(); X_train, X_test, y_train, y_test, A_train, A_test = train_test_split(..., stratify=y)
LogisticRegression
lime.lime_tabular.LimeTabularExplainer
shap.TreeExplainer
aif360
Reweighing
Mistake: Only checking overall accuracy. Correction: Always compute group‑wise metrics; a model can be 90 % accurate overall but 70 % accurate for a minority group.
Mistake: Treating SHAP values as causal explanations. Correction: SHAP quantifies association; it does not prove that changing a feature will change the outcome. Use counterfactuals for causal “what‑if” analysis.
Mistake: Applying LIME on high‑dimensional sparse data without dimensionality reduction. Correction: Reduce features (e.g., via TF‑IDF → top‑k) or use LimeTabularExplainer with feature_selection='auto' to keep explanations stable.
LimeTabularExplainer
feature_selection='auto'
Mistake: Hard‑coding a single fairness threshold for all projects. Correction: Align thresholds with domain risk (e.g., stricter for credit scoring vs. movie recommendation) and document the rationale.
Mistake: Skipping calibration before fairness checks. Correction: Poorly calibrated probabilities can inflate disparity metrics; calibrate with CalibratedClassifierCV first.
CalibratedClassifierCV
Scenario: Your churn model shows SPD = ‑0.25 (unprivileged group churns less often). Answer: The model is biased against the privileged group; you need to reduce the absolute SPD (e.g., reweigh training samples).
Scenario: After adding a fairness regularizer, validation loss rises but SPD drops to 0.02. Answer: This is the expected accuracy‑fairness trade‑off; decide whether the fairness gain outweighs the loss in predictive performance.
Scenario: SHAP summary plot shows “age” has the highest mean absolute contribution, but the feature is not in the data dictionary. Answer: Likely a data leakage issue—age may be encoded indirectly (e.g., via zip code); remove or mask it before retraining.
kernel_width
Join 4M+ learners. Unlock unlimited quizzes, wrong-answer tracking, flashcards + reminders, study guides, and 1-on-1 challenges.