What is model explainability, and how do methods like SHAP and LIME work?
Explainability is making a model's predictions understandable to humans. LIME (Local Interpretable Model-agnostic Explanations) explains a single prediction by perturbing the input, seeing how outputs change, and fitting a simple linear model locally around that point. SHAP (SHapley Additive exPlanations) draws on cooperative game theory, attributing each feature a Shapley value — its average marginal contribution to the prediction across feature orderings — giving locally accurate, consistent attributions. Both are post-hoc and model-agnostic (SHAP has fast variants like TreeSHAP). Caveats: explanations are approximations, can be unstable, and aren't the same as causation or true model reasoning. For high-stakes cases, inherently interpretable models are sometimes preferable to explaining a black box.