[R] ROC Analysis

Camille Leclerc camille.leclerc at ymail.com
Sun Mar 25 17:32:20 CEST 2012


Hi everybody,

Pascal, your code works, but when I want to do the graph I have an error
message. 

here is my code :
x<-rev(unlist(pred at cutoffs))
tpf<-unlist(performance(pred, "tpr")@y.values)
fpf<-unlist(performance(pred,"fpr")@y.values)
ll<-length(x)
p<-(tpf[1:(ll-1)]-tpf[2:ll])/(fpf[1:(ll-1)]-fpf[2:ll])
plot(x,p)

*Erreur dans xy.coords(x, y, xlabel, ylabel, log) : 
'x' and 'y' lengths differ*

So, when I look the lenghts of x and p, I have this :
*x : numeric[1735]
p : numeric[1734]*

On the other hand, it's normal since I have the slope between two points on
the ROC curve and so I have x points and x-1 slope values. How to get the
graph?!

All the best,
Camille

-----
--
Camille Leclerc, Master student
Lab ESE, UMR CNRS 8079
Univ Paris-Sud
Bat 362
F-91405  Orsay Cedex FRANCE
--
View this message in context: http://r.789695.n4.nabble.com/ROC-Analysis-tp4469203p4503354.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list