The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Software » comp.soft-sys.matlab

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: How to use the 'perfcurve' of Matlab with specific inputs?
Replies: 0  

Advanced Search

Back to Topic List Back to Topic List  

Posts: 110
Registered: 6/2/11
How to use the 'perfcurve' of Matlab with specific inputs?
Posted: Mar 19, 2013 8:14 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Hi Smart guys,

I wrote following codes to get a plot of 'classification accuracy' vs. 'threshold':

(The datasets has the ground truth contains two classes labelled 'Good' or 'Bad')

LDAClassifierObject =, groundTruthGroup, 'DiscrimType', 'linear');
[LDALabel, LDAScore] = resubPredict(LDAClassifierObject);

[~, AccuracyLDA, Thr] = perfcurve(groundTruthNumericalLable(:,1), LDAScore(:,1), 1,'yCrit','accu');
hold on;
xlabel('Threshold for ''good'' Returns');
ylabel('Classification Accuracy');
grid on;

[maxVal, maxInd] = max(AccuracyLDA)

maxVal =


maxInd =



ans =


Also, I run the ROC analysis for the same datasets that the ground truth contains two classes labelled 'Good' or 'Bad'

[FPR, TPR, Thr, AUC, OPTROCPT] = perfcurve(groundTruthGroup(:,1), LDAScore(:,1), 'Good');


0.1250 0.8667

Why Thr(15)=0.7711 is different from OPTROCPT(2)=0.8667 ?

Is the best cut-off point (ie, the best threshold OPTROCPT) obtained by ROC is the one has maximum accuracy of LDA?

Or maybe I am wrong, then what exactly `perfcurve(groundTruthNumericalLable(:,1), LDAScore(:,1), 1,'yCrit','accu')` tell us?

Thanks a lot.


Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.