Skip to content
New issue

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

[shap] NA in variable_value column #76

Closed
hbaniecki opened this issue Mar 3, 2020 · 0 comments
Closed

[shap] NA in variable_value column #76

hbaniecki opened this issue Mar 3, 2020 · 0 comments
Labels
bug 💣 Bug to fix

Comments

@hbaniecki
Copy link
Member

library("xgboost")
library("DALEX")

model_matrix <- model.matrix(status == "fired" ~ . -1, HR)
data <- xgb.DMatrix(model_matrix, label = HR$status == "fired")

params <- list(max_depth = 2, eta = 1, silent = 1, nthread = 2,
               objective = "binary:logistic", eval_metric = "auc")

model_HR <- xgb.train(params, data, nrounds = 50)

explainer_HR <- explain(model_HR,
                        data = model_matrix,
                        y = HR$status == "fired",
                        verbose = FALSE)

library(iBreakDown)
# this works
break_down(explainer_HR, model_matrix[1,,drop=FALSE])

# this has NA in variable_value (and rownames)
shap(explainer_HR, model_matrix[1,,drop=FALSE])
@hbaniecki hbaniecki added the bug 💣 Bug to fix label Mar 3, 2020
hbaniecki pushed a commit that referenced this issue Mar 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 💣 Bug to fix
Projects
None yet
Development

No branches or pull requests

1 participant