-
Notifications
You must be signed in to change notification settings - Fork 47
Open
Labels
bugan unexpected problem or unintended behavioran unexpected problem or unintended behavior
Description
library(tidymodels)
set.seed(1)
rs <- vfold_cv(two_class_dat)# error 1: At least one penalty value is required for glmnet.
thresh_tlr <- tailor() |> adjust_probability_threshold(threshold = tune())
glmn_spec <-
logistic_reg(penalty = 0.01) |>
set_engine("glmnet")
glmn_wflow <- workflow(Class ~ ., glmn_spec, thresh_tlr)
set.seed(2)
res <-
glmn_wflow |>
tune_grid(resamples = rs)
#> Error in `dplyr::mutate()`:
#> ℹ In argument: `model_stage = purrr::map(...)`.
#> Caused by error in `purrr::map()`:
#> ℹ In index: 1.
#> Caused by error in `no_penalty()`:
#> ! At least one penalty value is required for glmnet.# This does not help
glmn_spec <-
logistic_reg(penalty = 0.01) |>
set_engine("glmnet", path_values = 10^seq(-4:0))
glmn_wflow <- workflow(Class ~ ., glmn_spec, thresh_tlr)
set.seed(2)
res <-
glmn_wflow |>
tune_grid(resamples = rs)
#> Error in `dplyr::mutate()`:
#> ℹ In argument: `model_stage = purrr::map(...)`.
#> Caused by error in `purrr::map()`:
#> ℹ In index: 1.
#> Caused by error in `no_penalty()`:
#> ! At least one penalty value is required for glmnet.Created on 2026-01-12 with reprex v2.1.1
This appears to be a min_grid() issue. Even though the penalty is not tuned, it is checking to see if there is a penalty column in the grid.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugan unexpected problem or unintended behavioran unexpected problem or unintended behavior