Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

createTimeSlices function in CARET package in R

I am working with multivariate financial time series data and having problems using the createTimeSlices function. I cannot find any use of the function except the one used by Max Kuhn. Can anybody help me in understanding the usage of the function?

like image 889
Panchacookie Avatar asked Mar 11 '14 19:03

Panchacookie


People also ask

What does caret package do in R?

Caret is a one-stop solution for machine learning in R. The R package caret has a powerful train function that allows you to fit over 230 different models using one syntax. There are over 230 models included in the package including various tree-based models, neural nets, deep learning and much more.

What does caret package do?

The caret package (short for Classification And REgression Training) contains functions to streamline the model training process for complex regression and classification problems.

What is createDataPartition R?

The function createDataPartition can be used to create balanced splits of the data. If the y argument to this function is a factor, the random sampling occurs within each class and should preserve the overall class distribution of the data.

What does Carrot mean in R?

Caret is short for Classification And REgression Training. It integrates all activities related to model development in a streamlined workflow. For nearly every major ML algorithm available in R.


1 Answers

The documentation is being "improved" on this feature (in other words, it currently sucks). Another person contacted me recently about this and here is the example:

library(caret)
library(ggplot2)
data(economics)
myTimeControl <- trainControl(method = "timeslice",
                              initialWindow = 36,
                              horizon = 12,
                              fixedWindow = TRUE)

plsFitTime <- train(unemploy ~ pce + pop + psavert,
                    data = economics,
                    method = "pls",
                    preProc = c("center", "scale"),
                    trControl = myTimeControl)

Max

like image 172
topepo Avatar answered Sep 18 '22 14:09

topepo