Can I use tune_grid without resamples?

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.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.