API Reference
This page contains the API reference for public objects and functions in SHAP. There are also example notebooks available that demonstrate how to use the API of each object/function.
Explanation
|
A slicable set of parallel arrays representing a SHAP explanation. |
explainers
|
Uses Shapley values to explain any machine learning model or python function. |
|
Uses Tree SHAP algorithms to explain the output of ensemble tree models. |
|
Experimental GPU accelerated version of TreeExplainer. |
|
Computes SHAP values for a linear model, optionally accounting for inter-feature correlations. |
|
This method approximates the Shapley values by iterating through permutations of the inputs. |
|
|
|
This is an extension of the Shapley sampling values explanation method (aka. |
|
Computes SHAP values for generalized additive models. |
Simply returns the model coefficents as the feature attributions. |
|
|
Simply returns random (normally distributed) feature attributions. |
|
Simply wrap of lime.lime_tabular.LimeTabularExplainer into the common shap interface. |
|
Simply wraps MAPLE into the common SHAP interface. |
|
Simply tree MAPLE into the common SHAP interface. |
Simply returns the global gain/gini feature importances for tree models. |
plots
|
Create a bar plot of a set of SHAP values. |
|
Plots an explantion of a single prediction as a waterfall plot. |
|
Create a SHAP dependence scatter plot, colored by an interaction feature. |
|
Create a heatmap plot of a set of SHAP values. |
|
Visualize the given SHAP values with an additive force layout. |
|
Plots an explanation of a string of text using coloring and interactive labels. |
|
Plots SHAP values for image inputs. |
|
A basic partial dependence plot function. |
maskers
This is the superclass of all maskers. |
|
|
This masks out tabular features by integrating over the given background dataset. |
|
This masks out tabular features by integrating over the given background dataset. |
|
This masks out tokens according to the given tokenizer. |
|
This masks out image regions with blurring or inpainting. |
models
|
This is the superclass of all models. |
utils
|
|
|
|
|
This is a utility class that combines a model, a masker object, and a current input. |
datasets
|
Return the Adult census data in a nice package. |
|
Return the boston housing data in a nice package. |
|
Predict total number of non-violent crimes per 100K popuation. |
|
Correlated Groups 60 |
|
Return the diabetes data in a nice package. |
|
This is a set of 50 images representative of ImageNet images. |
|
Return the clssic IMDB sentiment analysis training data in a nice package. |
|
A simulated dataset with tight correlations among distinct groups of features. |
|
Return the classic iris data in a nice package. |
|
A nicely packaged version of NHANES I data with surivival times as labels. |