{"id":3135,"date":"2022-02-27T12:15:44","date_gmt":"2022-02-27T04:15:44","guid":{"rendered":"https:\/\/egonlin.com\/?p=3135"},"modified":"2022-04-06T17:27:49","modified_gmt":"2022-04-06T09:27:49","slug":"%e7%ac%ac%e4%b8%80%e8%8a%82%ef%bc%9a%e9%9b%86%e6%88%90%e5%ad%a6%e4%b9%a0%e5%9f%ba%e7%a1%80","status":"publish","type":"post","link":"https:\/\/egonlin.com\/?p=3135","title":{"rendered":"\u7b2c\u4e00\u8282\uff1a\u96c6\u6210\u5b66\u4e60\u57fa\u7840"},"content":{"rendered":"<h1>\u96c6\u6210\u5b66\u4e60\u57fa\u7840<\/h1>\n<p>&emsp;&emsp;\u96c6\u6210\u5b66\u4e60(ensemnle learning)\u901a\u8fc7\u6784\u5efa\u5e76\u7ed3\u5408\u591a\u4e2a\u5b66\u4e60\u5668\u6765\u5b8c\u6210\u5b66\u4e60\u4efb\u52a1\uff0c\u96c6\u6210\u5b66\u4e60\u53ef\u4ee5\u7528\u4e8e\u5206\u7c7b\u95ee\u9898\u96c6\u6210\u3001\u56de\u5f52\u95ee\u9898\u96c6\u6210\u3001\u7279\u5f81\u9009\u53d6\u96c6\u6210\u3001\u5f02\u5e38\u70b9\u68c0\u6d4b\u96c6\u6210\u7b49\u7b49\u3002<\/p>\n<h1>\u96c6\u6210\u5b66\u4e60\u57fa\u7840\u5b66\u4e60\u76ee\u6807<\/h1>\n<ol>\n<li>\u96c6\u6210\u5b66\u4e60\u6784\u6210<\/li>\n<li>Boosting\u548cBagging<\/li>\n<li>\u5e73\u5747\u6cd5\u3001\u6295\u7968\u6cd5\u548c\u5b66\u4e60\u6cd5<\/li>\n<\/ol>\n<h1>\u96c6\u6210\u5b66\u4e60\u57fa\u7840\u5f15\u5165<\/h1>\n<pre><code class=\"language-python\"># \u96c6\u6210\u5b66\u4e60\u57fa\u7840\u5f15\u5165\u56fe\u4f8b\nimport matplotlib.pyplot as plt\nimport matplotlib.patches as patches\nfrom matplotlib.font_manager import FontProperties\n%matplotlib inline\nfont = FontProperties(fname=&#039;\/Library\/Fonts\/Heiti.ttc&#039;, size=15)\n\nfig1 = plt.figure()\nax1 = fig1.add_subplot(111, aspect=&#039;equal&#039;)\nax1.add_patch(patches.Rectangle((1, 1), 5, 1.5, color=&#039;b&#039;))\nplt.text(2.6, 3.5, s=&#039;$\\cdots$&#039;, fontsize=30)\nax1.add_patch(patches.Rectangle((1, 5), 5, 1.5, color=&#039;b&#039;))\nax1.add_patch(patches.Rectangle((1, 7), 5, 1.5, color=&#039;b&#039;))\n\nplt.text(3.5, 7.5, s=&#039;\u4e2a\u4f53\u5b66\u4e60\u5668$_1$&#039;, fontsize=20, color=&#039;white&#039;,\n         ha=&#039;center&#039;, fontproperties=font)\nplt.text(3.5, 5.5, s=&#039;\u4e2a\u4f53\u5b66\u4e60\u5668$_2$&#039;, fontsize=20, color=&#039;white&#039;,\n         ha=&#039;center&#039;, fontproperties=font)\nplt.text(3.5, 1.5, s=&#039;\u4e2a\u4f53\u5b66\u4e60\u5668$_T$&#039;, fontsize=20, color=&#039;white&#039;,\n         ha=&#039;center&#039;, fontproperties=font)\n\nplt.annotate(s=&#039;&#039;, xytext=(6, 7.8), xy=(8, 4.7),\n             arrowprops=dict(arrowstyle=&quot;-&gt;&quot;, connectionstyle=&quot;arc3&quot;, color=&#039;orange&#039;))\nplt.annotate(s=&#039;&#039;, xytext=(6, 5.8), xy=(8, 4.2),\n             arrowprops=dict(arrowstyle=&quot;-&gt;&quot;, connectionstyle=&quot;arc3&quot;, color=&#039;orange&#039;))\nplt.annotate(s=&#039;&#039;, xytext=(6, 1.7), xy=(8, 4.0),\n             arrowprops=dict(arrowstyle=&quot;-&gt;&quot;, connectionstyle=&quot;arc3&quot;, color=&#039;orange&#039;))\n\nax1.add_patch(patches.Rectangle((8, 3.4), 4, 2, color=&#039;g&#039;))\nplt.text(10, 4.2, s=&#039;\u7ed3\u5408\u6a21\u5757&#039;, fontsize=20, color=&#039;white&#039;,\n         ha=&#039;center&#039;, fontproperties=font)\n\nplt.annotate(s=&#039;&#039;, xytext=(12, 4.2), xy=(13, 4.2),\n             arrowprops=dict(arrowstyle=&quot;-&gt;&quot;, connectionstyle=&quot;arc3&quot;, color=&#039;orange&#039;))\nax1.add_patch(patches.Rectangle((13, 3.4), 4, 2, color=&#039;purple&#039;))\nplt.text(15, 4.2, s=&#039;\u5f3a\u5b66\u4e60\u5668&#039;, fontsize=20, color=&#039;white&#039;,\n         ha=&#039;center&#039;, fontproperties=font)\n\nplt.annotate(s=&#039;&#039;, xytext=(17, 4.2), xy=(18, 4.2),\n             arrowprops=dict(arrowstyle=&quot;-&gt;&quot;, connectionstyle=&quot;arc3&quot;, color=&#039;orange&#039;))\nplt.text(19, 4, s=&#039;\u8f93\u51fa&#039;, fontsize=20, color=&#039;r&#039;,\n         ha=&#039;center&#039;, fontproperties=font)\n\nplt.xlim(0, 20)\nplt.ylim(0, 10)\nplt.show()<\/code><\/pre>\n<p><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/egonlin.com\/wp-content\/uploads\/2022\/02\/04-01-\u96c6\u6210\u5b66\u4e60\u57fa\u7840_5_0.png'><img class=\"lazyload lazyload-style-2\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  data-original=\"https:\/\/egonlin.com\/wp-content\/uploads\/2022\/02\/04-01-\u96c6\u6210\u5b66\u4e60\u57fa\u7840_5_0.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" alt=\"\" \/><\/div><\/p>\n<p>&emsp;&emsp;\u5982\u4e0a\u56fe\u6240\u793a\uff0c\u96c6\u6210\u5b66\u4e60\u53ef\u4ee5\u7406\u89e3\u6210\uff0c\u82e5\u5e72\u4e2a\u4e2a\u4f53\u5b66\u4e60\u5668\uff0c\u901a\u8fc7\u7ed3\u5408\u7b56\u7565\u6784\u9020\u4e00\u4e2a\u7ed3\u5408\u6a21\u5757\uff0c\u5f62\u6210\u4e00\u4e2a\u5f3a\u5b66\u4e60\u5668\u3002\u5176\u4e2d\u6240\u6709\u7684\u4e2a\u4f53\u5b66\u4e60\u5668\u4e2d\uff0c\u53ef\u4ee5\u662f\u76f8\u540c\u7c7b\u578b\u4e5f\u53ef\u4ee5\u662f\u4e0d\u540c\u7c7b\u578b\u7684\u4e2a\u4f53\u5b66\u4e60\u5668\u3002<\/p>\n<p>&emsp;&emsp;\u56e0\u6b64\u4e3a\u4e86\u83b7\u5f97\u5f3a\u5b66\u4e60\u5668\uff0c\u6211\u4eec\u9996\u5148\u5f97\u83b7\u5f97\u82e5\u5e72\u4e2a\u4e2a\u4f53\u5b66\u4e60\u5668\uff0c\u4e4b\u540e\u9009\u62e9\u4e00\u79cd\u8f83\u597d\u7684\u7ed3\u5408\u7b56\u7565\u3002<\/p>\n<h1>\u96c6\u6210\u5b66\u4e60\u57fa\u7840\u8be6\u89e3<\/h1>\n<h2>\u4e2a\u4f53\u5b66\u4e60\u5668<\/h2>\n<p>&emsp;&emsp;\u4e0a\u4e00\u8282\u6211\u4eec\u8bb2\u5230\uff0c\u6784\u9020\u5f3a\u5b66\u4e60\u5668\u7684\u6240\u6709\u4e2a\u4f53\u5b66\u4e60\u5668\u4e2d\uff0c\u4e2a\u4f53\u5b66\u4e60\u5668\u53ef\u4ee5\u662f\u76f8\u540c\u7c7b\u578b\u7684\u4e5f\u53ef\u4ee5\u662f\u4e0d\u540c\u7c7b\u578b\u7684\uff0c\u5bf9\u4e8e\u76f8\u540c\u7c7b\u578b\u7684\u4e2a\u4f53\u5b66\u4e60\u5668\uff0c\u8fd9\u6837\u7684\u96c6\u6210\u662f\u540c\u8d28(homogeneous)\u7684\uff0c\u4f8b\u5982\u51b3\u7b56\u6811\u96c6\u6210\u4e2d\u5168\u662f\u51b3\u7b56\u6811\uff0c\u795e\u7ecf\u7f51\u7edc\u96c6\u6210\u4e2d\u5168\u662f\u795e\u7ecf\u7f51\u7edc\uff1b\u5bf9\u4e8e\u4e0d\u540c\u7c7b\u578b\u7684\u4e2a\u4f53\u5b66\u4e60\u5668\uff0c\u8fd9\u6837\u7684\u96c6\u6210\u662f\u5f02\u8d28(heterogenous)\u7684\uff0c\u4f8b\u5982\u67d0\u4e2a\u96c6\u6210\u4e2d\u65e2\u542b\u6709\u51b3\u7b56\u6811\uff0c\u53c8\u542b\u6709\u795e\u7ecf\u7f51\u7edc\u3002<\/p>\n<p>&emsp;&emsp;\u76ee\u524d\u6700\u6d41\u884c\u7684\u662f\u540c\u8d28\u96c6\u6210\uff0c\u5728\u540c\u8d28\u96c6\u6210\u4e2d\uff0c\u4f7f\u7528\u6700\u591a\u7684\u6a21\u578b\u662fCAR$T$\u51b3\u7b56\u6811\u548c\u795e\u7ecf\u7f51\u7edc\uff0c\u5e76\u4e14\u4e2a\u4f53\u5b66\u4e60\u5668\u5728\u540c\u8d28\u96c6\u6210\u4e2d\u4e5f\u88ab\u79f0\u4e3a\u5f31\u5b66\u4e60\u5668(weak learner)\u3002\u6309\u7167\u540c\u8d28\u5f31\u5b66\u4e60\u5668\u4e4b\u95f4\u662f\u5426\u5b58\u5728\u4f9d\u8d56\u5173\u7cfb\u53ef\u4ee5\u5c06\u540c\u8d28\u96c6\u6210\u5206\u7c7b\u4e24\u7c7b\uff1a\u7b2c\u4e00\u4e2a\u662f\u5f31\u5b66\u4e60\u5668\u4e4b\u95f4\u5b58\u5728\u5f3a\u4f9d\u8d56\u5173\u7cfb\uff0c\u4e00\u7cfb\u5217\u5f31\u5b66\u4e60\u5668\u57fa\u672c\u90fd\u9700\u8981\u4e32\u884c\u751f\u6210\uff0c\u4ee3\u8868\u7b97\u6cd5\u662fBoosting\u7cfb\u5217\u7b97\u6cd5\uff1b\u7b2c\u4e8c\u4e2a\u662f\u5f31\u5b66\u4e60\u5668\u4e4b\u95f4\u6ca1\u6709\u8f83\u5f3a\u7684\u4f9d\u8d56\u5173\u7cfb\uff0c\u4e00\u7cfb\u5217\u5f31\u5b66\u4e60\u5668\u53ef\u4ee5\u5e76\u884c\u751f\u6210\uff0c\u4ee3\u8868\u7b97\u6cd5\u662fBagging\u548c\u968f\u673a\u68ee\u6797(random forest)\u7cfb\u5217\u7b97\u6cd5\u3002<\/p>\n<h2>Boosting<\/h2>\n<p>&emsp;&emsp;Boosting\u662f\u4e00\u79cd\u53ef\u5c06\u5f31\u5b66\u4e60\u5668\u63d0\u5347\u4e3a\u5f3a\u5b66\u4e60\u5668\u7684\u7b97\u6cd5\u3002\u5b83\u7684\u5de5\u4f5c\u673a\u5236\u4e3a\uff1a\u5148\u4ece\u521d\u59cb\u8bad\u7ec3\u96c6\u4e2d\u8bad\u7ec3\u51fa\u4e00\u4e2a\u5f31\u5b66\u4e60\u5668\uff0c\u518d\u6839\u636e\u5f31\u5b66\u4e60\u5668\u7684\u8868\u73b0\u5bf9\u8bad\u7ec3\u6837\u672c\u5206\u5e03\u8fdb\u884c\u8c03\u6574\uff0c\u4f7f\u5f97\u5148\u524d\u5f31\u5b66\u4e60\u5668\u8bad\u7ec3\u9519\u8bef\u7684\u6837\u672c\u6743\u91cd\u53d8\u9ad8\uff0c\u5373\u8ba9\u9519\u8bef\u6837\u672c\u5728\u4e4b\u540e\u7684\u5f31\u5b66\u4e60\u5668\u4e2d\u53d7\u5230\u66f4\u591a\u5173\u6ce8\uff0c\u7136\u540e\u57fa\u4e8e\u8c03\u6574\u540e\u7684\u6837\u672c\u5206\u5e03\u6765\u8bad\u7ec3\u4e0b\u4e00\u4e2a\u5f31\u5b66\u4e60\u5668\u3002<\/p>\n<p>&emsp;&emsp;\u4e0d\u65ad\u91cd\u590d\u4e0a\u8ff0\u8fc7\u7a0b\uff0c\u76f4\u5230\u5f31\u5b66\u4e60\u5668\u6570\u8fbe\u5230\u4e8b\u5148\u6307\u5b9a\u7684\u6570\u76ee$T$\uff0c\u6700\u7ec8\u901a\u8fc7\u96c6\u5408\u7b56\u7565\u6574\u5408\u8fd9$T$\u4e2a\u5f31\u5b66\u4e60\u5668\uff0c\u5f97\u5230\u6700\u7ec8\u7684\u5f3a\u5b66\u4e60\u5668\u3002<\/p>\n<p>&emsp;&emsp;Boosting\u7cfb\u5217\u7b97\u6cd5\u4e2d\u6700\u8457\u540d\u7684\u7b97\u6cd5\u6709AdaBoost\u7b97\u6cd5\u548c\u63d0\u5347\u6811(boosting tree)\u7cfb\u5217\u7b97\u6cd5\uff0c\u63d0\u5347\u6811\u7cfb\u5217\u7b97\u6cd5\u4e2d\u5e94\u7528\u6700\u5e7f\u6cdb\u7684\u662f\u68af\u5ea6\u63d0\u5347\u6811(gradient boosting tree)\u3002<\/p>\n<p>&emsp;&emsp;Boosting\u7531\u4e8e\u6bcf\u4e00\u4e2a\u5f31\u5b66\u4e60\u5668\u90fd\u57fa\u4e8e\u4e0a\u4e00\u4e2a\u5f31\u5b66\u4e60\u5668\uff0c\u56e0\u6b64\u5b83\u7684\u504f\u5dee\u8f83\u5c0f\uff0c\u5373\u6a21\u578b\u62df\u5408\u80fd\u529b\u8f83\u5f3a\uff0c\u4f46\u662f\u6a21\u578b\u6cdb\u5316\u80fd\u529b\u4f1a\u7a0d\u5dee\uff0c\u5373\u65b9\u5dee\u504f\u5927\uff0c\u800cBoosgting\u5219\u662f\u9700\u8981\u9009\u62e9\u4e00\u4e2a\u80fd\u51cf\u5c0f\u65b9\u5dee\u7684\u5b66\u4e60\u5668\uff0c\u4e00\u822c\u9009\u62e9\u8f83\u7b80\u5355\u6a21\u578b\uff0c\u5982\u9009\u62e9\u6df1\u5ea6\u5f88\u6d45\u7684\u51b3\u7b56\u6811\u3002<\/p>\n<h2>Bagging<\/h2>\n<p>&emsp;&emsp;Boosting\u7684\u5f31\u5b66\u4e60\u5668\u4e4b\u95f4\u662f\u6709\u4f9d\u8d56\u5173\u7cfb\u7684\uff0c\u800cBagging\u7684\u5f31\u5b66\u4e60\u5668\u4e4b\u95f4\u662f\u6ca1\u6709\u4f9d\u8d56\u5173\u7cfb\u7684\uff0c\u56e0\u6b64\u5b83\u7684\u5f31\u5b66\u4e60\u5668\u662f\u5e76\u884c\u751f\u6210\u3002<\/p>\n<p>&emsp;&emsp;Bagging\u7684\u5f31\u5b66\u4e60\u5668\u7684\u8bad\u7ec3\u96c6\u662f\u901a\u8fc7\u968f\u673a\u91c7\u6837\u5f97\u5230\u7684\u3002\u901a\u8fc7$T$\u6b21\u7684\u968f\u673a\u91c7\u6837\uff0c\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u81ea\u4e3b\u91c7\u6837\u6cd5(bootstrap sampling)\u5f97\u5230$T$\u4e2a\u91c7\u6837\u96c6\uff0c\u7136\u540e\u5bf9\u4e8e\u8fd9$T$\u4e2a\u91c7\u6837\u96c6\u72ec\u7acb\u7684\u8bad\u7ec3\u51fa$T$\u4e2a\u5f31\u5b66\u4e60\u5668\uff0c\u4e4b\u540e\u6211\u4eec\u901a\u8fc7\u67d0\u79cd\u7ed3\u5408\u7b56\u7565\u5c06\u8fd9$T$\u4e2a\u5f31\u5b66\u4e60\u5668\u6784\u9020\u6210\u4e00\u4e2a\u5f3a\u5b66\u4e60\u5668\u3002<\/p>\n<p>&emsp;&emsp;Bagging\u7cfb\u5217\u7b97\u6cd5\u4e2d\u6700\u8457\u540d\u7684\u7b97\u6cd5\u6709\u968f\u673a\u68ee\u6797\uff0c\u4f46\u662f\u968f\u673a\u68ee\u6797\u53ef\u4ee5\u8bf4\u662f\u4e00\u4e2a\u8fdb\u9636\u7248\u7684Bagging\u7b97\u6cd5\uff0c\u867d\u7136\u968f\u673a\u68ee\u6797\u7684\u5f31\u5b66\u4e60\u5668\u90fd\u662f\u51b3\u7b56\u6811\uff0c\u4f46\u662f\u968f\u673a\u68ee\u6797\u5728Baggin\u7684\u6837\u672c\u968f\u673a\u91c7\u6837\u7684\u57fa\u7840\u4e0a\uff0c\u53c8\u8fdb\u884c\u4e86\u7279\u5f81\u7684\u968f\u673a\u9009\u62e9\u3002<\/p>\n<p>&emsp;&emsp;Bagging\u7531\u4e8e\u901a\u8fc7\u968f\u673a\u91c7\u6837\u83b7\u5f97\u6570\u636e\uff0c\u56e0\u6b64\u5b83\u7684\u65b9\u5dee\u8f83\u5c0f\uff0c\u5373\u6a21\u578b\u6cdb\u5316\u80fd\u529b\u8f83\u5f3a\uff0c\u4f46\u662f\u6a21\u578b\u62df\u5408\u80fd\u529b\u8f83\u5f31\uff0c\u5373\u504f\u5dee\u504f\u5927\uff0c\u800cBagging\u5219\u662f\u9700\u8981\u9009\u62e9\u4e00\u4e2a\u80fd\u51cf\u5c0f\u504f\u5dee\u7684\u5b66\u4e60\u5668\uff0c\u4e00\u822c\u9009\u62e9\u8f83\u590d\u6742\u6a21\u578b\uff0c\u5982\u9009\u62e9\u6df1\u5ea6\u5f88\u6df1\u7684\u51b3\u7b56\u6811\u6216\u4e0d\u526a\u679d\u7684\u51b3\u7b56\u6811\u3002<\/p>\n<h3>\u81ea\u52a9\u91c7\u6837\u6cd5<\/h3>\n<p>&emsp;&emsp;\u7ed9\u5b9a\u5305\u542b$m$\u4e2a\u6837\u672c\u7684\u6570\u636e\u96c6\uff0c\u6211\u4eec\u5148\u968f\u673a\u53d6\u51fa\u4e00\u4e2a\u6837\u672c\u653e\u5165\u91c7\u6837\u96c6\u4e2d\uff0c\u518d\u628a\u8be5\u6837\u672c\u653e\u56de\u521d\u59cb\u6570\u636e\u96c6\uff0c\u4f7f\u5f97\u4e0b\u6b21\u91c7\u6837\u65f6\u8be5\u6837\u672c\u4ecd\u6709\u53ef\u80fd\u88ab\u9009\u4e2d\uff0c\u8fd9\u6837\u7ecf\u8fc7$m$\u6b21\u968f\u673a\u91c7\u6837\u64cd\u4f5c\uff0c\u6211\u4eec\u80fd\u5f97\u5230\u5305\u542b$m$\u4e2a\u6837\u672c\u7684\u91c7\u6837\u96c6\u3002<\/p>\n<h2>\u7ed3\u5408\u7b56\u7565<\/h2>\n<p>&emsp;&emsp;\u6784\u9020\u5f3a\u5b66\u4e60\u5668\u9664\u4e86\u9700\u8981\u4f7f\u7528\u82e5\u5e72\u4e2a\u5f31\u5b66\u4e60\u5668\u4e4b\u5916\uff0c\u8fd8\u9700\u8981\u9009\u62e9\u67d0\u79cd\u7ed3\u5408\u7b56\u7565\uff0c\u63a5\u4e0b\u6765\u6211\u4eec\u5c06\u8bb2\u5e73\u5747\u6cd5\u3001\u6295\u7968\u6cd5\u548c\u5b66\u4e60\u6cd5\u4e09\u79cd\u7ed3\u5408\u7b56\u7565\u3002<\/p>\n<p>&emsp;&emsp;\u5047\u8bbe\u96c6\u6210\u5305\u542b$T$\u4e2a\u5f31\u5b66\u4e60\u5668${h_1,h_2,\\cdots,h_T}$\uff0c\u5176\u4e2d$h_i$\u5728\u5b9e\u4f8b$X$\u4e0a\u7684\u8f93\u51fa\u4e3a$h_i(X)$\u3002<\/p>\n<h3>\u5e73\u5747\u6cd5<\/h3>\n<p>&emsp;&emsp;\u5e73\u5747\u6cd5\u4e00\u822c\u7528\u4e8e\u89e3\u51b3\u6570\u503c\u7c7b\u7684\u56de\u5f52\u95ee\u9898\uff0c\u5373\u5bf9$T$\u4e2a\u5f31\u5b66\u4e60\u5668\u7684\u8f93\u51fa\u6c42\u5e73\u5747\u503c\u4f5c\u4e3a\u6700\u7ec8\u7684\u8f93\u51fa\u3002<\/p>\n<ol>\n<li>\u7b80\u5355\u5e73\u5747\u6cd5(simple averaging)<br \/>\n$$<br \/>\nH(X) = {\\frac{1}{T}}\\sum_{i=1}^T h_i(X)<br \/>\n$$<\/li>\n<li>\u52a0\u6743\u5e73\u5747\u6cd5(weighted averaging)<br \/>\n$$<br \/>\nH(X) = \\sum_{i=1}^T w_i h_i(X)<br \/>\n$$<br \/>\n\u5176\u4e2d$w_i$\u662f\u5f31\u5b66\u4e60\u5668$h_i$\u7684\u6743\u91cd\uff0c\u901a\u5e38\u6709$w<em>i\\geq0,\\sum<\/em>{i=1}^Tw_i=1$<\/li>\n<\/ol>\n<h3>\u6295\u7968\u6cd5<\/h3>\n<p>&emsp;&emsp;\u6295\u7968\u6cd5\u4e00\u822c\u7528\u4e8e\u89e3\u51b3\u5206\u7c7b\u95ee\u9898\uff0c\u5047\u8bbe\u6211\u4eec\u9700\u8981\u9884\u6d4b\u7684\u7c7b\u522b\u4e3a${c_1,c_2,\\cdots,c_K}$\uff0c\u5bf9\u4e8e\u6837\u672c$X$\u4e0a\u7684\u8f93\u51fa\u8868\u793a\u4e3a\u4e00\u4e2a$K$\u7ef4\u5411\u91cf$(h_i^1(X);h_i^2(X);\\cdots;h_i^K(X))$\uff0c\u5176\u4e2d$h_i^j(X)$\u662f$h_i$\u5728\u7c7b\u522b\u6807\u8bb0$c_j$\u4e0a\u7684\u8f93\u51fa\u3002<\/p>\n<ol>\n<li>\u7edd\u5bf9\u591a\u6570\u6295\u7968\u6cd5(majority voting)<br \/>\n$$<br \/>\nH(X) =<br \/>\n\\begin{cases}<br \/>\nc<em>j, \\quad if\\,\\sum<\/em>{i=1}^Th<em>i^j(X)&gt;{\\frac{1}{2}}\\sum<\/em>{k=1}^K\\sum_{i=1}^Th_i^k(X) \\<br \/>\n\u4e0d\u9884\u6d4b, \\quad\\text{\u5176\u4ed6\u60c5\u51b5}<br \/>\n\\end{cases}<br \/>\n$$<br \/>\n\u7edd\u5bf9\u591a\u6570\u6295\u7968\u6cd5\u5373\u8868\u793a\u4e3a\uff1a\u5982\u679c\u67d0\u6807\u8bb0\u5f97\u7968\u6570\u8d85\u8fc7\u603b\u7968\u6570\u4e00\u534a\u7684\u6570\u91cf\uff0c\u5219\u9884\u6d4b\u4e3a\u8be5\u6807\u8bb0\uff1b\u5426\u5219\u4e0d\u8fdb\u884c\u9884\u6d4b\u3002<\/li>\n<li>\u76f8\u5bf9\u591a\u6570\u6295\u7968\u6cd5(plurality voting)<br \/>\n$$<br \/>\nH(X) = c_{\\underbrace{arg\\,max}<em>j\\sum<\/em>{i=1}^Th_i^j(X)}<br \/>\n$$<br \/>\n\u76f8\u5bf9\u591a\u6570\u6295\u7968\u6cd5\u5373\u8868\u793a\u4e3a\uff1a\u9884\u6d4b\u4e3a\u5f97\u7968\u6570\u6700\u591a\u7684\u6807\u8bb0\uff0c\u5982\u679c\u540c\u65f6\u6709\u591a\u4e2a\u6807\u8bb0\u83b7\u5f97\u6700\u9ad8\u7968\uff0c\u5219\u968f\u673a\u9009\u62e9\u4e00\u4e2a\u6807\u8bb0\u3002<\/li>\n<li>\u52a0\u6743\u6295\u7968\u6cd5(weighted voting)<br \/>\n$$<br \/>\nH(X) = c_{\\underbrace{arg\\,max}<em>j\\sum<\/em>{i=1}^Tw_ih_i^j(X)}<br \/>\n$$<br \/>\n\u52a0\u6743\u6295\u7968\u6cd5\u548c\u52a0\u6743\u5e73\u5747\u6cd5\u7c7b\u4f3c\uff0c$w_i$\u662f$h_i$\u7684\u6743\u91cd\uff0c\u901a\u5e38\u6709$w<em>i\\geq0,\\sum<\/em>{i=1}^Tw_i=1$<\/li>\n<\/ol>\n<h3>\u5b66\u4e60\u6cd5<\/h3>\n<p>&emsp;&emsp;\u5e73\u5747\u6cd5\u548c\u6295\u7968\u6cd5\u76f8\u6bd4\u8f83\u5b66\u4e60\u6cd5\u90fd\u5f88\u7b80\u5355\uff0c\u5e76\u4e14\u4ed6\u4eec\u7684\u8bef\u5dee\u8f83\u5927\uff0c\u800c\u5b66\u4e60\u6cd5\u76f8\u6bd4\u8f83\u5219\u8bef\u5dee\u8f83\u5c0f\u3002<\/p>\n<p>&emsp;&emsp;\u5b66\u4e60\u6cd5\u4e2d\u7684\u4ee3\u8868\u65b9\u6cd5\u662fStacking\uff0c\u5f53\u4f7f\u7528Stacking\u7684\u7ed3\u5408\u7b56\u7565\u65f6\uff0c\u6211\u4eec\u4e0d\u518d\u662f\u5bf9\u5f31\u5b66\u4e60\u5668\u7684\u7ed3\u679c\u505a\u7b80\u5355\u7684\u5904\u7406\uff0c\u800c\u662f\u518d\u52a0\u4e0a\u4e00\u5c42\u5b66\u4e60\u5668\uff0c\u4e0e\u6b64\u540c\u65f6\uff0c\u6211\u4eec\u628a\u4e2a\u4f53\u5b66\u4e60\u5668\u79f0\u4e3a\u521d\u7ea7\u5b66\u4e60\u5668\uff0c\u989d\u5916\u52a0\u4e0a\u7684\u5b66\u4e60\u5668\u79f0\u4e3a\u6b21\u7ea7\u5b66\u4e60\u5668\u6216\u5143\u5b66\u4e60\u5668(meta-learner)\u3002<\/p>\n<p>&emsp;&emsp;Stacking\u7ed3\u5408\u7b56\u7565\u53ef\u4ee5\u8fd9\u6837\u7406\u89e3\uff1a\u5bf9\u4e8e\u8bad\u7ec3\u96c6\uff0c\u6211\u4eec\u5c06\u521d\u7ea7\u5b66\u4e60\u5668\u5bf9\u8bad\u7ec3\u96c6\u7684\u5b66\u4e60\u7ed3\u679c\u4f5c\u4e3a\u6b21\u7ea7\u5b66\u4e60\u5668\u7684\u8f93\u5165\uff0c\u5c06\u8bad\u7ec3\u96c6\u7684\u6807\u8bb0\u4ecd\u5f53\u505a\u6837\u4f8b\u6807\u8bb0\uff0c\u91cd\u65b0\u8bad\u7ec3\u4e00\u4e2a\u6b21\u7ea7\u5b66\u4e60\u5668\u5f97\u5230\u6700\u7ec8\u7ed3\u679c\uff1b\u5bf9\u4e8e\u6d4b\u8bd5\u96c6\uff0c\u6211\u4eec\u9996\u5148\u7528\u521d\u7ea7\u5b66\u4e60\u5668\u9884\u6d4b\u4e00\u6b21\uff0c\u5f97\u5230\u6b21\u7ea7\u5b66\u4e60\u5668\u7684\u8f93\u5165\u6837\u672c\uff0c\u518d\u7528\u6b21\u7ea7\u5b66\u4e60\u5668\u9884\u6d4b\u4e00\u6b21\uff0c\u5f97\u5230\u6700\u7ec8\u7684\u9884\u6d4b\u7ed3\u679c\u3002<\/p>\n<h1>\u5c0f\u7ed3<\/h1>\n<p>&emsp;&emsp;\u96c6\u6210\u5b66\u4e60\u53ef\u4ee5\u7b80\u5355\u7684\u8ba4\u4e3a\u901a\u8fc7\u67d0\u79cd\u7ed3\u5408\u7b56\u7565\u5c06\u591a\u4e2a\u5f31\u5b66\u4e60\u5668\u6784\u9020\u6210\u4e00\u4e2a\u5f3a\u5b66\u4e60\u5668\uff0c\u5965\u5361\u59c6\u5243\u5200\u539f\u5219\u2014\u2014\u7b80\u5355\u5176\u5b9e\u5c31\u662f\u6700\u597d\u7684\u3002\u90a3\u4e3a\u4ec0\u4e48\u8981\u82b1\u8fd9\u4e48\u5927\u7684\u529f\u592b\u628a\u5f31\u5b66\u4e60\u5668\u7ed3\u5408\u6210\u5f3a\u5b66\u4e60\u5668\u5462\uff1f\u81f3\u4e8e\u6784\u9020\u7684\u5f3a\u5b66\u4e60\u5668\u80fd\u6709\u4ec0\u4e48\u4f18\u70b9\uff0c\u63a5\u4e0b\u6765\u5c06\u4f1a\u9010\u4e00\u4ecb\u7ecd\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u96c6\u6210\u5b66\u4e60\u57fa\u7840 &emsp;&emsp;\u96c6\u6210\u5b66\u4e60(ensemnle learning)\u901a\u8fc7\u6784\u5efa\u5e76\u7ed3\u5408\u591a\u4e2a\u5b66\u4e60\u5668\u6765 [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":3136,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[276,408,293],"tags":[],"_links":{"self":[{"href":"https:\/\/egonlin.com\/index.php?rest_route=\/wp\/v2\/posts\/3135"}],"collection":[{"href":"https:\/\/egonlin.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/egonlin.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/egonlin.com\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/egonlin.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3135"}],"version-history":[{"count":0,"href":"https:\/\/egonlin.com\/index.php?rest_route=\/wp\/v2\/posts\/3135\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/egonlin.com\/index.php?rest_route=\/wp\/v2\/media\/3136"}],"wp:attachment":[{"href":"https:\/\/egonlin.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3135"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/egonlin.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3135"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/egonlin.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3135"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}