LIME: Local Interpretable Model-agnostic Explanations
Local Interpretable Model-agnostic Explanations (LIME) · Also known as: Local Surrogate Explanations, Model-Agnostic Local Explanations, Locally Faithful Approximations, Yerel Yorumlanabilir Model-Bağımsız Açıklamalar
LIME, introduced by Ribeiro, Singh, and Guestrin in 2016, explains the predictions of any black-box classifier or regressor by building a simple, locally faithful surrogate model around a single prediction of interest. Rather than explaining the global model, LIME focuses on why a specific instance was classified the way it was, making complex models such as deep neural networks and ensemble methods interpretable to end-users, domain experts, and auditors.
Read the full method
Sign in with a free account to read this section.
Method map
The neighbourhood of related methods — select a node to explore.
When to use it
Use LIME when you need human-readable, instance-level explanations for any black-box model — neural networks, gradient boosting, SVMs, or opaque APIs — without modifying the model itself. It is well-suited for tabular, text, and image data. LIME assumes local linearity: the black-box behaves approximately linearly near the instance of interest. It is less reliable when the decision boundary is highly non-linear even locally, when the feature space is very high-dimensional, or when the perturbed samples are out-of-distribution. For global explanations consider SHAP; for contrastive reasoning consider counterfactual explanations.
Strengths & limitations
- Model-agnostic: works with any classifier or regressor that can produce predictions, requiring only query access to the black box.
- Instance-level granularity: produces tailored explanations for each prediction rather than summarising global model behaviour.
- Human-interpretable output: sparse linear models with few features are readable by non-technical stakeholders and domain experts.
- Supports multiple data modalities: tabular features, raw text (word toggles), and images (superpixel masks) within a single unified framework.
- Local fidelity only: explanations are valid near the explained instance and may not reflect the model's behaviour elsewhere in the feature space.
- Instability: small changes to the instance or the random seed for neighbourhood sampling can produce noticeably different explanations, reducing reliability.
- Kernel sensitivity: the choice of kernel width sigma substantially affects which neighbourhood samples are emphasised, yet there is no universally principled selection criterion.
- Out-of-distribution samples: perturbed neighbours may lie in regions the original model was never trained on, potentially producing misleading fidelity estimates.
Frequently asked
How is LIME different from SHAP?
Both methods explain individual predictions of black-box models, but they differ in foundation and consistency. SHAP computes Shapley values from cooperative game theory, guaranteeing properties such as local accuracy and consistency across all features. LIME fits a locally weighted surrogate and its explanations can vary with random sampling. SHAP is generally more stable and theoretically grounded; LIME is faster and more flexible across data modalities.
How many perturbed samples are needed for a reliable LIME explanation?
The original LIME implementation defaults to 5 000 perturbed samples per explanation, which is usually sufficient for tabular and text tasks. Highly non-linear decision boundaries or very high-dimensional feature spaces may require more samples to achieve stable coefficient estimates. In practice, users should check explanation stability by re-running LIME with different seeds and increasing sample count if coefficients vary substantially between runs.
Can LIME explain regression models as well as classifiers?
Yes. LIME is model-agnostic and works for any function that maps an input to a scalar or probability output. For regression, the black-box output is the continuous predicted value, and LIME fits a locally weighted linear surrogate to approximate that output near the instance of interest. The resulting coefficients indicate which features most strongly influence the predicted magnitude in the local neighbourhood.
Sources
- Ribeiro, M. T., Singh, S., & Guestrin, C. (2016). "Why should I trust you?": Explaining the predictions of any classifier. ACM SIGKDD, 1135–1144. DOI: 10.1145/2939672.2939778 ↗
How to cite this page
ScholarGate. (2026, June 2). Local Interpretable Model-agnostic Explanations (LIME). ScholarGate. https://scholargate.app/en/machine-learning/lime
Which method?
Set this method beside its closest kin and read them side by side — the library lays the books on the table; the choice is yours.
- Counterfactual ExplanationsMachine learning↔ compare
- Random ForestMachine learning↔ compare