LIME (Local Interpretable Model-agnostic Explanations)
When a model makes a prediction you don’t expect—like denying a loan or flagging an email as spam—you usually want a “because…” that makes sense to a human. LIME is a popular way to produce that kind of explanation for one specific prediction, even if the underlying model is a black box.
What LIME does
LIME (Local Interpretable Model-agnostic Explanations) explains a single prediction by building a simple, human-friendly model that mimics the complex model near the particular example you care about. “Model-agnostic” means it treats the original model as something you can query (input → output) without needing to inspect its internals, so it works with neural nets, random forests, gradient-boosted trees, and more.
How it works (mechanism)
- Perturb the input: Create many slightly modified versions of the original example (e.g., tweak feature values; for text, remove/keep words).
- Query the black box: Get the model’s predictions for each perturbed sample.
- Weight by proximity: Give higher weight to perturbed samples that are more similar to the original input (this enforces “local”).
- Fit a simple surrogate: Train an interpretable model (commonly sparse linear regression) on the weighted data.
- Read the explanation: The surrogate’s coefficients act as local feature attributions for that one prediction.
Why it matters in supervised learning
LIME helps with debugging and trust: in credit scoring, it can show that “high utilization” and “recent delinquencies” drove a denial; in churn prediction, it can highlight “drop in usage” and “support tickets” for one customer. Its key limitation is that it’s only as faithful as the local surrogate and the perturbation strategy—poor perturbations can yield explanations that look plausible but don’t reflect the true model behavior.
LIME (Local Interpretable Model-agnostic Explanations) is a post-hoc explainability method that explains a single prediction by fitting a simple, interpretable surrogate model (e.g., sparse linear model) on perturbed samples near the instance and using it to estimate local feature contributions. It matters because it provides model-agnostic, instance-level explanations for complex supervised models, supporting debugging, validation, and compliance when global interpretability is unavailable.
Imagine a doctor who can’t fully explain a complicated test result, but can still point to the few clues that mattered most for this one patient. LIME (Local Interpretable Model-agnostic Explanations) does something similar for AI predictions.
When a model says “this email is spam” or “this loan is risky,” LIME gives a simple, human-friendly explanation for that single decision. It highlights which parts of the input (like certain words in the email or details in an application) pushed the prediction up or down. “Model-agnostic” means it can work with almost any kind of model, even a black-box one.