.model_param_name_key | R Documentation |
This function creates a key that connects the identifiers users make for tuning parameter names, the standardized parsnip parameter names, and the argument names to the underlying fit function for the engine.
.model_param_name_key(object, as_tibble = TRUE)
object |
A workflow or parsnip model specification. |
as_tibble |
A logical. Should the results be in a tibble (the default) or in a list that can facilitate renaming grid objects? |
A tibble with columns user
, parsnip
, and engine
, or a list
with named character vectors user_to_parsnip
and parsnip_to_engine
.
mod <-
linear_reg(penalty = tune("regularization"), mixture = tune()) %>%
set_engine("glmnet")
mod %>% .model_param_name_key()
rn <- mod %>% .model_param_name_key(as_tibble = FALSE)
rn
grid <- tidyr::crossing(regularization = c(0, 1), mixture = (0:3) / 3)
grid %>%
dplyr::rename(!!!rn$user_to_parsnip)
grid %>%
dplyr::rename(!!!rn$user_to_parsnip) %>%
dplyr::rename(!!!rn$parsnip_to_engine)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.