-
Notifications
You must be signed in to change notification settings - Fork 105
Closed
Labels
featurea feature request or enhancementa feature request or enhancement
Description
Adding a call to check_args()
on this line https://github.com/tidymodels/parsnip/blob/main/R/misc.R#L350 produces the following results. The only questionable use-case is the last one, which people might use.
Still looking at other places where this would fail
library(parsnip)
library(discrim)
discrim_linear(penalty = -2)
#> Error in `new_model_spec()`:
#> ! The amount of regularization, `penalty`, should be `>= 0`.
discrim_linear(penalty = tune()) %>%
set_args(penalty = 1)
#> Linear Discriminant Model Specification (classification)
#>
#> Main Arguments:
#> penalty = 1
#>
#> Computational engine: MASS
discrim_linear(penalty = tune())
#> Linear Discriminant Model Specification (classification)
#>
#> Main Arguments:
#> penalty = tune()
#>
#> Computational engine: MASS
discrim_linear(penalty = 1) %>%
set_args(penalty = -2)
#> Error in `new_model_spec()`:
#> ! The amount of regularization, `penalty`, should be `>= 0`.
discrim_linear(penalty = -2) %>%
set_args(penalty = 1)
#> Error in `new_model_spec()`:
#> ! The amount of regularization, `penalty`, should be `>= 0`.
Metadata
Metadata
Assignees
Labels
featurea feature request or enhancementa feature request or enhancement