Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
445 views
in Technique[技术] by (71.8m points)

classification - ROC curve for a binary classifier in MATLAB

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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...