Rの各反復後にtestDataとtrainDataを保存したい場合、どうすればできますか?RでK倍になると、各反復後にどのように保存しますか?
#Create 10 equally size folds
folds <- cut(seq(1,nrow(cre_card)),breaks=10,labels=FALSE)
#Perform 10 fold cross validation
for(i in 1:10){
#Segement your data by fold using the which() function
testIndexes <- which(folds==i,arr.ind=TRUE)
testData <- cre_card[testIndexes, ]
trainData <- cre_card[-testIndexes, ]
#Use the test and train data partitions however you desire...
}