I am trying to learn tidymodels and DALEXtra.... I have successfully built a set of models with workflow_map:
grid_results <-
all_workflows %>%
workflow_map(
seed = 1503,
resamples = the_folds,
grid = 100,
control = grid_ctrl,
verbose=TRUE
)
grid_results %>%
rank_results() %>%
filter(.metric == "roc_auc") %>%
select(model, .config, roc_auc = mean, rank) |>
head()
And one of my BART models looks like the "winner":
# A tibble: 6 × 4
model .config roc_auc rank
<chr> <chr> <dbl> <int>
1 bart Preprocessor1_Model046 0.656 1
I would like to feed that model to DALEXtra:
library(DALEXtra)
explainer_bart <-
explain_tidymodels(
x, # <--------------- what goes here?
data = the_train,
y = adherence_group,
label = bart,
verbose = FALSE
)
I think the explain_tidymodels()
function wants a fit model. How can I extract it from the workflow sets result?
I am a beginner. So clues for the clueless (ideally with links) would be greatly appreciated.