ipa-tys / ROCR

An R package for visualizing classifier performance (Sing/Sander/Beerenwinkel/Lengauer [2005] Bioinformatics)

Home Page:http://rocr.bioinf.mpi-sb.mpg.de/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

performance() doesn't return any value

CHENGHAO-WANG opened this issue · comments

Thanks so much for the nice package.

I meant to make an ROC plot and calculate the AUC. But I couldn't get the AUC somehow.

> lda.posterior <- predict(fit.lda, dat.dr, type="raw")
> pred <- prediction(lda.posterior$posterior[,2],dat.dr$is_female)
> perf <- performance(pred,"tpr","fpr")
> plot(perf,xlab="1-specificity",ylab="sensitivity") # I had no issue with this step. I got a nice ROC plot.
> performance(pred,"auc")
A performance instance
  'Area under the ROC curve'

No error messages. But AUC wasn't shown up.

It is not printed, when printing the object, but it is calculated.

Why didn't you assign the output of performance(pred,"auc") to a new object?

How about this:

perf2 <- performance(pred,"auc")
perf2@y.values

For more details see ?performance-class``