Incomplete SHAP waterfall plot in Anaconda

432 Views Asked by At

I have trained a LightGBM model called model and plotted the SHAP waterfall graph as follows:

explainer = TreeExplainer(model)
sv = explainer(X)


exp = Explanation(sv.values[:,:,0], 
                  sv.base_values[:,1], 
                  data=X.values, 
                  feature_names=X.columns)
idx = 0
waterfall(exp[idx])

The resulting graph looks like this:

enter image description here

The graph is truncated: at the bottom of the plot you can see that it reads: "8 other features". Is it possible to display the whole set of features in the waterfall plot?

1

There are 1 best solutions below

0
Sergey Bushmanov On BEST ANSWER

You're looking for max_display param like:

waterfall(exp[idx], max_display=20)