Internals Make a Tunable Model Specification
Source:R/internals-set-tune-modspec-args.R
internal_set_args_to_tune.Rd
Make a tuned model specification object.
Arguments
- .model_tbl
The model table that is generated from a function like
fast_regression_parsnip_spec_tbl()
, must have a class of "tidyaml_mod_spec_tbl".
Details
This will take a model specification that is created from a function
like fast_regression_parsnip_spec_tbl()
and update the model_spec
args
to tune::tune()
. This is done dynamically, meaning you do not need
to know the names of the parameters inside of the model specification.
Examples
library(dplyr)
mod_tbl <- fast_regression_parsnip_spec_tbl()
mod_tbl$model_spec[[1]]
#> Linear Regression Model Specification (regression)
#>
#> Computational engine: lm
#>
updated_mod_tbl <- mod_tbl |>
mutate(model_spec = internal_set_args_to_tune(mod_tbl))
updated_mod_tbl$model_spec[[1]]
#> Linear Regression Model Specification (regression)
#>
#> Main Arguments:
#> penalty = tune::tune()
#> mixture = tune::tune()
#>
#> Computational engine: lm
#>