You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the MWE below, I would expect summary_plot to return a bar plot per class (this was the old behavior). Instead, no matter the argument in plot_type, I always get the interaction dot-plot.
Minimal Reproducible Example
# train a multiclass lgm on random sklearn dataimportsklearnimportsklearn.datasetsimportsklearn.model_selectionimportlightgbmaslgbimportshapX, y=sklearn.datasets.make_classification(n_samples=100, n_features=20, n_informative=5, n_classes=3, random_state=0)
X_train, X_test, y_train, y_test=sklearn.model_selection.train_test_split(X, y, random_state=1)
gbm=lgb.LGBMClassifier()
gbm.fit(X_train, y_train)
# explain the model's predictions using SHAPexplainer=shap.Explainer(gbm)
shap_values=explainer(X_test)
# summary_plotshap.summary_plot(shap_values, X_test, plot_type="bar") # wrong plotshap.summary_plot(shap_values, X_test, plot_type="asdasd asd") # even gibberish works
Traceback
No response
Expected Behavior
When setting plot_type="bar" I would expect shap to return a bar plot, not a compact_dot. When using gibberish arguments, I would expect shap to error out.
Bug report checklist
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest release of shap.
I have confirmed this bug exists on the master branch of shap.
I'd be interested in making a PR to fix this bug
Installed Versions
[[package]]
name = "shap"
version = "0.45.0"
description = "A unified approach to explain the output of any machine learning model."
category = "main"
optional = false
python-versions = ">=3.9"
Issue Description
In the MWE below, I would expect summary_plot to return a bar plot per class (this was the old behavior). Instead, no matter the argument in
plot_type
, I always get the interaction dot-plot.Minimal Reproducible Example
Traceback
No response
Expected Behavior
When setting
plot_type="bar"
I would expect shap to return a bar plot, not acompact_dot
. When using gibberish arguments, I would expect shap to error out.Bug report checklist
Installed Versions
[[package]]
name = "shap"
version = "0.45.0"
description = "A unified approach to explain the output of any machine learning model."
category = "main"
optional = false
python-versions = ">=3.9"
[[package]]
name = "lightgbm"
version = "4.3.0"
description = "LightGBM Python Package"
category = "main"
optional = false
python-versions = ">=3.6"
[metadata]
lock-version = "1.1"
python-versions = ">=3.10,<3.12"
The text was updated successfully, but these errors were encountered: