[R] Question about ROCR package

Tobias Sing tobias.sing at gmail.com
Sun Feb 8 14:39:32 CET 2009


Waverley,

you can also use perf at y.values to access the slot (see
help(performance-class) for a description of the slots).

You might also want have a look at the code for demo(ROCR) and at this
slide deck:
http://rocr.bioinf.mpi-sb.mpg.de/ROCR_Talk_Tobias_Sing.ppt

HTH,
  Tobias

On Sat, Feb 7, 2009 at 10:40 PM, Jorge Ivan Velez
<jorgeivanvelez at gmail.com> wrote:
> Hi Waverley,
> I forgot to tell you that "perf" is your performance object. Here is an
> example from the ROCR package:
> ## computing a simple ROC curve (x-axis: fpr, y-axis: tpr)
> library(ROCR)
> data(ROCR.simple)
> pred <- prediction( ROCR.simple$predictions, ROCR.simple$labels)
> perf <- performance(pred,"tpr","fpr")
>
> # y.values
> unlist(slot(perf,"y.values"))
>
> HTH,
>
> Jorge
>
>
>
>> On Sat, Feb 7, 2009 at 3:17 PM, Waverley <waverley.paloalto at gmail.com>wrote:
>>
>>> Hi,
>>>
>>> I have a question about ROCR package.  I got the ROC curve plotted
>>> without any problem following the manual.  However, I don't know to
>>> extract the values, e.g. y.values ( I think it is the area under the
>>> curve auc measure).  The return is an object of class "performance"
>>> which have Slots and one of the slot is "y.values".  I type the object
>>> and I can see them in screen.  But I want to extract the value for
>>> further programming and computation.  I did a summary of the object
>>> and it is a "S4" mode which I don't understand.
>>>
>>> Can someone help?
>>>
>>> Thanks a lot in advance.
>>>
>>> --
>>> Waverley @ Palo Alto
>>>
>>> ______________________________________________
>>> 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.
>>>
>>
>>
>
>        [[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