Learn R Programming

predtoolsTS (version 0.1.1)

modl.trControl: Control the splitting to train the data

Description

Creates the needed caret::trainControl object to control the training splitting.

Usage

modl.trControl(initialWindow, horizon, fixedWindow, givenSummary = FALSE)

Arguments

initialWindow

An integer. The initial number of consecutive values in each training set sample. Default value: 30.

horizon

An integer. The number of consecutive values in test set sample. Default value: 15.

fixedWindow

A logical: if FALSE, the training set always start at the first sample and the training set size will vary over data splits. Default value: TRUE.

givenSummary

A logical. Indicates if it should be used the customized summaryFunction(?trainControl for more info) modl.sumFunction or not. Default is FALSE; this will use default caret metrics.

Value

trainControl object

Details

We always split using method "timeslice", wich is the better for time series. More information on how this works on http://topepo.github.io/caret/data-splitting.html#data-splitting-for-time-series.

Examples

Run this code
# NOT RUN {
modl.trControl(initialWindow=30,horizon=15,fixedWindow=TRUE,givenSummary=TRUE)
# }

Run the code above in your browser using DataLab