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');
y_pred = net(xtest');
[~,indicesPredicted] = max(y_pred,[],1);
score = y_pred';
[~,~,~,AUC] = perfcurve(indicesReal', score(:,2), 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."
0 Comments
Sign in to comment.