Skip to content

Instantly share code, notes, and snippets.

@limzunyuan
Created January 2, 2016 18:02
Show Gist options
  • Save limzunyuan/57aa829833e1ca6f59e5 to your computer and use it in GitHub Desktop.
Save limzunyuan/57aa829833e1ca6f59e5 to your computer and use it in GitHub Desktop.
function [result] = avg_precision_rate(matrix)
dim = size(matrix, 1);
result = zeros(1, dim);
for n = 1:size(matrix, 1)
col = matrix(:, n);
tp = col(n);
denom = sum(col);
result(n) = tp/denom;
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment