Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

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


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

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

Advanced Search

Back to Topic List Back to Topic List  
Aaronne

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 = ClassificationDiscriminant.fit(featureSelcted, groundTruthGroup, 'DiscrimType', 'linear');
[LDALabel, LDAScore] = resubPredict(LDAClassifierObject);

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

[maxVal, maxInd] = max(AccuracyLDA)

maxVal =

0.8696

maxInd =

15

Thr(15)

ans =

0.7711


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');

OPTROCPT =

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.



A.



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

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.