我正在尝试使用插入符包来预测经济数据。有什么方法可以预测 future 几年的值(value)吗?
library(mlbench)
library(caret)
library(pROC)
library(caTools)
library(ROCR)
myTimeControl <- trainControl( method = "timeslice", initialWindow = 36,
horizon = 12, fixedWindow = FALSE, allowParallel = TRUE, classProbs = TRUE,
summaryFunction = twoClassSummary, verboseIter = TRUE)
modelRF <- train(
as.factor(class) ~ . , data = TestData, method = "rf", metric = "ROC",
ntree = 1000, preProc = c("center", "scale"), trControl = myTimeControl)
请帮我预测 future 几年的类(class)。
最佳答案
您需要使用 predict
方法和 x
数据来预测您想要的结果。
关于machine-learning - 在 R 中使用插入符包进行时间序列预测,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45128351/