# How to plot ROC for LOOCV by hand based on output probabilities returned by SVM? [duplicate]

I want to plot ROC for Leave-one-out (LOO) cross-validation (CV). I have the decision values as well as probability values for each class from SVM classifier. I did see the answer to this post; however, the answer was not complete about plotting ROC according to probabilities.

As an example the output of my classifier for one sample is like this:

c1a
1
attr(,"decision.values")
1/0
c1a 0.1338180
attr(,"probabilities")
1         0
c1a 0.6824716 0.3175284
Levels: 0 1


## marked as duplicate by Sycorax, Christoph Hanck, gung♦, whuber♦Feb 23 '16 at 16:01

• @user777 I have 120 samples not one sample. In my post, I just have shown the output of SVM for one sample. – user4704857 Feb 23 '16 at 14:24
• @user777 How? That is exactly my problem. – user4704857 Feb 23 '16 at 14:46
• No, my question is how I can calculate FPR and TPR from these probabilities to plot ROC? – user4704857 Feb 23 '16 at 14:51
• Answered here. The only difference is that you specify you're using LOOCV but that's irrelevant to the procedure. stats.stackexchange.com/questions/145566/… – Sycorax Feb 23 '16 at 14:54