Creates a list/tibble of parsnip model specifications.
Usage
fast_regression(
.data,
.rec_obj,
.parsnip_fns = "all",
.parsnip_eng = "all",
.split_type = "initial_split",
.split_args = NULL
)
Arguments
- .data
The data being passed to the function for the regression problem
- .rec_obj
The recipe object being passed.
- .parsnip_fns
The default is 'all' which will create all possible regression model specifications supported.
- .parsnip_eng
the default is 'all' which will create all possible regression model specifications supported.
- .split_type
The default is 'initial_split', you can pass any type of split supported by
rsample
- .split_args
The default is NULL, when NULL then the default parameters of the split type will be executed for the rsample split type.
Details
With this function you can generate a tibble output of any regression
model specification and it's fitted workflow
object.
See also
Other Model_Generator:
create_model_spec()
,
fast_classification()
Examples
library(recipes, quietly = TRUE)
library(dplyr, quietly = TRUE)
rec_obj <- recipe(mpg ~ ., data = mtcars)
frt_tbl <- fast_regression(mtcars, rec_obj, .parsnip_eng = c("lm","glm"),
.parsnip_fns = "linear_reg")
glimpse(frt_tbl)
#> Rows: 2
#> Columns: 8
#> $ .model_id <int> 1, 2
#> $ .parsnip_engine <chr> "lm", "glm"
#> $ .parsnip_mode <chr> "regression", "regression"
#> $ .parsnip_fns <chr> "linear_reg", "linear_reg"
#> $ model_spec <list> [~NULL, ~NULL, NULL, regression, TRUE, NULL, lm, TRUE]…
#> $ wflw <list> [cyl, disp, hp, drat, wt, qsec, vs, am, gear, carb, mp…
#> $ fitted_wflw <list> [cyl, disp, hp, drat, wt, qsec, vs, am, gear, carb, mp…
#> $ pred_wflw <list> [<tbl_df[24 x 1]>], [<tbl_df[24 x 1]>]