following code here:
slightly modified code :
grid <-
recipe(target ~ ., data = df) %>%
step_profile(all_predictors(), -target, profile = vars(my_var)) %>%
prep() %>%
predict(workflow_fit, grid) %>%
bind_cols(grid %>% select(my_var)) %>%
ggplot(aes(y = .pred, x = my_var)) +
geom_bar()
Worked flawlessly for numerical variables.
I have tried to apply the same procedure for categorical variables but all bars have the same lenght.
any hint on getting pdp plots for categorical variables using tidymodels?