필터 지우기
필터 지우기

sir, following is the error in my program, here AUC (area under curve) is 0 0 and OPTROCPT also zero why so this...

조회 수: 1 (최근 30일)
clc
clear all;
c=[];
addpath train;
addpath test;
mapping=getmapping(8,'u2'); %LBP
W=[0,0,0,0,0,0,0; ...
0,1,1,1,1,1,0; ...
0,1,2,4,2,1,0; ...
0,1,4,4,4,1,0; ...
0,1,2,4,2,1,0; ...
0,1,1,1,1,1,0; ...
0,0,0,0,0,0,0];
%%Training images
for folder_idx = 1 : 10 % no of classes
for i = 1 : 9 % no of images per class
thisfile = fullfile('train', num2str(folder_idx), [num2str(i) '.bmp ']);
B = imread(thisfile );
X = double(B);
X = imresize(X,[60 60],'bilinear');
H2=DSLBP(X,mapping,W);
Gray=X;
Gray=(Gray-mean(Gray(:)))/std(Gray(:))*20+60;
lpqhist=lpq(Gray,3,1,1,'nh');
% imshow(lpqhist);
a=[H2,lpqhist];
c=[c;a];
disp(sprintf('Done',i));
end
end
%%Testing images
d=[];
for folder_idx = 1 : 10 %no of classes
for i = 1 : 3 % no of images per class
thisfile = fullfile('test', num2str(folder_idx), [num2str(i) '.bmp ']);
B = imread(thisfile );
X = double(B);
X = imresize(X,[60 60],'bilinear');
H2=DSLBP(X,mapping,W);
Gray=X;
Gray=(Gray-mean(Gray(:)))/std(Gray(:))*20+60;
lpqhist=lpq(Gray,3,1,1,'nh');
a=[H2,lpqhist];
d=[d;a];
disp(sprintf('Done',i));
end
end
P_train=c;
P_test=d;
% %%PCA low dimension reduction
%
P_train = P_train';
% if classes are 20 then eiganvectors not exceed then 179
model = perform_pca(P_train,89); %rank(P_train)-1
test_features= linear_subspace_projection(P_test, model, 1);
P_train=model.train';
P_test=test_features';
%%Normalisation
% P_train=P_train/256;
% P_test=P_test/256;
%%%%%%%%load label %%%%%%%%%%%%
train_label=load('train_label.txt');
test_label=load('test_label.txt');
predictlabel = knnclassify(P_test, P_train, train_label,3,'euclidean','nearest');
cp = classperf(test_label,predictlabel);
cp.CorrectRate*100
% Multiclass demo
disp('_____________Multiclass demo_______________')
disp('Runing Multiclass confusionmat')
[c_matrix,Result,RefereceResult]= confusion.getMatrix(test_label,predictlabel);
[FPR, TPR,Thr, AUC, OPTROCPT] = perfcurve(predictlabel, test_label,1)
% %
%plot(TPR,FPR,'--rs','LineWidth',2,'MarkerEdgeColor','k','MarkerFaceColor','g','MarkerSize',10)
figure,
plot(TPR,FPR,'r-','LineWidth',4);
xlabel('False positive rate')
ylabel('True positive rate')
title('ROC Curve for Classification ')
Tbl = table(FPR, TPR,Thr)
%
%
%%FAR = FPR = FP/(FP + TN) and FRR = FNR = FN/(FN + TP)
[FPR, FNR,Thr] = perfcurve(predictlabel, test_label,1,'xCrit','FPR','yCrit','FNR','TVals','all')
Thr = Thr/10;
figure,
plot(Thr,FPR,'r--','LineWidth',2,'MarkerEdgeColor','k','MarkerFaceColor','g','MarkerSize',10);
xlabel('Threshold')
ylabel('False positive rate / FAR')
title('ROC Curve for Classification ')
figure,
plot(Thr,FNR,'r--','LineWidth',2,'MarkerEdgeColor','k','MarkerFaceColor','g','MarkerSize',10);
xlabel('Threshold')
ylabel('False Negative rate / FRR')
title('ROC Curve for Classification ')
Tbl = table(FPR, FNR)
  댓글 수: 2
KALYAN ACHARJYA
KALYAN ACHARJYA 2018년 4월 10일
The value of AUC in between 0.5 (worst case) and 1 (ideal case).
Balaji M. Sontakke
Balaji M. Sontakke 2018년 4월 11일
could you tell me where am wrong, my classification accuracy is 96.56 but why this AUC is zero

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Deep Learning Toolbox에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by