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
I saw this Warning when creating a Dependence plot. The plot still shows, I just thought someone might want to look into it, as it seems to be a "Division by zero" Warning.
import sklearn # version 1.1.2
import shap # version 0.41.0
import xgboost # version 1.5.1
X, y = shap.datasets.iris()
X_train, X_test, y_train, y_test = sklearn.model_selection.train_test_split(X, y, test_size=0.2, random_state=0)
model = xgboost.XGBClassifier(use_label_encoder=False).fit(X_train, y_train)
explainer = shap.TreeExplainer(model)
shap_values = explainer.shap_values(X_test)
shap.dependence_plot(2,
shap_values[0],
X_test.values,
feature_names=X_test.columns)
The text was updated successfully, but these errors were encountered:
I saw this Warning when creating a Dependence plot. The plot still shows, I just thought someone might want to look into it, as it seems to be a "Division by zero" Warning.
The text was updated successfully, but these errors were encountered: