Skip to content

Instantly share code, notes, and snippets.

@limzunyuan
Created January 2, 2016 18:03
Show Gist options
  • Save limzunyuan/c8b48eccc01fc1fe48d8 to your computer and use it in GitHub Desktop.
Save limzunyuan/c8b48eccc01fc1fe48d8 to your computer and use it in GitHub Desktop.
function [results] = f1_measure(matrix)
precision = avg_precision_rate(matrix);
recall = avg_recall_rate(matrix);
dim = size(matrix, 1);
results = zeros(1, dim);
for i = 1 : dim
results(i) = 2 * precision(i) * recall(i) / (precision(i) + recall(i));
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment