% Fit probabilities for scores groundTruthNumericalLable = [ones(50,1); zeros(50,1); -1.*ones(50,1)]; [FPR, TPR, Thr, AUC, OPTROCPT] = perfcurve(groundTruthNumericalLable(:,1), KNNScore(:,1), 1);
Then we can plot the FPR vs TPR to get the ROC curve.
However, the FPR and TPR is different from what I got using my own implementation that the one above will not display all the points, actually, the codes above display only three points on the ROC. The codes I implemented will dispaly 151 points on the ROC as the size of the data is 150.