Hi all, I have tried a 5 fold cross validation using caret package with random forest method on iris dataset as example. Then I need ROC curve for each fold:
> set.seed(1) > train_control <- trainControl(method="cv", number=5,savePredictions = TRUE,classProbs = TRUE) > output <- train(Species~., data=iris, trControl=train_control, method="rf") > library(pROC) > selectedIndices <- output$pred$Resample == "Fold1" > plot.roc(output$pred$obs[selectedIndices],output$pred$setosa[selectedIndices]) > selectedIndices <- output$pred$Resample == "Fold2" > plot.roc(output$pred$obs[selectedIndices],output$pred$setosa[selectedIndices]) > selectedIndices <- output$pred$Resample == "Fold3" > plot.roc(output$pred$obs[selectedIndices],output$pred$setosa[selectedIndices]) and the same for Fold4 and Fold5,now how can I bring all the plots in one plot with labels for each fold? Thanks for any help! Elahe ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.