--- id: lime version: "0.2.0.1" license: BSD license_treatment: permissive maintenance: dormant --- # lime — Local Interpretable Model-Agnostic Explanations for machine learning classifiers License: permissive · Maintenance: dormant · Downloads: 417.6K/mo ## What it is and what it does Lime is a model-agnostic explanation tool that helps you understand what machine learning classifiers are doing by generating local interpretable approximations of their behavior. It works by perturbing instances around a specific prediction, weighting samples by proximity, and fitting a sparse linear model that approximates the classifier's decision boundary locally. This reveals which features most influenced a particular prediction. The package supports text classifiers, tabular data (numerical or categorical), and image classifiers. It requires only that your classifier outputs class probabilities; built-in support for scikit-learn is included. Explanations are generated as interactive HTML visualizations or matplotlib plots, making them suitable for notebooks and reports. The approach is based on the 2016 paper on local interpretable model-agnostic explanations. Use it for: - Debug why a text classifier predicted a specific sentiment or category for a document. - Understand which features in tabular data drove a model's prediction for a particular row. - Visualize which regions of an image influenced a classifier's prediction (e.g., cat vs. dog). - Generate explanations for regulatory compliance when model decisions affect users. - Identify data quality issues or unexpected feature interactions by examining local approximations. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Lime explains individual predictions from any black-box machine learning classifier by fitting local linear models around specific instances, supporting text, tabular, and image data. Yes, with conditions. Lime is well-established and permissively licensed, but it has been dormant since June 2020 and may have compatibility gaps with current ML frameworks. Install it if you need model-agnostic explanations for existing classifiers and can verify it works with your specific dependencies; avoid it if you require active maintenance or support for the latest framework versions. ## Install pip install lime uv add lime poetry add lime ## Installing lime Before you install: High install friction due to no runtime dependencies listed; package is dormant (last release 2020-06-26, 2240 days ago) but the repository remains active with recent commits and substantial community engagement (12167 stars). License in practice: BSD permissive license allows commercial and private use with minimal restrictions, making it suitable for most deployment contexts. Quickstart: pip install lime from lime.lime_text import LimeTextExplainer explainer = LimeTextExplainer(class_names=['class_a', 'class_b']) explanation = explainer.explain_instance(text_instance, classifier_fn) Requires Python >= 3.5; classifier must implement a function that takes raw text or numpy array and returns class probabilities. Verify before relying: - Whether high install friction reflects missing optional dependencies or build requirements not captured in the fact sheet. - Current compatibility with modern scikit-learn, PyTorch, Keras versions given the 2020 release date. - Whether the package is maintained or accepting contributions despite dormant status. ## Package facts - License: BSD (permissive) - Python support: supports_current - Install friction: high - Maintenance: dormant - Downloads: 417.6K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags machine learning model explainability, interpret classifier predictions, local interpretable explanations, black box model interpretability, feature importance for predictions, explain neural network decisions, model-agnostic explanation, model-explainability, interpretability [View on SkillFed](https://skillfed.io/packages/lime) · [View on PyPI](https://pypi.org/project/lime/)