i have a datasets with 587 rows and 0 column. i do LOOCV for random forest and using "a" vector for plot ROC curve. this is my code for random forest:
a=1:587
for (k in 1:587){
set.seed(1)
a[k] <- predict(randomForest(death ~ .,
data = df2.imp$ximp[-k,], mtry=4),type="prob",
newdata = df2.imp$ximp[k,,drop=F])[2]
}
But this for loop doesn't work for SVM classifier . if i run this code , the results is null :
a=1:587
for (k in 1:587){
set.seed(1)
a[k] <- predict(svm(death ~ .,
data = df2.imp$ximp[-k,]),type="prob",
newdata = df2.imp$ximp[k,,drop=F])[2]
}
it is important for me to do LOOCV and plot ROC curve . is there another way to do these instead?