This is probably an easy question but I have been stuck on it for ages. I have build a classification random forest model to predict the classifications of my test set and attached the outcome to my dataframe as follows.
RandomTree <- randomForest(as.factor(OutcomeVariable) ~ ., data=TrainSet, ntree=30 ,
importance=TRUE, samplesize=c(5195,5195))
Prediction<-predict(RandomTree, TestSet, type="response")
TestSet$Prediction<-Prediction
I want to try and create a ROC curve and calculate the AUC from this. I understand the classification predictions need to be converted to probabilities however I am unsure of how to do this. The reason for this is so I can compare the results of my random forest with a logistic regression I have also modeled. I was able to get a ROC curve from my logistic regression.
Any help would be much appreciated. Thanks