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

Error in rounding_function when running plot() function #39

Open
ferygood opened this issue Nov 23, 2022 · 5 comments
Open

Error in rounding_function when running plot() function #39

ferygood opened this issue Nov 23, 2022 · 5 comments

Comments

@ferygood
Copy link

Dear maintainer,

Thank you for developing this interesting package. I was following your tutorial using random forest model for classification problem. I faced some problem when I tried using the plot() function:

library("shapper")
library("DALEX")
library("randomForest")
Y_train <- HR$status
x_train <- HR[ , -6]
set.seed(123)
model_rf <- randomForest(x = x_train, y = Y_train, ntree= 50)
p_function <- function(model, data) predict(model, newdata = data, type = "prob")
ive_rf <- individual_variable_effect(model_rf, data = x_train, predict_function = p_function,
                                     new_observation = x_train[1:2,], nsamples = 50)


plot(ive_rf) # error occur when running the plot function

error message:

Error in rounding_function(variable_values[numeric_values], digits) : 
  non-numeric argument to mathematical function

Could you give me some suggestions on how to fix this issue? Thank you very much for your time!

@weeleon
Copy link

weeleon commented Mar 30, 2023

Hi developer(s), I can reproduce the exact same error above as the original post. Also on my own private datasets.
Please advise workaround or if there is a fix for this issue.
I see it has been open since Nov 2022.
Thanks in advance.

@maksymiuks
Copy link
Member

Hi @weeleon

I'm on it

@golfr32
Copy link

golfr32 commented May 23, 2023

@maksymiuks does this issue fix?

@maksymiuks
Copy link
Member

This should work know @golfr32 please check master branch of shapper

@parsifal9
Copy link

I can confirm that a new install from github fixed this problem for me.
Thanks!

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

No branches or pull requests

5 participants