필터 지우기
필터 지우기

How to compute `AUC` for NN (`patternnet`)?

조회 수: 2 (최근 30일)
elham
elham 2020년 11월 27일
댓글: Jan Schulze 2022년 5월 6일
According to the following code of Matlab, I'm trying to get the AUC of a neural network (patternnet), so I have used the perfcurve function (see the related outputs):
(There are two different classes - labeled 0, 1).
[net, tr] = train(net, xtrain', ytrain'); % xtrain = 64x4; xtest = 7x4;
y_pred = net(xtest');
[~,indicesPredicted] = max(y_pred,[],1);
% output of y_pred (2x7):
% [0.557, 0.557, 0.557, 0.557, 0.788, 0.574, 0.557;
% 0.442, 0.442, 0.442, 0.442, 0.212, 0.425, 0.442]
%
% and so the output of
% indicesPredicted is [1, 1, 1, 1, 1, 1, 1];
score = y_pred';
[~,~,~,AUC] = perfcurve(indicesReal', score(:,2), 1); % indicesReal = [0, 1, 1, 1, 0, 0, 0];
% The output of AUC is 1.
While the result of AUC isn't correct because:
predicted Real
ans = ans =
1 (class 2) 0 (class 1)
1 (class 2) 1 (class 2)
1 (class 2) 1 (class 2)
1 (class 2) 1 (class 2)
1 (class 2) 0 (class 1)
1 (class 2) 0 (class 1)
1 (class 2) 0 (class 1)
How to compute the posterior probabilities (scores) for NN (patternnet) to get AUC?
Also, I have tested the [y_pred, score] = predict(net, xtest); and an error has occurred about predict:
"Error using predict
No valid system or dataset was specified."
I have also seen the related links such as: Link1, Link2, Link3.
  댓글 수: 1
Jan Schulze
Jan Schulze 2022년 5월 6일
I have the same question. can anybody help us?

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Classification Learner App에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by