- shap.plots.waterfall(shap_values, max_display=10, show=True)¶
Plots an explantion of a single prediction as a waterfall plot.
The SHAP value of a feature represents the impact of the evidence provided by that feature on the model’s output. The waterfall plot is designed to visually display how the SHAP values (evidence) of each feature move the model output from our prior expectation under the background data distribution, to the final model prediction given the evidence of all the features. Features are sorted by the magnitude of their SHAP values with the smallest magnitude features grouped together at the bottom of the plot when the number of features in the models exceeds the max_display parameter.
A one-dimensional Explanation object that contains the feature values and SHAP values to plot.
The maximum number of features to plot.
Whether matplotlib.pyplot.show() is called before returning. Setting this to False allows the plot to be customized further after it has been created.