Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Plot ROC CURVE

117 views
Skip to first unread message

Salvatore Esposito

unread,
Jul 18, 2007, 3:14:51 PM7/18/07
to
Hi,

I implemented, in Matlab, a Bayes Detector, my code return me 2 vectors (100
x1):

TargetDecision: Bayes Detector Decision (my code) (1 for target presence, 0
for target absence)
TargetTrue: real target presence in my observation .

Because I want to plot a ROC curve, I put it in for cycle in this way :

%%%%%%%%
for 1=1:NumberExtraction


[TargetDecision TargetTrue]=BayesDetector(,...,....,)

TruePositive = length(find( TargetDecision==1)&(TargetTrue==1))
FalseNegative=length(find( TargetDecision==0)&(TargetTrue==1))
FalsePositive=length(find( TargetDecision==1)&(TargetTrue==0))
TrueNegative=length(find( TargetDecision==0)&(TargetTrue==0))

TruePositiveRate(i,1)=TruePositive / [TruePositive + FalseNegative]
FalsePositiveRate(i,1)=FalsePositive / [FalsePositive + TrueNegative]
end

plot(FalsePositiveRate, TruePositiveRate)

but it dosen't work. I don't have a correct RoC curve. Why? Is there a
conceptual mistake?

Thanks a lot for your help
Salvatore

marwa hadhoud

unread,
Feb 10, 2012, 3:58:27 PM2/10/12
to
you need to sort the FPR in ascending order and its corresponding TPR before plotting the ROC curve

"Salvatore Esposito" <salvatore...@alice.it> wrote in message <469e6810$0$4792$4faf...@reader4.news.tin.it>...
0 new messages