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``