Does the area under
ROC curve depends on which class is defined as default positive class by the random forest model?
I am using
caret package in
R to train and validate a random forest model.
library("ROCR") library(caret) rfmodel=train(x,y,method="rf",trainControl=ctrl, ntree=500,tuneGrid=data.frame(mtry=c(2,3,4))) print(rfmodel) predict.rf=predict(rfmodel,testdata,type="prob")
predict.rf has two columns representing probability for class 0 and class 1 respectively, which of this column should be used to calculate area under ROC curve.
In current case, By default the
tpr is defined by taking class 0 as the positive class. As I understand The ROC curve is a plot between
fpr. Does the
ROC curve and
AUC change if I define the positive class as 1 and accordingly
fpr will be swapped?