title: ROC and AUC using perfcurve and SVM (fitcsvm) in matlab
body: <p>In the <a href="https://www.mathworks.com/help/stats/perfcurve.html#bunsogv-scores" rel="nofollow noreferrer">perfcurve </a> function of matlab, it uses three arguments, </p>
  
  <pre><code>[X,Y,T,AUC] = perfcurve(labels,scores,posclass)
  </code></pre>
  
  <p>labels are the truth ground lables, scores are  returned by the classifier, and the positive class,</p>
  
  <p>In my case, I have two classes, labeled as:  1 (pos class) and 2 (neg calss), 
  I am using <a href="https://www.mathworks.com/help/stats/fitrsvm.html" rel="nofollow noreferrer">SVM</a> classifier,  it returns scores of two columns, and from what I understand is that the first column is the negative class while the second one is the positive class? (as explained here)</p>
  
  <p><a href="https://i.stack.imgur.com/GX65f.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/GX65f.png" alt="enter image description here"></a></p>
  
  <p>So the syntax sould be as follows?</p>
  
  <pre><code>[SVMX,SVMY,T,AUC] = perfcurve(lables, SVM_scores(:,2),1);
  </code></pre>