csci5521/assignments/hwk02/Error_Rate.m
2023-10-25 05:20:44 -05:00

17 lines
No EOL
399 B
Matlab

% implements Error_Rate, returns nothing but prints the percentage of
% predicted labels that are incorrrect.
function [] = Error_Rate(predictions, labels)
% compute error rate and print it out
c = 0;
[total_rows, ~] = size(predictions);
for i = 1:total_rows
if predictions(i) == labels(i)
c = c + 1;
end
end
fprintf('%d%% ', 100 * c / total_rows);
end % Function end