我正在尝试学习tidymodels和DALEXtra... 我已经成功地用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()
我其中一个BART模型看起来像是“胜利者”:
# A tibble: 6 × 4
model .config roc_auc rank
<chr> <chr> <dbl> <int>
1 bart Preprocessor1_Model046 0.656 1
我想将那个模型输入到DALEXtra中:
library(DALEXtra)
explainer_bart <-
explain_tidymodels(
x, # <--------------- what goes here?
data = the_train,
y = adherence_group,
label = bart,
verbose = FALSE
)
我认为
explain_tidymodels()
函数需要一个拟合模型。我该如何从工作流设置的结果中提取它?我是初学者,所以希望能够提供给不懂的人一些线索(最好附带链接)。
extract_workflow()
函数。 - Desmond