Open feihongloveworld opened 8 months ago
Hi @feihongloveworld, what algorithm did you use for training your model? see the error message:
Predict feature contributions - SHAP values on an H2O Model (only GBM, XGBoost, DRF models and equivalent imported MOJOs)
cc @tomasfryda
stack of bestfamily in the automl
发自我的iPhone
------------------ Original ------------------ From: Marek Novotný @.> Date: Tue,Oct 24,2023 9:15 PM To: h2oai/h2o-3 @.> Cc: hong.fei @.>, Mention @.> Subject: Re: [h2oai/h2o-3] shap package in python couldn't explain stack modelof h2o (Issue #15863)
Hi @feihongloveworld, what algorithm did you use for training your model?
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>
Hi @feihongloveworld, what algorithm did you use for training your model? see the error message:
Predict feature contributions - SHAP values on an H2O Model (only GBM, XGBoost, DRF models and equivalent imported MOJOs)
cc @tomasfryda
but the shap value is a model agnostic metric,
stack of bestfamily in the automl
The latest version 3.44.0.1 should contain support for SHAP values on stacked ensemble models. @tomasfryda can tell more about the details and if there are any limitations.
@tomasfryda can you tell me how to get the shap information of a stack model from the automl on test data? I really need it right now. Waiting for your reply online.
@feihongloveworld Sorry for the delayed response, I was on vacation.
You need to provide a background_frame
parameter to be able to calculate the shap value for all except tree-based algos.
For example:
# Plot SHAP contributions for one instance (e.g., row 5):
model.shap_explain_row_plot(prostate_test,
row_index=5,
background_frame=prostate_train[prostate_train["AGE"] > 70, :])
See the Marginal SHAP documentation for more details.