ELI5 is a Python package that helps to debug machine learning classifiers and explain their predictions through one unified API. It can show how a model works as a whole and why it made one particular decision.
This page is for data scientists and ML engineers who need to inspect models before trusting them. It covers what ELI5 does, the two core functions, supported libraries, how it differs from related techniques, how it relates to AI agents, and what to do first.
The ELI5 documentation describes ELI5 as a package for debugging machine learning classifiers and explaining their predictions. It separates the explanation from its output format, so the same result can be rendered as text, HTML, JSON, a pandas DataFrame or an image.
Because the explanation is a reusable object, code written for one model type can often be reused for another.
A model that cannot be inspected is hard to debug and hard to defend. Checking what a model relies on helps you find leakage, spurious features and surprising behaviour before release. It also gives reviewers something concrete to read when a prediction is questioned.
According to the ELI5 documentation, ELI5 offers two core ways to look at a model. explain_weights inspects model parameters to show how the model works globally. explain_prediction explains an individual prediction. Both return an Explanation object that formatters turn into output, and the show_weights and show_prediction helpers do both steps in one call in a notebook.
| Function | Question it answers | Scope |
|---|---|---|
| explain_weights | Which features does the model weight most? | The model as a whole |
| explain_prediction | Why did the model give this answer for this input? | One prediction |
| TextExplainer | Why did this black-box text classifier decide as it did? | One prediction, any text classifier |
| Permutation Importance | Which features matter to a black-box estimator? | The model as a whole |
The documentation says TextExplainer uses the LIME algorithm, which fits a simple, interpretable model locally around a prediction. LIME utilities for non-text data are available but described as experimental.
The ELI5 documentation lists scikit-learn (linear models, decision trees, tree ensembles, pipelines), XGBoost, LightGBM and CatBoost (feature importances, with explanations for some model types), lightning, sklearn-crfsuite, and OpenAI for explaining LLM predictions using token probabilities. Keras image explanations use Grad-CAM, but only with TensorFlow 1.x, which needs ELI5 0.13 or earlier. Check the current page for version requirements before you install.
| Technique | What it is | Role in ELI5 |
|---|---|---|
| LIME | Fits a simple local model around one prediction | Used by TextExplainer for text classifiers |
| Permutation importance | Scores features of a black-box estimator | Provided as a utility |
| ELI5 | A package with one API and several output formats | Wraps model inspection and these methods |
So ELI5 is not a single algorithm. It is a toolkit that applies several, and it presents their results in a consistent way.
Agents rely on models whose outputs trigger actions, so being able to explain a single prediction is useful when an action is reviewed. ELI5 can inspect the supported models behind such a step. For the XenonStack AI agents computing platform, see ElixirClaw.
To map one decision your agents make, and the data and policy it depends on, book a Context Workshop. See what happens in the workshop.
ELI5 is a Python package that helps to debug machine learning classifiers and explain their predictions. It offers a unified API across several libraries.
explain_weights inspects model parameters to show how the model works globally. explain_prediction explains why the model made one individual decision.
Its documentation lists scikit-learn, Keras, XGBoost, LightGBM, CatBoost, lightning, sklearn-crfsuite and OpenAI, with different levels of support for each.
Yes. TextExplainer explains predictions of any text classifier using the LIME algorithm, and Permutation Importance computes feature importances for black-box estimators.
The same explanation can be rendered as text, HTML, JSON, pandas DataFrames or images.