[R] ordered lable in ROCR

genomenet at gmail.com genomenet at gmail.com
Thu Mar 1 06:52:49 CET 2012


Hi There,

I  don't understand how to order the label in ROCR package in order to
get the correct result. I am wondering whether you can help me.

library(ROCR)
data(ROCR.simple)
pred <- prediction(ROCR.simple$predictions,ROCR.simple$labels)
svm.auc <- performance(pred, 'tpr', 'fpr')
plot(svm.auc)

#####label 
ROCR.simple$labels[ROCR.simple$labels=="0"]="tumor"
ROCR.simple$labels[ROCR.simple$labels==1]="normal"

pred <- prediction(ROCR.simple$predictions,ROCR.simple$labels)

svm.auc <- performance(pred, 'tpr', 'fpr')

plot(svm.auc)

The ROC curve is fliped. How do we know which order of labels we should choose?

Is this a bug of ROC?

thank you very much.

Mike



More information about the R-help mailing list