Skip to content

Instantly share code, notes, and snippets.

@limzunyuan
Created January 2, 2016 18:01
Show Gist options
  • Save limzunyuan/15f27ead4e4c99b9fc7a to your computer and use it in GitHub Desktop.
Save limzunyuan/15f27ead4e4c99b9fc7a to your computer and use it in GitHub Desktop.
function [ rate ] = avg_classification_rate( matrix )
%AVG_CLASSFICATION_RATE Calculates average classification rate
% CR is no. of correctly classified examples (trace) divided by
% total no. of examples (sum of matrix)
total = sum(sum(matrix));
correct = trace(matrix);
rate = correct / total;
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment