Peeking inside the black box, one prediction at a time
LIME exists to make black-box classifiers accountable by explaining exactly which features drove any single prediction.

What it does LIME tells you why your classifier predicted what it did for a single instance. Feed it text, a table row, or an image, and it returns a human-readable breakdown of which features pushed the prediction toward each class. It only requires that your model accept raw text or numpy arrays and output a probability per class; scikit-learn support is built-in.
The interesting bit Rather than trying to interpret the entire model globally, LIME treats the classifier as a black box, perturbs the input in the neighborhood of the instance, and learns a sparse linear model that approximates the decision boundary locally. The result is rendered as HTML you can embed in a notebook, or as a less polished matplotlib visualization.
Key highlights
- Truly model-agnostic: works with any classifier exposing a probability function, from random forests to deep learning models via Keras or PyTorch wrappers.
- Covers text, tabular data with numerical or categorical features, images, and regression tasks.
- Explanations are generated as HTML for embedding in notebooks; matplotlib fallback is supported but described as less polished.
- Backed by a published paper (arXiv 1602.04938) and includes a substantial library of tutorials for multiclass, H2O, image, and submodular pick scenarios.
Caveats
- The tabular data tutorial is noted as “newer” and the author explicitly asks users to report anything wrong, suggesting that part of the project may still be settling.
- Your model must output class probabilities; hard-label-only black boxes need a wrapper.
Verdict Data scientists and engineers who need to justify individual predictions—to users, auditors, or themselves—should keep this handy. If you already have full model transparency or only care about aggregate metrics, it will not change your life.
Frequently asked
- What is marcotcr/lime?
- LIME exists to make black-box classifiers accountable by explaining exactly which features drove any single prediction.
- Is lime open source?
- Yes — marcotcr/lime is open source, released under the BSD-2-Clause license.
- What language is lime written in?
- marcotcr/lime is primarily written in JavaScript.
- How popular is lime?
- marcotcr/lime has 12.1k stars on GitHub.
- Where can I find lime?
- marcotcr/lime is on GitHub at https://github.com/marcotcr/lime.