How to use Matlabs perfcurve and confusion.getMatrix for ROC curves and confusion matrices [on hold]
    2 views (last 30 days)
  
       Show older comments
    
I am trying to use matlab in order to plot the ROC curve for Data of signal detection (audio signal detected by mouse).
I used the commands:
[c_matrix,Result,RefereceResult]= confusion.getMatrix(truth ,mouse);    
[X,Y] = perfcurve(truth,mouse,1);  
plot(X,Y);    
hold on;      
x = 1 - Result.Specificity;    
y = Result.Sensitivity;    
plot(x,y,'-o','MarkerFaceColor',[0.929,0.694,0.125],'MarkerSize',10);    

Where:
truth(i)=
\left\{ 
\begin{array}{}
0 \text{  }   \text{ if a signal should be detected in the i'th trial}\\ 
1 \text{  }   \text{ if a signal should not be detected in the i'th trial}\\  
\end{array}
\right. 
and 
mouse(i)=
\left\{ 
\begin{array}{}
0 \text{  }   \text{ if the mouse detected a signal in the i'th trial}\\ 
1 \text{  }   \text{ if the mouse didn't detect a signal in the i'th trial}\\  
\end{array}
\right. 
I attach here the figure I got.
It seems to me that the ROC function is not correct because, if I understood correctly, the point $$(1-specificity,sensitivity) = (FP,TP)$$
should be on the ROC curve.  
In general, I think I am having troubles understanding some stuff: 
**1**. what should be the input to [X,Y] = perfcurve(labels,scores,posclass).     
**2**. Is 'labels' really the truth and 'scores' the performent?    
**3**. Does '0' denotes a detection or maybe '1'?    
**4**. Also, what does it mean to plug 'posclass = 1'?    
(I did it because I didn't know what to put in there...)
I've been looking for houres by now in the internet and in the function description, and I can't figure this thing out..
Any help will be great.
Thanks!


0 Comments
Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!