skillfed

eli5

Debug machine learning classifiers and explain their predictions

eli5 v0.16.0 137.2K downloads/30d#11,374 on PyPI331
Permissive license MIT license AGING released

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 eli5

uv

uv add eli5

poetry

poetry add eli5

Installing 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

Development Status :: 4 - BetaIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.9

Tags

machine learning model explainabilityexplain classifier predictionsfeature importance visualizationmodel debugging and inspectionLIME black-box explanationmodel interpretability toolsgradient-based model visualization
model-interpretabilityexplainabilitydebugging

More Artificial Intelligence packages

Further reading