parsnipmodel specs from a
Helper to make
parsnip model specs from a
dials parameter grid
create_model_grid(grid, f_model_spec, engine_name, ..., engine_params = list())
A tibble that forms a grid of parameters to adjust
A function name (quoted or unquoted) that
A name of an engine to use. Gets passed to
Static parameters that get passed to the f_model_spec
This is a helper function that combines
dials grids with
parsnip model specifications. The intent is to make it easier
workflowset objects for forecast evaluations
The process follows:
Generate a grid (hyperparemeter combination)
create_model_grid() to apply the parameter combinations to
a parsnip model spec and engine.
The output contains ".model" column that can be used as a list
of models inside the
Tibble with a new colum named
dials::grid_regular(): For making parameter grids.
workflowsets::workflow_set(): For creating a
workflowset from the
.models list stored in the ".models" column.
modeltime_fit_workflowset(): For fitting a
workflowset to forecast data.
library(tidymodels) library(modeltime) # Parameters that get optimized grid_tbl <- grid_regular( learn_rate(), levels = 3 ) # Generate model specs grid_tbl %>% create_model_grid( f_model_spec = boost_tree, engine_name = "xgboost", # Static boost_tree() args mode = "regression", # Static set_engine() args engine_params = list( max_depth = 5 ) )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.