{"id":6463,"date":"2024-08-15T11:00:37","date_gmt":"2024-08-15T03:00:37","guid":{"rendered":"https:\/\/t.n-years.com\/?p=6463"},"modified":"2024-08-15T11:00:37","modified_gmt":"2024-08-15T03:00:37","slug":"%e6%a8%a1%e5%9e%8b%e8%af%84%e4%bc%b0%e4%b9%8b-macro-f1-%e6%8c%87%e6%a0%87","status":"publish","type":"post","link":"https:\/\/t.n-years.com\/?p=6463","title":{"rendered":"\u6a21\u578b\u8bc4\u4f30\u4e4b macro F1 \u6307\u6807"},"content":{"rendered":"<blockquote>\n<p>\u975e\u539f\u521b\uff0cChatGPT \u95ee\u7b54\u751f\u6210<\/p>\n<\/blockquote>\n<p>\u5728\u6570\u636e\u79d1\u5b66\u548c\u673a\u5668\u5b66\u4e60\u9886\u57df\uff0c<strong>\u5b8f\u89c2 F1 \u6307\u6807<\/strong>\uff08Macro F1 Score\uff09\u662f\u4e00\u79cd\u7efc\u5408\u6027\u80fd\u8bc4\u4f30\u6307\u6807\uff0c\u7279\u522b\u9002\u7528\u4e8e\u5206\u7c7b\u4efb\u52a1\u3002\u5b83\u662f\u5bf9 F1 Score \u7684\u4e00\u79cd\u6269\u5c55\uff0c\u7528\u4e8e\u8bc4\u4f30\u591a\u7c7b\u522b\u5206\u7c7b\u6a21\u578b\u7684\u8868\u73b0\u3002<\/p>\n<h3>\u4ec0\u4e48\u662f F1 Score\uff1f<\/h3>\n<p>F1 Score \u662f\u4e00\u79cd\u7efc\u5408\u8003\u8651\u4e86<strong>\u7cbe\u786e\u7387<\/strong>\uff08Precision\uff09\u548c<strong>\u53ec\u56de\u7387<\/strong>\uff08Recall\uff09\u7684\u6027\u80fd\u6307\u6807\uff0c\u7279\u522b\u9002\u7528\u4e8e\u4e0d\u5e73\u8861\u6570\u636e\u96c6\u3002\u5b83\u7684\u8ba1\u7b97\u65b9\u5f0f\u662f\u5b83\u4eec\u7684\u8c03\u548c\u5e73\u5747\u6570\uff0c\u516c\u5f0f\u5982\u4e0b\uff1a<\/p>\n<p>[ \\text{F1 Score} = 2 \\times \\frac{\\text{Precision} \\times \\text{Recall}}{\\text{Precision} + \\text{Recall}} ]<\/p>\n<ul>\n<li><strong>\u7cbe\u786e\u7387\uff08Precision\uff09<\/strong>\uff1a\u6a21\u578b\u9884\u6d4b\u4e3a\u6b63\u4f8b\u7684\u6837\u672c\u4e2d\u6709\u591a\u5c11\u662f\u6b63\u786e\u7684\u3002<\/li>\n<li><strong>\u53ec\u56de\u7387\uff08Recall\uff09<\/strong>\uff1a\u6240\u6709\u5b9e\u9645\u4e3a\u6b63\u4f8b\u7684\u6837\u672c\u4e2d\u6709\u591a\u5c11\u88ab\u6a21\u578b\u6b63\u786e\u9884\u6d4b\u4e3a\u6b63\u4f8b\u3002<\/li>\n<\/ul>\n<h3>\u5b8f\u89c2 F1 \u6307\u6807\uff08Macro F1 Score\uff09<\/h3>\n<p><strong>\u5b8f\u89c2 F1 \u6307\u6807<\/strong>\u662f\u5bf9\u6bcf\u4e2a\u7c7b\u522b\u5206\u522b\u8ba1\u7b97 F1 Score\uff0c\u7136\u540e\u5bf9\u8fd9\u4e9b F1 Scores \u6c42\u5e73\u5747\u7684\u4e00\u79cd\u65b9\u5f0f\u3002\u4e0e<strong>\u5fae\u89c2 F1 \u6307\u6807<\/strong>\uff08Micro F1 Score\uff09\u4e0d\u540c\uff0c\u5b8f\u89c2 F1 \u6307\u6807\u5bf9\u6bcf\u4e2a\u7c7b\u522b\u7684 F1 Score \u7ed9\u4e88\u76f8\u540c\u7684\u6743\u91cd\uff0c\u65e0\u8bba\u5404\u7c7b\u522b\u7684\u6837\u672c\u6570\u91cf\u5982\u4f55\u3002<\/p>\n<h3>\u8ba1\u7b97\u5b8f\u89c2 F1 \u6307\u6807\u7684\u6b65\u9aa4<\/h3>\n<ol>\n<li>\n<p><strong>\u8ba1\u7b97\u6bcf\u4e2a\u7c7b\u522b\u7684 F1 Score<\/strong>\uff1a<\/p>\n<ul>\n<li>\u5bf9\u4e8e\u6bcf\u4e2a\u7c7b\u522b\uff0c\u8ba1\u7b97\u8be5\u7c7b\u522b\u7684\u7cbe\u786e\u7387\u548c\u53ec\u56de\u7387\uff0c\u5e76\u5229\u7528\u4e0a\u8ff0\u516c\u5f0f\u8ba1\u7b97 F1 Score\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u8ba1\u7b97\u5b8f\u89c2 F1 \u6307\u6807<\/strong>\uff1a<\/p>\n<ul>\n<li>\u5bf9\u6240\u6709\u7c7b\u522b\u7684 F1 Score \u6c42\u5e73\u5747\uff1a<\/li>\n<\/ul>\n<p>[ \\text{Macro F1 Score} = \\frac{1}{C} \\sum_{i=1}^{C} \\text{F1 Score}_i ]<\/p>\n<p>\u5176\u4e2d ( C ) \u662f\u7c7b\u522b\u603b\u6570\uff0c( \\text{F1 Score}_i ) \u662f\u7b2c ( i ) \u4e2a\u7c7b\u522b\u7684 F1 Score\u3002<\/p>\n<\/li>\n<\/ol>\n<h3>\u9002\u7528\u573a\u666f<\/h3>\n<ul>\n<li><strong>\u7c7b\u522b\u4e0d\u5e73\u8861<\/strong>\uff1a\u5728\u6570\u636e\u96c6\u4e2d\uff0c\u67d0\u4e9b\u7c7b\u522b\u7684\u6837\u672c\u6570\u8fdc\u8fdc\u5c11\u4e8e\u5176\u4ed6\u7c7b\u522b\u65f6\uff0c\u5b8f\u89c2 F1 \u6307\u6807\u53ef\u4ee5\u63d0\u4f9b\u66f4\u5168\u9762\u7684\u6027\u80fd\u8bc4\u4f30\u3002<\/li>\n<li><strong>\u5747\u8861\u91cd\u8981\u6027<\/strong>\uff1a\u5f53\u4f60\u5e0c\u671b\u6a21\u578b\u5bf9\u6240\u6709\u7c7b\u522b\u6709\u5747\u8861\u7684\u6027\u80fd\u8bc4\u4f30\u65f6\uff0c\u5b8f\u89c2 F1 \u6307\u6807\u662f\u4e00\u4e2a\u5408\u9002\u7684\u9009\u62e9\uff0c\u56e0\u4e3a\u5b83\u4e0d\u53d7\u7c7b\u522b\u6837\u672c\u6570\u91cf\u7684\u5f71\u54cd\u3002<\/li>\n<\/ul>\n<h3>\u4e3e\u4f8b\u8bf4\u660e<\/h3>\n<p>\u5047\u8bbe\u4f60\u6709\u4e09\u4e2a\u7c7b\u522b\uff1aA\u3001B \u548c C\uff0c\u6a21\u578b\u5728\u8fd9\u4e9b\u7c7b\u522b\u4e0a\u7684 F1 Scores \u5206\u522b\u4e3a 0.8\u30010.6 \u548c 0.9\uff0c\u90a3\u4e48\u5b8f\u89c2 F1 Score \u7684\u8ba1\u7b97\u8fc7\u7a0b\u5982\u4e0b\uff1a<\/p>\n<ol>\n<li>\n<p>\u8ba1\u7b97\u6bcf\u4e2a\u7c7b\u522b\u7684 F1 Score\uff1a<\/p>\n<ul>\n<li>\u7c7b\u522b A \u7684 F1 Score = 0.8<\/li>\n<li>\u7c7b\u522b B \u7684 F1 Score = 0.6<\/li>\n<li>\u7c7b\u522b C \u7684 F1 Score = 0.9<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u8ba1\u7b97\u5b8f\u89c2 F1 Score\uff1a<br \/>\n[ \\text{Macro F1 Score} = \\frac{0.8 + 0.6 + 0.9}{3} = \\frac{2.3}{3} \\approx 0.767 ]<\/p>\n<\/li>\n<\/ol>\n<p>\u56e0\u6b64\uff0c\u5b8f\u89c2 F1 \u6307\u6807\u662f 0.767\u3002<\/p>\n<p>\u603b\u7ed3\u6765\u8bf4\uff0c\u5b8f\u89c2 F1 \u6307\u6807\u63d0\u4f9b\u4e86\u4e00\u79cd\u6709\u6548\u7684\u65b9\u5f0f\u6765\u8861\u91cf\u5206\u7c7b\u6a21\u578b\u5728\u6240\u6709\u7c7b\u522b\u4e0a\u7684\u603b\u4f53\u8868\u73b0\uff0c\u7279\u522b\u662f\u5728\u7c7b\u522b\u4e0d\u5e73\u8861\u7684\u60c5\u51b5\u4e0b\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u975e\u539f\u521b\uff0cChatGPT \u95ee\u7b54\u751f\u6210 \u5728\u6570\u636e\u79d1\u5b66\u548c\u673a\u5668\u5b66\u4e60\u9886\u57df\uff0c\u5b8f\u89c2 F1 \u6307\u6807\uff08Macro F1 Score\uff09\u662f&#8230; <\/p>\n<div class=\"read-more navbutton\"><a href=\"https:\/\/t.n-years.com\/?p=6463\">\u9605\u8bfb\u66f4\u591a<i class=\"fa fa-angle-double-right\"><\/i><\/a><\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[137],"tags":[99],"class_list":["post-6463","post","type-post","status-publish","format-standard","hentry","category-llm","tag-99"],"_links":{"self":[{"href":"https:\/\/t.n-years.com\/index.php?rest_route=\/wp\/v2\/posts\/6463","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/t.n-years.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/t.n-years.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/t.n-years.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/t.n-years.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=6463"}],"version-history":[{"count":1,"href":"https:\/\/t.n-years.com\/index.php?rest_route=\/wp\/v2\/posts\/6463\/revisions"}],"predecessor-version":[{"id":6464,"href":"https:\/\/t.n-years.com\/index.php?rest_route=\/wp\/v2\/posts\/6463\/revisions\/6464"}],"wp:attachment":[{"href":"https:\/\/t.n-years.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6463"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/t.n-years.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=6463"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/t.n-years.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=6463"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}