Machine Learning · Chapter 40 of 40
Ethics & Responsibility
ML systems can amplify BIAS in data. Audit your data and outputs — especially for gender, race, age and other sensitive attributes.
Explainability, fairness, privacy and consent are as important as accuracy.
Example 1 (python)
# Check disparate impact across groups
from sklearn.metrics import confusion_matrix
# Compute metrics separately for each groupSlice metrics by demographic group.
Example 2 (python)
# Explainability: SHAP, LIME
# Privacy: differential privacy, federated learningModern tools for responsible ML.
Key points
- Data reflects human bias.
- Audit outputs across groups.
- Explainability tools: SHAP, LIME.
- Never deploy without a fairness check.
💡 Note: A model that's 99% accurate but denies loans to one demographic is not a success — it's a lawsuit waiting to happen.
