eli5
Debug machine learning classifiers and explain their predictions
What it is and what it does
ELI5 is a Python package for debugging and explaining machine learning model predictions. It provides native support for scikit-learn, XGBoost, LightGBM, CatBoost, Keras, and other frameworks, allowing you to inspect model weights, visualize feature importances, print decision trees as text or SVG, and highlight text features used in predictions. For black-box models, it implements LIME-based text explanation and permutation importance methods.
Explanations can be rendered as text for console output, HTML for notebooks and dashboards, pandas DataFrames for further processing, or JSON for custom client-side rendering. The package is built on attrs, jinja2, numpy, scipy, scikit-learn, graphviz, and tabulate, making it straightforward to integrate into existing ML workflows.
Use it for:
- Debug linear classifiers and regressors by examining learned weights and prediction contributions.
- Visualize feature importances and decision paths for tree-based ensembles.
- Explain text classifier predictions by highlighting which words or features influenced the decision.
- Inspect black-box model behavior using LIME for arbitrary classifiers or permutation importance.
- Generate Grad-CAM visualizations for Keras image classifiers to understand prediction drivers.
- Undo hashing in pipelines containing HashingVectorizer to recover interpretable feature names.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Explains predictions and weights of machine learning classifiers from scikit-learn, XGBoost, LightGBM, CatBoost, Keras, and other frameworks, with support for text highlighting, feature importance visualization, and black-box model inspection via LIME and permutation importance.
Yes, with conditions. Install if you need model explainability for scikit-learn or gradient-boosted models in a research or production debugging context. The low install friction and permissive license make it a low-risk addition. However, the aging maintenance status (481 days since last release) means you should verify that the framework versions you use are compatible; test thoroughly before relying on it in critical pipelines.
Install
eli5 on PyPI
pip
pip install eli5uv
uv add eli5poetry
poetry add eli5Installing eli5
Before you install
Low friction: pure Python wheel with seven runtime dependencies (attrs, jinja2, numpy, scipy, scikit-learn, graphviz, tabulate). Maintenance status is aging—last release 481 days ago—but the repository remains active and supports current Python versions (3.9–3.13).
License in practice
MIT license (permissive): you can use, modify, and distribute eli5 freely in commercial and private projects with minimal restrictions, provided you include the license notice.
Quickstart
pip install eli5
import eli5
from scikit-learn import datasets
from sklearn.linear_model import LogisticRegression
X, y = datasets.load_iris(return_X_y=True)
clf = LogisticRegression().fit(X, y)
eli5.explain_prediction(clf, X[0])
Requires scikit-learn for most use cases; optional dependencies (Keras, XGBoost, LightGBM, CatBoost) needed for framework-specific explanations.
Verify before relying
- Whether OpenAI client support (mentioned in changelog 0.15.0) is fully functional or experimental.
- Current state of Keras 3.x and TensorFlow 2.x compatibility beyond the 0.16.0 changelog note.
- Whether all black-box inspection features (TextExplainer, permutation importance) are equally mature or if some remain experimental.
Package facts
| License | MIT license (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 7 — attrs, jinja2, numpy, scipy, scikit-learn, graphviz, tabulate |
| Maintenance | aging — 481 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 137,234/month — #11,374 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: eli5-0.16.0-py2.py3-none-any.whl
Tags
More Artificial Intelligence packages
LiteLLM provides a unified Python interface to…
permissive · top 100 on PyPI
huggingface-hubClient library and CLI tool for downloading,…
permissive · top 100 on PyPI
langchainLangChain provides a framework for building…
permissive · top 1,000 on PyPI
hf-xethf-xet provides chunk-based deduplication and…
permissive · top 1,000 on PyPI
tokenizersTokenizers converts raw text into token…
permissive · top 1,000 on PyPI
transformersTransformers provides a unified framework for…
permissive · top 1,000 on PyPI
limeLime explains individual predictions from any…
permissive · top 15,000 on PyPI
shapSHAP computes Shapley values to explain…
permissive · top 5,000 on PyPI
interpret-coreTrains interpretable machine learning models…
unclear · top 5,000 on PyPI
treeinterpreterDecomposes scikit-learn decision tree and…
permissive · top 15,000 on PyPI
trove-classifiersProvides the canonical set of valid PyPI…
permissive · top 100 on PyPI
interpretInterpretML provides interpretable machine…
unclear · top 15,000 on PyPI
scikit-multilearnScikit-multilearn performs multi-label…
permissive · top 15,000 on PyPI
dtreevizdtreeviz renders decision trees from…
permissive · top 15,000 on PyPI
pytabkitPyTabKit provides scikit-learn interfaces to…
permissive · top 15,000 on PyPI
betacalFits beta calibration models to classifier…
permissive · top 15,000 on PyPI