What Is the SHAP Documentation Website?
Updated
shap.readthedocs.io is the official documentation site for SHAP (SHapley Additive exPlanations), a game-theoretic method for explaining the output of machine learning models. It is the reference point for installing the library, understanding the method, and finding runnable examples across tabular, text, image, and genomic data. Use it when you need to interpret model predictions, choose an explainer, or look up the API.
What SHAP actually is
SHAP connects optimal credit allocation with local explanations using the classic Shapley values from game theory and their related extensions. In practice, that means it assigns each input feature a contribution to a specific prediction, so you can see which features pushed a model's output up or down.
The documentation frames this as a way to explain the output of any machine learning model, not just one family of algorithms.
What the site contains
The navigation is organized into a few clear sections:
- Introduction — conceptual material, including an introduction to explainable AI with Shapley values.
- Topical overviews — guidance on interpreting predictive models in search of causal insights, and on explaining quantitative measures of fairness.
- Examples — worked examples grouped by data type (see below).
- Reference — API reference, API examples, and benchmarks.
- Development — release notes and a contributing guide.
Examples by data type
| Data type | Covered topics |
|---|---|
| Tabular | Tree-based models, linear models, neural networks, model agnostic |
| Text | Sentiment analysis, translation, text generation, summarization, question answering, language modelling, text entailment |
| Image | Image classification, image captioning |
| Genomic | DeepExplainer genomics example |
Reference material
The API reference is split into Explanation, explainers, plots, maskers, models, utils, and datasets. There is also a dedicated page on migrating to the new "Explanation" API, plus API examples for explainers, maskers, models, and plots.
Installation
SHAP can be installed from either PyPI or conda-forge:
pip install shap
or
conda install -c conda-forge shap
Who maintains it and how it is built
The site is copyrighted by Scott Lundberg (© Copyright 2018, Scott Lundberg). It is built with Sphinx using a theme provided by Read the Docs, which is why it lives on the readthedocs.io domain.
When to use this site
- You want to install SHAP or confirm the install command.
- You need to pick an explainer for a specific model or data type.
- You want a runnable example before writing your own code.
- You are migrating existing code to the new
ExplanationAPI. - You want to check benchmark results or read release notes.
If you only need the conceptual definition of Shapley values, the Introduction and topical overviews are the shortest path. If you already know what you want to compute, go straight to the API reference or the matching example category.