MATLAB Answers

how to calculate precision and recall in MATLAB?

82 views (last 30 days)
sa mi
sa mi on 19 May 2015
Edited: Salma Hassan on 29 Jan 2018
how to calculate precision and recall in MATLAB?is there any builtin function for this
  3 Comments

Sign in to comment.

Answers (1)

Salma Hassan
Salma Hassan on 29 Jan 2018
Edited: Salma Hassan on 29 Jan 2018
[Xpr,Ypr,Tpr,AUCpr] =perfcurve(targets, scores, 1, 'xCrit', 'reca', 'yCrit', 'prec');
plot(Xpr,Ypr)
xlabel('Recall'); ylabel('Precision')
title(['Precision-recall curve (AUC: ' num2str(AUCpr) ')'])
****************or you can use these equations
p=tp/(tp+fp);
r= tp/(tp+fn);
F= ( 2*p*r)/(p+r);

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by