6 lines
184 B
Matlab
6 lines
184 B
Matlab
function [er, bad] = nntest(nn, x, y)
|
|
labels = nnpredict(nn, x);
|
|
[dummy, expected] = max(y,[],2);
|
|
bad = find(labels ~= expected);
|
|
er = numel(bad) / size(x, 1);
|
|
end
|