我正在尝试通过R编程实现SVM分类。我将数据帧划分为训练集和测试集,因此我想将训练集划分为n个分区,并将每个分区发送到一个节点进行学习(每个节点应该是不同的)。
我该怎么办?
R代码:
library(caret)
heart_df <- read.csv("heart_tidy.csv", sep = ',', header = FALSE)
intrain <- createDataPartition(y = heart_df$V14, p= 0.7, list = FALSE)
training <- heart_df[intrain,]
testing <- heart_df[-intrain,]
svm_Linear <- train(V14 ~., data = training, method = "svmLinear", trControl=trctrl, preProcess = c("center", "scale"), tuneLength = 10)
test_pred <- predict(svm_Linear, newdata = testing)