View source: R/modeltime-fit-workflowset.R
modeltime_fit_workflowset | R Documentation |
workflowset
object to one or multiple time seriesThis is a wrapper for fit()
that takes a
workflowset
object and fits each model on one or multiple
time series either sequentially or in parallel.
modeltime_fit_workflowset(
object,
data,
...,
control = control_fit_workflowset()
)
object |
A workflow_set object, generated with the workflowsets::workflow_set function. |
data |
A |
... |
Not currently used. |
control |
An object used to modify the fitting process. See |
A Modeltime Table containing one or more fitted models.
control_fit_workflowset()
library(tidymodels)
library(workflowsets)
library(dplyr)
library(lubridate)
library(timetk)
data_set <- m4_monthly
# SETUP WORKFLOWSETS
rec1 <- recipe(value ~ date + id, data_set) %>%
step_mutate(date_num = as.numeric(date)) %>%
step_mutate(month_lbl = lubridate::month(date, label = TRUE)) %>%
step_dummy(all_nominal(), one_hot = TRUE)
mod1 <- linear_reg() %>% set_engine("lm")
mod2 <- prophet_reg() %>% set_engine("prophet")
wfsets <- workflowsets::workflow_set(
preproc = list(rec1 = rec1),
models = list(
mod1 = mod1,
mod2 = mod2
),
cross = TRUE
)
# FIT WORKFLOWSETS
# - Returns a Modeltime Table with fitted workflowsets
wfsets %>% modeltime_fit_workflowset(data_set)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.