How to get predictions for each fold in 10-fold cross-validation of the best tuned hyperparameters using caret package in r?
问题 I was trying to run SVM model using 10-fold cross-validation with 3 repeats using the caret package in R. I want to get the prediction results of each fold using the best tuned hyperparameters. I am using the following code # Load packages library(mlbench) library(caret) # Load data data(BostonHousing) #Dividing the data into train and test set set.seed(101) sample <- createDataPartition(BostonHousing$medv, p=0.80, list = FALSE) train <- BostonHousing[sample,] test <- BostonHousing[-sample,]