调整后的插入训练和预测

时间:2017-03-12 08:17:48

标签: r prediction r-caret

我目前正在研究一篇研究论文。 我的数据集包含每日股票指数数据和预测器,表示UP或DOWN。

总的来说,我使用20%的数据集来调整参数。基于下面的代码,我发现我应该使用sigma = 0.05和C = 25.

现在,我希望根据这些设置对我的数据集进行50%的训练,并对该组的其他50%进行预测。

有谁能解释我应该怎么做?我无法找到如何处理插入的文档。

### MODELS
## SetUp Training
trainControl <- trainControl(method="cv", index = fit_on, indexOut = pred_on, savePredictions = TRUE)
metric <- "Accuracy"

## Parameter tuning
# SVM
set.seed(1908)
grid_rf <- expand.grid(C = c(0.1, 0.25, 0.5, 1, 5, 10, 25, 50), sigma = c(0,025, 0.05, 0.1, 0.25, 0.5, 1, 1.5, 2, 2.5, 3, 3.5,4,4.5,5,7,5,10,15))
fit.svm <- train(class~., data=dataCombined, method="svmRadial", metric=metric, preProc=c("range"),trControl=trainControl, tuneGrid = grid_rf)

非常感谢!

最佳,

Mathijs

0 个答案:

没有答案