linkedin / FastTreeSHAP

Fast SHAP value computation for interpreting tree-based models
BSD 2-Clause "Simplified" License
512 stars 31 forks source link

FastTreeSHAP summary_plot plots interaction value instead of impact on model output #29

Open arilwan opened 1 year ago

arilwan commented 1 year ago

I am using FastTreeSHAP to help explained my random forest model prediction having over 40K samples and 24 features.

explainer = fasttreeshap.TreeExplainer(model, algorithm='auto' ,n_jobs=-1)
shap_values = explainer(X_test).values

shap_values.shape
(40682, 24, 5)

# plotting
fasttreeshap.summary_plot(shap_values, X_test, plot_type = 'bar')

The output figure is (showing top-5 features interaction):

Screenshot 2023-07-05 at 14 50 08

I expected output figure to look similar to below image (FastTreeSHAP docs).

Screenshot 2023-07-05 at 14 51 23

Is there any change in the summary_plot() method?