We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I've learned Keras sequential model with the following code:
library(keras) library(fastshap) x_train <- iris |> slice(1:100) |> select(-Species) |> as.matrix() y_train <- iris |> slice(1:100) |> select(Species) |> mutate(Species = as.numeric(Species)-1) |> as.matrix() mod <- keras_model_sequential() mod |> layer_dense(units = 16, input_shape = 4) |> layer_activation(activation = "relu") |> layer_dropout(rate = 0.3) |> layer_dense(units = 1, activation = "sigmoid") mod |> compile(optimizer = "nadam", loss = loss_binary_crossentropy()) history <- fit( object = mod, x = x_train, y = y_train, batch_size = 10, epochs = 30, validation_split = 0.1 )
Then I tried to build explainer with fastshap explainer
p_fun <- function(object, newdata) predict(object, x = newdata) shp_exp <- fastshap::explain(mod, X = x_train, pred_wrapper = p_fun) shp_exp
but my shp_exp has only one row... why?
The text was updated successfully, but these errors were encountered:
Is this project died?
Sorry, something went wrong.
The predict function should return only one numeric value: #14
No branches or pull requests
I've learned Keras sequential model with the following code:
Then I tried to build explainer with fastshap explainer
but my shp_exp has only one row... why?
The text was updated successfully, but these errors were encountered: