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

sv_importance returns unused argument error #29

Closed
Karol-Gawlowski opened this issue Oct 6, 2022 · 3 comments · Fixed by #30
Closed

sv_importance returns unused argument error #29

Karol-Gawlowski opened this issue Oct 6, 2022 · 3 comments · Fixed by #30

Comments

@Karol-Gawlowski
Copy link

Calling sv_importance results in:

Error in FUN(newX[, i], ...) : unused argument (simplify = FALSE)

Looking through shapviz/tree/main/R)/sv_importance.R; the .min_max_scale helper function indeed does not include the simplify argument,

repro steps as in the shapviz vignette

X_train_test <- data.matrix(iris[, -1])
dtrain_test <- xgboost::xgb.DMatrix(X_train_test, label = iris[, 1])
fit_test <- xgboost::xgb.train(data = dtrain_test, nrounds = 50)
x_test <- shapviz(fit_test, X_pred = X_train_test)
sv_importance(x_test)
sv_importance(x_test, kind = "beeswarm", show_numbers = TRUE)

Note, the following works as intended:
sv_importance(x_test, kind = "no")

Cheers

@mayer79
Copy link
Collaborator

mayer79 commented Oct 7, 2022

Hello and thanks for reporting. The simplify option refers to apply(..., simplify = FALSE), which was introduced in R 4.1. I was not aware of this version dependency, so I'd love to replace the snipped by something that also runs on lower R versions.

@mayer79
Copy link
Collaborator

mayer79 commented Oct 7, 2022

Fixed by #30

Test with

devtools::install_github("mayer79/shapviz")

@mayer79 mayer79 reopened this Oct 7, 2022
@mayer79
Copy link
Collaborator

mayer79 commented Oct 7, 2022

Now fixed on CRAN

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants