modeltime_wfs_fit: Modeltime workflowsets fit

Description Usage Arguments Details Value See Also Examples

View source: R/modeltime_wfs_fit.R

Description

allows working with workflow sets and modeltime. Combination of recipes and models are trained and evaluation metrics are returned.

Usage

1
modeltime_wfs_fit(.wfsets, .split_prop, .serie)

Arguments

.wfsets

workflow_set object, generated with the workflow_set() function from the 'workflowsets' package.

.split_prop

time series split proportion.

.serie

time series dataframe.

Details

Given a workflow_set containing multiple time series recipes and models, adjusts all the possible combinations on a time series. It uses a split proportion in order to train on a time series partition and evaluate metrics on the testing partition.

Value

tbl_df containing the model id (based on workflow_set), model description and metrics on the time series testing dataframe. Also, a .fit_model column is included, which contains each fitted model.

See Also

sknifedatar website

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
library(dplyr)
library(earth)

data <- sknifedatar::data_avellaneda %>% mutate(date=as.Date(date)) %>% filter(date<'2012-06-01')

recipe_date <- recipes::recipe(value ~ ., data = data) %>% 
  recipes::step_date(date, features = c('dow','doy','week','month','year')) 

mars <- parsnip::mars(mode = 'regression') %>% parsnip::set_engine('earth')

wfsets <- workflowsets::workflow_set(
  preproc = list(
    R_date = recipe_date),
  models  = list(M_mars = mars),
  cross   = TRUE)

sknifedatar::modeltime_wfs_fit(.wfsets = wfsets, 
                               .split_prop = 0.8, 
                               .serie = data)
                            

sknifedatar documentation built on June 1, 2021, 9:08 a.m.