Description Usage Arguments Details Value Author(s) Examples
Creates the needed caret::trainControl
object to control the training
splitting.
1 | modl.trControl(initialWindow, horizon, fixedWindow, givenSummary = FALSE)
|
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 |
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.
trainControl object
Alberto Vico Moreno
1 | modl.trControl(initialWindow=30,horizon=15,fixedWindow=TRUE,givenSummary=TRUE)
|
$method
[1] "timeslice"
$number
[1] 25
$repeats
[1] NA
$search
[1] "grid"
$p
[1] 0.75
$initialWindow
[1] 30
$horizon
[1] 15
$fixedWindow
[1] TRUE
$skip
[1] 0
$verboseIter
[1] FALSE
$returnData
[1] TRUE
$returnResamp
[1] "final"
$savePredictions
[1] FALSE
$classProbs
[1] FALSE
$summaryFunction
function (data, lev = NULL, model = NULL)
{
rmse <- caret::RMSE(data$obs, data$pred)
mae <- Metrics::mae(data$obs, data$pred)
mape <- TSPred::MAPE(data$obs, data$pred)
output <- c(rmse, mae, mape)
names(output) <- c("RMSE", "MAE", "MAPE")
return(output)
}
<environment: namespace:predtoolsTS>
$selectionFunction
[1] "best"
$preProcOptions
$preProcOptions$thresh
[1] 0.95
$preProcOptions$ICAcomp
[1] 3
$preProcOptions$k
[1] 5
$preProcOptions$freqCut
[1] 19
$preProcOptions$uniqueCut
[1] 10
$preProcOptions$cutoff
[1] 0.9
$sampling
NULL
$index
NULL
$indexOut
NULL
$indexFinal
NULL
$timingSamps
[1] 0
$predictionBounds
[1] FALSE FALSE
$seeds
[1] NA
$adaptive
$adaptive$min
[1] 5
$adaptive$alpha
[1] 0.05
$adaptive$method
[1] "gls"
$adaptive$complete
[1] TRUE
$trim
[1] FALSE
$allowParallel
[1] TRUE
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.