
Extract Tunable Parameters from Model Specifications
Source:R/extract-tunable-params.R
extract_tunable_params.Rd
Extract a list of tunable parameters from the .model_spec
column
of a tidyaml_mod_spec_tbl
.
Details
This function iterates over the .model_spec
column of a model table
and extracts tunable parameters for each model using tunable()
. The result
is a list that can be further processed into a tibble if needed.
See also
Other Extractor:
extract_model_spec()
,
extract_regression_residuals()
,
extract_wflw()
,
extract_wflw_fit()
,
extract_wflw_pred()
,
get_model()
Examples
library(dplyr)
mods <- fast_regression_parsnip_spec_tbl(
.parsnip_fns = "linear_reg",
.parsnip_eng = c("lm","glmnet")
)
extract_tunable_params(mods)
#> [[1]]
#> # A tibble: 0 × 5
#> # ℹ 5 variables: name <chr>, call_info <list>, source <chr>, component <chr>,
#> # component_id <chr>
#>
#> [[2]]
#> # A tibble: 2 × 5
#> name call_info source component component_id
#> <chr> <list> <chr> <chr> <chr>
#> 1 penalty <named list [2]> model_spec linear_reg main
#> 2 mixture <named list [3]> model_spec linear_reg main
#>