Hi Camille,
Probably you have to check wether there is any infinte value in x.
Or calculate something like that for your x-axis:
x[1:(ll-1)]+diff(x)/2
Regards,
Pascal
- Mail original -
De : Camille Leclerc
À : r-help@r-project.org
Cc :
Envoyé le : Lundi 26 mars 2012 0h32
Objet : Re:
Hi Camille,
Does following work?
ll <- length(x)
(TPR[1:(ll-1)]-TPR[2:ll])/(FPR[1:(ll-1)]-FPR[2:ll])
Regards,
Pascal
--
View this message in context:
http://r.789695.n4.nabble.com/ROC-Analysis-tp4469203p4478233.html
Sent from the R help mailing list archive at Nabble.com.
___
Hi Camille,
Probably by adding these lines:
fpf <- unlist(performance(pred,"fpr")@y.values)
fnf <- unlist(performance(pred,"fnr")@y.values)
pLhood <- tpf/fpf # Positive Likelihood Ratio
nLhood <- fnf/tnf # Negative Likelihood Ratio
par(mfrow=c(1,2))
plot(x, pLhood, t='l', xlab='Value', ylab
Hi Camille,
I am surprised by your answer. If you do:
pred <- prediction(ROCR.simple$predictions*1000, ROCR.simple$labels)
x <- rev(unlist(pred@cutoffs))
You can see than x values are now between 0 and 1000. So, it should be probably
the same for your data.
Regards,
Pascal
--
View this me
Hi Camille,
Do you need something like that?
###
library(ROCR)
data(ROCR.simple)
pred <- prediction(ROCR.simple$predictions, ROCR.simple$labels)
tpf <- unlist(performance(pred,"tpr")@y.values)
tnf <- unlist(performance(pred,"tnr")@y.values)
x <- rev(unlist(pred@cutoffs))
plot(x
5 matches
Mail list logo