问题
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?
回答1:
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
来源:https://stackoverflow.com/questions/22334561/createtimeslices-function-in-caret-package-in-r