如何使用Matlab的'perfcurve'和特定输入?

时间:2013-03-19 12:11:24

标签: matlab roc

我编写了以下代码,以获得“分类准确度”与“阈值”的关系图:

(数据集的基本事实包含两个标记为'Good'或'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

此外,我对相同的数据集运行ROC分析,基础事实包含两个标记为“好”或“坏”的类

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

OPTROCPT =

    0.1250    0.8667

为什么Thr(15)=0.7711OPTROCPT(2)=0.8667不同?

ROC获得的最佳截止点(即最佳阈值OPTROCPT)是否具有LDA的最大准确度?

或许我错了,那么究竟perfcurve(groundTruthNumericalLable(:,1), LDAScore(:,1), 1,'yCrit','accu')告诉我们什么?

0 个答案:

没有答案