TypeError: In v0.20, force plot now requires the base value as the first parameter! Try shap.plots.force(explainer.expected_value, shap_values) or for multi-output models try shap.plots.force(explainer.expected_value[0], shap_values[0]). #3664
Labels
bug
Indicates an unexpected problem or unintended behaviour
Issue Description
run this demo:https://github.com/shap/shap/blob/master/notebooks/tabular_examples/tree_based_models/Census%20income%20classification%20with%20LightGBM.ipynb
TypeError Traceback (most recent call last)
/tmp/ipykernel_52792/960682606.py in ()
----> 1 shap.force_plot(
2 explainer.expected_value, shap_values.values[1, :], X_display.iloc[0, :]
3 )
~/anaconda3/envs/myenv/lib/python3.8/site-packages/shap/plots/_force.py in force(base_value, shap_values, features, feature_names, out_names, link, plot_cmap, matplotlib, show, figsize, ordering_keys, ordering_keys_time_format, text_rotation, contribution_threshold)
128 "shap.plots.force(explainer.expected_value[0], shap_values[0])."
129 )
--> 130 raise TypeError(emsg)
131
132 if isinstance(shap_values, list):
TypeError: In v0.20, force plot now requires the base value as the first parameter! Try shap.plots.force(explainer.expected_value, shap_values) or for multi-output models try shap.plots.force(explainer.expected_value[0], shap_values[0]).
sample order by similarity
f(x)
Minimal Reproducible Example
Traceback
Expected Behavior
No response
Bug report checklist
Installed Versions
0.44.1
The text was updated successfully, but these errors were encountered: