ROC curve for a binary classifier in MATLAB

2019-01-26 18:06发布

I have a binary classifier, which classifies an input X as class zero if its predicted value is below some threshold (say T), and one otherwise.
I have all predicted and actual values for every input. So I can have both predicted class and actual class of an input.

Now I want to have the ROC curve for this classifier with MATLAB. How should I do it?

1条回答
兄弟一词,经得起流年.
2楼-- · 2019-01-26 18:37

Use perfcurve:

[X,Y] = perfcurve(labels,scores,posclass);
plot(X,Y);

labels are the true labels of the data, scores are the output scores from your classifier (before the threshold) and posclass is the positive class in your labels.

查看更多
登录 后发表回答