Let's say I have the following code
spec_enet_tune = linear_reg(mode = 'regression', penalty = tune(), mixture = tune()) |>
set_engine('glmnet')
recip = df_train |>
recipe(y ~ .) |>
step_rm(datee) |>
prep()
grid_pen_mix = expand_grid(penalty = seq(0,
100,
by = 10),
mixture = seq(0,
1,
by = 0.2))
get_glmnet_coefs <- function(x) {
x |>
extract_fit_engine() |>
tidy()} # return_zeros = TRUE
parsnip_ctrl <- control_grid(extract = get_glmnet_coefs)
### CODE IN QUESTION BELOW
tune_grid(object = spec_enet_tune,
preprocessor = recip,
grid = grid_pen_mix,
resamples = !?!?,
control = parsnip_ctrl)
How would I be able to force tune_grid()
ignore the resamples
argument? I tried NULL, NA, and leaving it out, but it seems to require resamples. I just wanted to see what the results of tune()
would be from glmnet arguments.