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

predict_profile fails for penguins data because it is a tibble #540

Closed
pbiecek opened this issue Jan 13, 2023 · 2 comments
Closed

predict_profile fails for penguins data because it is a tibble #540

pbiecek opened this issue Jan 13, 2023 · 2 comments
Assignees
Labels
bug 💣 Bug to fix R 🐳 Related to R

Comments

@pbiecek
Copy link
Member

pbiecek commented Jan 13, 2023

this code generates an error

library("palmerpenguins")
data("penguins", package = "palmerpenguins")

library("mlr3")
library("mlr3learners")

penguins = na.omit(penguins)
task_peng = as_task_classif(penguins, target = "species")


learner = lrn("classif.ranger")
learner$predict_type = "prob"
learner$train(task_peng)

library("DALEX")
library("DALEXtra")

ranger_exp = explain_mlr3(learner,
  data = penguins[test_set, ],
  y = penguins[test_set, "species"],
  label = "Ranger RF",
  colorize = FALSE)

mumble <- penguins[1,]

predict(ranger_exp, mumble)

pmp1cp <- predict_profile(ranger_exp, as.data.frame(mumble))
plot(pmp1cp)

because all_observations[, var] for tibble does not produce vector, it stays a tibble

suggested solution: use all_observations[[var]]

@pbiecek
Copy link
Member Author

pbiecek commented Jan 13, 2023

candidate fix in ModelOriented/ingredients@f061a70
is working with ingredients 2.3.0 and above

@pbiecek
Copy link
Member Author

pbiecek commented Jan 15, 2023

fixed in ModelOriented/ingredients@87bfca9

@pbiecek pbiecek closed this as completed Jan 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 💣 Bug to fix R 🐳 Related to R
Projects
None yet
Development

No branches or pull requests

1 participant