You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
internal_make_spec_tbl<-function(.data){
# Checks ----df<-dplyr::as_tibble(.data)
nms<- unique(names(df))
if (!".parsnip_engine"%in%nms|!".parsnip_mode"%in%nms|!".parsnip_fns"%in%nms){
rlang::abort(
message="The model tibble must come from the class/reg to parsnip function.",
use_cli_format=TRUE
)
}
# Make tibble ----mod_spec_tbl<-df %>%
dplyr::mutate(
model_spec=purrr::pmap(
dplyr::cur_data(),
~ match.fun(..3)(mode=..2, engine=..1)
)
) %>%
# add .model_id columndplyr::mutate(.model_id=dplyr::row_number()) %>%
dplyr::select(.model_id, dplyr::everything())
# Return ----return(mod_spec_tbl)
}
Example:
> internal_make_spec_tbl(mod_tbl)
# A tibble: 46 × 5.model_id.parsnip_engine.parsnip_mode.parsnip_fnsmodel_spec<int><chr><chr><chr><list>11lmregressionlinear_reg<spec[+]>22bruleeregressionlinear_reg<spec[+]>33geeregressionlinear_reg<spec[+]>44glmregressionlinear_reg<spec[+]>55glmerregressionlinear_reg<spec[+]>66glmnetregressionlinear_reg<spec[+]>77glsregressionlinear_reg<spec[+]>88lmeregressionlinear_reg<spec[+]>99lmerregressionlinear_reg<spec[+]>1010stanregressionlinear_reg<spec[+]># … with 36 more rows# ℹ Use `print(n = ...)` to see more rows
The text was updated successfully, but these errors were encountered:
fast_regression_parsnip_spec_tbl()
#79fast_classification_parsnip_spec_tbl()
#80Function:
Example:
The text was updated successfully, but these errors were encountered: