I need to draw ROC curve using the predicted probabilities for two class problem. The need is to use different cutoff in probabilities to generate the ROC curve.
I am predicting class probabilities using random forest
mydata<-read.table(file="out-all-gm-pr-hpcuts-wor-noAl.tr", header=TRUE, sep ="")
mydata$class <- as.factor(mydata$class)
mydata.rf<-randomForest(class ~ ., data=mydata, importance = TRUE, mtry = 3, ntree = 100, proximity = TRUE )
Prediction on test data using above forest
mytestdata<-read.table(file="gmsim-craboff.tes",header=TRUE)
testpred<-predict(mydata.rf,mytestdata,type='prob')
I now have a data file now with true class label and predicted probabilities for test data. I need to generate ROC curve using different cutoff (say 0.1
, 0.3
, 0.5
, 0.7
, 0.9
) in probabilities. How to go about it?
I would do the following: