{"id":5151,"date":"2025-07-14T07:44:29","date_gmt":"2025-07-14T06:44:29","guid":{"rendered":"https:\/\/pcool.dyndns.org\/?page_id=5151"},"modified":"2025-07-14T10:13:25","modified_gmt":"2025-07-14T09:13:25","slug":"precision-and-recall","status":"publish","type":"page","link":"https:\/\/pcool.dyndns.org\/index.php\/precision-and-recall\/","title":{"rendered":"Precision and Recall"},"content":{"rendered":"\n<p>Precision = Positive Predictive Value<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>When the test is positive, the probability you have the condition<\/li>\n\n\n\n<li>Or in object detection, the probability that a predicted identification is correct<\/li>\n<\/ul>\n\n\n\n<p>Recall = Sensitivity <\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>When you have the condition, the test identifies it<\/li>\n\n\n\n<li>Or in object detection, the probability that an object is identified<\/li>\n<\/ul>\n\n\n\n<p>Accuracy<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>In machine learning, the proportion of correctly identified objects<\/li>\n<\/ul>\n\n\n\n<p>F1 score <\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>In object detection machine learning, identifications can be\n<ul class=\"wp-block-list\">\n<li>True positive (the identification is correct)<\/li>\n\n\n\n<li>False positive (the identification is not an object)<\/li>\n\n\n\n<li>False negative (the object has not been identified)<\/li>\n\n\n\n<li>However, there are no &#8216;true negatives&#8217; as the an object is either identified or it is not<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<p>The accuracy is not a good performance measure and often the F1 score is used. The F1 score is the <a href=\"https:\/\/pcool.dyndns.org\/index.php\/which-mean\/\" data-type=\"page\" data-id=\"5153\">harmonic mean<\/a> of precision and recall (in ratios the harmonic mean is used rather than the arithmetic mean). <\/p>\n\n\n\n<div class=\"wp-block-mathml-mathmlblock\">\\( F1 = \\frac{2}{Recall^{-1} + Precision^{-1}} = 2 \\cdot\\frac{Precision\\cdot{Recall}}{Precision + Recall} = \\frac{2\\cdot{TP}}{2\\cdot{TP} + FP + FN}\\)<script src=\"https:\/\/pcool.dyndns.org\/wp-includes\/js\/dist\/hooks.min.js?ver=dd5603f07f9220ed27f1\" id=\"wp-hooks-js\"><\/script>\n<script src=\"https:\/\/pcool.dyndns.org\/wp-includes\/js\/dist\/i18n.min.js?ver=c26c3dc7bed366793375\" id=\"wp-i18n-js\"><\/script>\n<script id=\"wp-i18n-js-after\">\nwp.i18n.setLocaleData( { 'text direction\\u0004ltr': [ 'ltr' ] } );\n\/\/# sourceURL=wp-i18n-js-after\n<\/script>\n<script  async src=\"https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/mathjax\/2.7.7\/MathJax.js?config=TeX-MML-AM_CHTML\" id=\"mathjax-js\"><\/script>\n<\/div>\n\n\n\n<p>or in general (in the F1 score, \\beta = 1):<\/p>\n\n\n\n<div class=\"wp-block-mathml-mathmlblock\">\\( F\\beta = \\frac{\\beta^{2} + 1}{\\beta^{2} \\cdot Recall^{-1} + Precision^{-1} } = \\frac{(1 + \\beta^2) \\cdot Precision \\cdot Recall}{b^2 \\cdot Precision + Recall} = \\frac{(1 + \\beta^2) \\cdot TP}{(1 + \\beta^2) \\cdot TP + \\beta^2 \\cdot FN + FP)} \\)<\/div>\n\n\n\n<p>Sometimes, focus is more on recall, when the F2 score is used where false negatives are more costly than false positives:<\/p>\n\n\n\n<div class=\"wp-block-mathml-mathmlblock\">\\( F2 = \\frac{5}{4 \\cdot Recall^{-1} + Precision^{-1} } = \\frac{5 \\cdot Precision \\cdot Recall}{4 \\cdot Precision + Recall} = \\frac{5 \\cdot TP}{5 \\cdot TP + 4 \\cdot FN + FP)} \\)<\/div>\n\n\n\n<p>At other times, focus should be more on precision, when the F0.5 score is used where false positives are more costly than false negatives:<\/p>\n\n\n\n<div class=\"wp-block-mathml-mathmlblock\">\\( F0.5 = \\frac{1.25}{0.25 \\cdot Recall^{-1} + Precision^{-1} } = \\frac{1.25 \\cdot Precision \\cdot Recall}{0.25 \\cdot Precision + Recall} = \\frac{1.25 \\cdot TP}{1.25 \\cdot TP + 0.25 \\cdot FN + FP)} \\)<\/div>\n\n\n\n<p> <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Precision = Positive Predictive Value Recall = Sensitivity Accuracy F1 score The accuracy is not a good performance measure and often the F1 score is used. The F1 score is the harmonic mean of precision and recall (in ratios the harmonic mean is used rather than the arithmetic mean). or in general (in the F1 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"inline_featured_image":false,"footnotes":""},"class_list":["post-5151","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/pcool.dyndns.org\/index.php\/wp-json\/wp\/v2\/pages\/5151","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pcool.dyndns.org\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/pcool.dyndns.org\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/pcool.dyndns.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pcool.dyndns.org\/index.php\/wp-json\/wp\/v2\/comments?post=5151"}],"version-history":[{"count":7,"href":"https:\/\/pcool.dyndns.org\/index.php\/wp-json\/wp\/v2\/pages\/5151\/revisions"}],"predecessor-version":[{"id":5179,"href":"https:\/\/pcool.dyndns.org\/index.php\/wp-json\/wp\/v2\/pages\/5151\/revisions\/5179"}],"wp:attachment":[{"href":"https:\/\/pcool.dyndns.org\/index.php\/wp-json\/wp\/v2\/media?parent=5151"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}