Closed pbiecek closed 1 year ago
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
all_observations[, var]
suggested solution: use all_observations[[var]]
all_observations[[var]]
candidate fix in https://github.com/ModelOriented/ingredients/commit/f061a703f08c54bb2a2f551eee8e7dc76f6e9ae9 is working with ingredients 2.3.0 and above
ingredients
fixed in https://github.com/ModelOriented/ingredients/commit/87bfca97dfa750353f6704c58b1648c2793ecd51
this code generates an error
because
all_observations[, var]
for tibble does not produce vector, it stays a tibblesuggested solution: use
all_observations[[var]]