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

Comments

@hbaniecki
Copy link
Member

@hbaniecki hbaniecki commented Mar 3, 2020

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 💣 label Mar 3, 2020
hbaniecki added a commit that referenced this issue Mar 21, 2020
@pbiecek pbiecek closed this in f76ae3c Mar 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.