[R] Prediction-class ROCR

Tobias Sing tobias.sing at gmail.com
Thu Mar 19 10:14:00 CET 2009


Regina,

to get a simple ROC curve, use the following sequence of commands:
pred <- prediction(predictions, labels)
perf <- performance(pred, "tpr", "fpr")
plot(perf)
In the first line, 'predictions' are the raw predictions (usually
numerical) of your classifier, and labels (as you correctly guessed)
the true (binary) classes of your items. The true positive and false
positive rates _at various cutoffs_ are then calculated from the raw
predictions. The purpose of ROCR is to obtain these (and other) rates
--- if you already have them, I don't understand from your email what
else you want.

Just in case you are uncertain about the overall framework of
classification, take a look at this tutorial:
Fawcett, T. (2003):  ROC graphs: Notes and practical considerations
for data mining researchers
http://www.hpl.hp.com/techreports/2003/HPL-2003-4.pdf

The following slide deck also contains a brief introduction of the
framework, as well as usage examples of ROCR:
http://rocr.bioinf.mpi-sb.mpg.de/ROCR_Talk_Tobias_Sing.ppt

Hope that helps,
  Tobias



On Thu, Mar 19, 2009 at 3:01 AM, Regina Beretta Mazaro
<rberettam at hotmail.com> wrote:
>
>
>
>
> Hi,
>
> I'm involved in a bioinformatics project at my university, and we're doing a comparison paper between some methods of classification of nc-RNA. I've been encharged of ploting the ROC curves' graphs. But I'm new on working with R and I'm having some difficulty with the prediction-class. I don't get where the values of ROCR.simple$predictions, for example, came from ($labels I understand that represents the real classisfication of that item). And I just have the values for true positive, false positive, true negative and false positive, obtained from the methods tests. So, I can't plot a graph with my own values. How can I convert these values that I have into $predictions-type needed to run ROCR? Is there any function that does this? Or I have to redo the tests using another kind of measuring? If someone could help me, I'll be very grateful.
> Regina Beretta Mazaro.
> _________________________________________________________________
>
>
>        [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>




More information about the R-help mailing list