--- id: eli5 version: "0.16.0" license: MIT license license_treatment: permissive maintenance: aging --- # eli5 — Debug machine learning classifiers and explain their predictions License: permissive · Maintenance: aging · Downloads: 137.2K/mo ## 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 above — 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 pip install eli5 uv add eli5 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_current - Install friction: low - Maintenance: aging - Downloads: 137.2K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags machine learning model explainability, explain classifier predictions, feature importance visualization, model debugging and inspection, LIME black-box explanation, model interpretability tools, gradient-based model visualization, model-interpretability, explainability, debugging [View on SkillFed](https://skillfed.io/packages/eli5) · [View on PyPI](https://pypi.org/project/eli5/)