Machine Learning

Unit 6: Advanced Topics & MLOps (Bonus) / Explainable AI (XAI) & Ethics


5. Explainable AI (XAI) & Ethics

As machine learning models (especially Deep Learning and Ensembles) become more complex, they become Black Boxes. We can see the input and the output, but we don't know why the model made that decision. In fields like healthcare, finance, and criminal justice, interpretability is not just preferred—it is legally and ethically required.

Algorithmic Bias and Fairness

Models learn from historical data. If historical data contains human biases (e.g., gender bias in hiring data, racial bias in loan approvals), the ML model will learn, amplify, and automate that bias.

"A machine learning model is just money laundering for human bias."

Explainable AI (XAI) Techniques

XAI aims to open the black box by providing mathematical proofs or visual cues as to which features drove a specific prediction.

LIME

Local Interpretable Model-agnostic Explanations

  • How it works: It takes a single prediction, slightly alters the input data (perturbation) hundreds of times, and sees how the black-box model's prediction changes.
  • It then fits a simple, interpretable linear model locally around that specific prediction to explain it.
SHAP

SHapley Additive exPlanations

  • How it works: Based on Game Theory. It treats each feature (e.g., 'Age', 'Income') as a player in a game, and the 'payout' is the prediction.
  • Calculates the exact marginal contribution of each feature to the final prediction, ensuring mathematical fairness.