{"id":202,"date":"2016-09-30T12:51:35","date_gmt":"2016-09-30T04:51:35","guid":{"rendered":"http:\/\/ayonel.me\/?p=202"},"modified":"2016-09-30T12:53:50","modified_gmt":"2016-09-30T04:53:50","slug":"meka_multilabel_classifier","status":"publish","type":"post","link":"https:\/\/ayonel.malash.net\/index.php\/2016\/09\/30\/meka_multilabel_classifier\/","title":{"rendered":"\u4f7f\u7528meka\u5b9e\u73b0multilabel classifier"},"content":{"rendered":"<p>\u4e4d\u4e00\u770b\u9898\u76ee\uff0c\u4f7f\u7528&#8221;<strong>meka<\/strong>&#8220;\u5b9e\u73b0\u5206\u7c7b\u5668\uff0c\u662f\u4e0d\u662f\u7b14\u8005\u6253\u9519\u4e86\u554a\uff0c\u5e94\u8be5\u662fweka\u554a\u3002\u5176\u5b9e\u4e0d\u7136\uff0c\u8fd9\u4e16\u4e0a\u8fd8\u771f\u6709\u4e00\u4e2a\u53ebmeka\u7684\u5305\uff0c\u5e76\u4e14\u4ed6\u8fd8\u8ddfweka\u7b97\u662f\u4eb2\u621a\u5173\u7cfb\u3002\u53ea\u4e0d\u8fc7\uff0c\u8fd9\u4e2ameka\u662f\u4e00\u4e2a\u4e13\u95e8\u7528\u6765\u89e3\u51b3\u591a\u6807\u7b7e\u5206\u7c7b\u95ee\u9898\u7684\u5305\uff0c\u5e76\u4e14\u662f\u57fa\u4e8eweka\u7684\uff0c\u53ef\u4ee5\u7b97\u4f5c\u662fweka\u7684\u4e00\u4e2a\u6269\u5c55\u3002<\/p>\n<p>\u90a3\u597d\uff0c\u4ec0\u4e48\u662f\u591a\u6807\u7b7e\u5206\u7c7b\u5462\uff1f\u6211\u4eec\u5148\u6765\u770b\u4e00\u4e2a\u793a\u4f8b\uff1a\u5982\u679c\u6211\u6709\u4e00\u7bc7\u6587\u7ae0\uff0c\u6211\u8981\u63a8\u65ad\u5b83\u662f\u4e0d\u662f\u201c\u4f53\u80b2\u201d\u7c7b\u65b0\u95fb\uff0c\u90a3\u4e48\u5206\u7c7b\u6807\u7b7e\u5c31\u53ea\u6709<strong>\u201c\u662f\u201d<\/strong>\u6216\u8005<strong>\u201c\u4e0d\u662f\u201d<\/strong>\uff0c\u8fd9\u79cd\u95ee\u9898\u5c31\u662f\u7ecf\u5178\u7684\u4e8c\u5206\u7c7b<strong>(binary classifier)<\/strong>\u95ee\u9898\u3002\u597d\uff0c\u518d\u590d\u6742\u4e00\u70b9\uff0c\u5982\u679c\u6211\u4eec\u8981\u5224\u65ad\u8fd9\u7bc7\u6587\u7ae0\u662f\u5c5e\u4e8e\u201c\u4f53\u80b2\u201d\u3001\u201c\u8d22\u7ecf\u201d\u3001\u201c\u793e\u4f1a\u201d\u4e2d\u7684\u54ea\u4e00\u7c7b\uff1f\u90a3\u4e48\u8fd9\u4e2a\u95ee\u9898\u5c31\u53d8\u6210\u4e86\u4e00\u4e2a\u591a\u7c7b\u5206\u7c7b\u95ee\u9898<strong>(multiclass classifier)<\/strong>\uff0c\u6ce8\u610f\uff0c\u5bf9\u4e8e\u6bcf\u7bc7\u6587\u7ae0\u5b83\u53ea\u80fd\u5c5e\u4e8e\u201c\u4f53\u80b2\u201d\u3001\u201c\u8d22\u7ecf\u201d\u3001\u201c\u793e\u4f1a\u201d\u4e2d\u7684<strong>\u67d0\u4e00\u7c7b<\/strong>\uff0c\u4e0d\u80fd\u5c5e\u4e8e\u591a\u4e2a\u7c7b\u3002\u4e5f\u5c31\u662f\u6211\u4eec\u7684\u6837\u672c\u7684\u6807\u7b7e\u53ef\u4ee5\u662f[0,0,1]\u6216\u8005[0,1,0]\u6216\u8005[1,0,0]\uff0c\u4f46\u7edd\u4e0d\u53ef\u80fd\u662f[1,1,0]\u6216\u8005[1,0,1]\u7b49\u3002\u597d\u4e86\uff0c\u4e0e\u591a\u5206\u7c7b\u5bf9\u5e94\u7684\u5c31\u662f\u591a\u6807\u7b7e\u5206\u7c7b<strong>(multilabel classifier)<\/strong>\uff0c\u5b83\u662f\u89e3\u51b3\u4ec0\u4e48\u95ee\u9898\u7684\u5462\uff1f\u5982\u679c\u4e00\u7bc7\u6587\u7ae0\uff0c\u5b83\u65e2\u80fd\u5c5e\u4e8e\u201c\u4f53\u80b2\u201d\u7c7b\uff0c\u53c8\u80fd\u5c5e\u4e8e\u201c\u8d22\u7ecf\u7c7b\u201d\uff0c\u751a\u81f3\u8fd8\u80fd\u5c5e\u4e8e\u201c\u793e\u4f1a\u201d\u7c7b\uff0c\u4e5f\u5c31\u662f\u6211\u4eec\u5f85\u5206\u7c7b\u7684\u6587\u7ae0\u6709\u53ef\u80fd\u540c\u65f6\u5206\u5230\u591a\u4e2a\u7c7b\u4e2d\u53bb\uff0c\u5bf9\u4e8e\u8fd9\u6837\u7684\u5206\u7c7b\u6211\u4eec\u5c31\u53eb\u591a\u6807\u7b7e\u5206\u7c7b\u3002<\/p>\n<p>\u660e\u767d\u4e86\u591a\u6807\u7b7e\u5206\u7c7b\u7684\u6982\u5ff5\uff0c\u6211\u4eec\u600e\u4e48\u5b9e\u73b0\u5462\uff1f\u5176\u5b9e\u8bf4\u5230\u5e95\uff0c\u591a\u7c7b\u5206\u7c7b\uff0c\u591a\u6807\u7b7e\u5206\u7c7b\uff0c\u5176\u5b9e\u5e95\u5c42\u90fd\u662f\u4e8c\u5206\u7c7b\u7ec4\u5408\u3002\u6211\u4eec\u5f53\u7136\u53ef\u4ee5\u81ea\u5df1\u624b\u52a8\u5b9e\u73b0\u3002\u4f46\u6709\u6ca1\u6709\u5df2\u6709\u7684\u5e93\u6765\u5e2e\u52a9\u6211\u4eec\u5b9e\u73b0\u5462\uff1f\u5f53\u7136\u6709\uff01\uff01\uff01<a href=\"http:\/\/scikit-learn.org\/stable\/modules\/multiclass.html\" target=\"_blank\">sklearn<\/a>\u4e2d\u5df2\u7ecf\u6709\u5b9e\u73b0\u591a\u6807\u7b7e\u5206\u7c7b\u7684\u65b9\u6cd5\u4e86\uff0c\u5b83\u7684\u5e95\u5c42\u652f\u6301\u53ef\u4ee5\u662fDecision Trees, Random Forests\u4ee5\u53caNearest Neighbors. \u4e0d\u8fc7\u6211\u4eec\u8fd9\u6b21\u4e0d\u4f7f\u7528\u6211\u4eec\u4f18\u96c5\u7684sklearn\uff0c\u8981\u8df3\u5230JAVA\u7684\u5751\u53bb\uff08\u597d\u6851\u5fc3\uff09\u3002JAVA\u4e2d\u6bd4\u8f83\u6709\u540d\u7684\u591a\u6807\u7b7e\u5206\u7c7b\u5305\u662f<a href=\"http:\/\/mulan.sourceforge.net\/\" target=\"_blank\">mulan<\/a>\u4ee5\u53cameka,\u6211\u4eec\u4eca\u5929\u53ea\u8bb2meka\uff0c\u81f3\u4e8emulan\u7684\u5b9e\u73b0\u65b9\u6cd5\u5176\u5b9e\u4e5f\u8ddfmeka\u5f88\u50cf\uff0c\u751a\u81f3\u5728meka\u4e2d\u90fd\u5df2\u7ecf\u96c6\u6210\u4e86mulan\u7684jar\u5305\u3002<\/p>\n<p><a href=\"http:\/\/meka.sourceforge.net\/\" target=\"_blank\">meka<\/a>\u662f\u7531\u4e09\u4e2a\u5927\u725bJesse Read\u3001Peter Reutemann\u3001Joerg Wicker\u5b9e\u73b0\uff0c\u5e76\u4e14\u73b0\u5728\u5df2\u7ecf\u5f00\u6e90\u5230<a href=\"https:\/\/github.com\/Waikato\/meka\" target=\"_blank\">github<\/a>\u4e86\uff0c\u4e0eweka\u5176\u5b9e\u662f\u5e08\u51fa\u540c\u95e8\u3002meka\u7684\u4f7f\u7528\u57fa\u672c\u4e0eweka\u4e00\u81f4\uff0c\u5b83\u751a\u81f3\u5230\u5305\u542b\u4e00\u4e2a\u5ba2\u6237\u7aef\uff0c\u957f\u76f8\u4e5f\u8ddfweka\u5f88\u50cf\u3002<br \/>\n<img loading=\"lazy\" decoding=\"async\" width=\"300\" height=\"225\" src=\"https:\/\/ayonel.malash.net\/wp-content\/uploads\/2016\/09\/meka-300x225.jpg\" alt=\"meka\"  class=\"alignnone size-big wp-image-203\" srcset=\"https:\/\/ayonel.malash.net\/wp-content\/uploads\/2016\/09\/meka-300x225.jpg 300w, https:\/\/ayonel.malash.net\/wp-content\/uploads\/2016\/09\/meka-768x576.jpg 768w, https:\/\/ayonel.malash.net\/wp-content\/uploads\/2016\/09\/meka-1024x768.jpg 1024w, https:\/\/ayonel.malash.net\/wp-content\/uploads\/2016\/09\/meka.jpg 1600w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><br \/>\n\u5bf9\u4e8e\u56fe\u5f62\u754c\u9762\u7684\u4f7f\u7528\uff0c\u53ef\u4ee5\u53bb\u770b\u770b\u5b83\u4eec\u7684<a href=\"https:\/\/sourceforge.net\/projects\/meka\/files\/meka-1.9.0\/Tutorial.pdf\" target=\"_blank\">\u5b98\u65b9\u6559\u7a0b<\/a>\uff0c\u5f88\u8be6\u7ec6\u3002\u6211\u4eec\u4eca\u5929\u6765\u8bf4\u4e00\u8bf4\u5982\u4f55\u4f7f\u7528\u96c6\u6210meka-1.9.0.jar\u6765\u8fdb\u884c\u7f16\u7a0b\u5b9e\u73b0\u3002\u8fd9\u4e2ajar\u5305\u5b58\u5728\u4e8elib\u6587\u4ef6\u5939\u4e0b\u3002<\/p>\n<p>meka\u4e5f\u662f\u7528arff\u6587\u4ef6\u4f5c\u4e3a\u8f93\u5165\u3002\u5b98\u65b9\u6587\u6863\u4e2d\u6709\u8fd9\u4e48\u4e00\u53e5\u8bdd\uff1a&#8221;A suitable dataset is the only requirement to begin running experiments with Meka.&#8221;,\u8db3\u89c1meka\u4f7f\u7528\u4e4b\u65b9\u4fbf~~<br \/>\nmeka\u4e2d\u5df2\u7ecf\u81ea\u5e26\u4e86\u51e0\u4e2a\u7528\u4e8e\u5b9e\u73b0\u591a\u6807\u7b7e\u5206\u7c7b\u7684\u6570\u636e\u96c6\u5728data\u76ee\u5f55\u4e0b\uff0c\u8fd9\u4e2a\u6570\u636e\u96c6\u662f\u63cf\u8ff0\u67d0\u6bb5\u97f3\u9891\u7684\u7279\u5f81\uff0c\u4ee5\u53ca\u5b83\u4eec\u5c5e\u4e8e\u54ea\u4e9b\u5206\u7c7b\uff08\u662f\u60b2\u4f24\u7c7b\u7684\u8fd8\u662f\u5b89\u9759\u7c7b\u7684\u4ea6\u6216\u662f\u75af\u72c2\u6447\u6eda\u7684&#8230;\uff09\u6211\u4eec\u6765\u770b\u770b\u5927\u6982\u770b\u770b\uff0c\u6bcf\u884c%\u540e\u9762\u662f\u6211\u81ea\u5df1\u52a0\u7684\u6ce8\u91ca\uff1a<\/p>\n<div class=\"codecolorer-container text railscasts\" style=\"overflow:auto;white-space:nowrap;width:100%;height:100%;\"><div class=\"text codecolorer\">% 'Music' dataset; normalised version.<br \/>\n@relation 'Music: -C 6' &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; %\u4ee3\u8868\u6807\u7b7e\u4e00\u5171\u67096\u7c7b<br \/>\n<br \/>\n@attribute amazed-suprised {0,1} &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;%\u7b2c\u4e00\u4e2a\u5206\u7c7b\u6807\u7b7e\uff0c\u53d6\u503c\u662f0\u6216\u80051\uff0c\u4ee3\u8868\u662f\u6216\u8005\u4e0d\u662f<br \/>\n@attribute happy-pleased {0,1} &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;%\u7b2c\u4e8c\u4e2a\u5206\u7c7b\u6807\u7b7e<br \/>\n@attribute relaxing-clam {0,1} &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;%\u7b2c\u4e09\u4e2a\u5206\u7c7b\u6807\u7b7e<br \/>\n@attribute quiet-still {0,1} &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;%\u7b2c\u56db\u4e2a\u5206\u7c7b\u6807\u7b7e<br \/>\n@attribute sad-lonely {0,1} &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; %\u7b2c\u4e94\u4e2a\u5206\u7c7b\u6807\u7b7e<br \/>\n@attribute angry-aggresive {0,1} &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;%\u7b2c\u516d\u4e2a\u5206\u7c7b\u6807\u7b7e<br \/>\n@attribute Mean_Acc1298_Mean_Mem40_Centroid numeric &nbsp;%\u7b2c\u4e00\u4e2a\u7279\u5f81\uff0cnumeric\u7c7b\u578b<br \/>\n@attribute Mean_Acc1298_Mean_Mem40_Rolloff numeric &nbsp; %\u7b2c\u4e8c\u4e2a\u7279\u5f81\uff0cnumeric\u7c7b\u578b<br \/>\n@attribute Mean_Acc1298_Mean_Mem40_Flux numeric &nbsp; &nbsp; &nbsp;%\u7b2c\u4e09\u4e2a\u7279\u5f81\uff0cnumeric\u7c7b\u578b<br \/>\n@attribute Mean_Acc1298_Mean_Mem40_MFCC_0 numeric &nbsp; &nbsp;%\u7b2c\u56db\u4e2a\u7279\u5f81\uff0cnumeric\u7c7b\u578b<br \/>\n@attribute Mean_Acc1298_Mean_Mem40_MFCC_1 numeric &nbsp; &nbsp;%\u7b2c\u4e94\u4e2a\u7279\u5f81\uff0cnumeric\u7c7b\u578b<br \/>\n@attribute Mean_Acc1298_Mean_Mem40_MFCC_2 numeric &nbsp; &nbsp;%\u7b2c\u516d\u4e2a\u7279\u5f81\uff0cnumeric\u7c7b\u578b<br \/>\n@attribute Mean_Acc1298_Mean_Mem40_MFCC_3 numeric &nbsp; &nbsp;%\u7b2c\u4e03\u4e2a\u7279\u5f81\uff0cnumeric\u7c7b\u578b<br \/>\n@attribute Mean_Acc1298_Mean_Mem40_MFCC_4 numeric &nbsp; &nbsp;%\u7b2c\u516b\u4e2a\u7279\u5f81\uff0cnumeric\u7c7b\u578b<br \/>\n@attribute Mean_Acc1298_Mean_Mem40_MFCC_5 numeric &nbsp; &nbsp;%\u7b2c\u4e5d\u4e2a\u7279\u5f81\uff0cnumeric\u7c7b\u578b<br \/>\n....<br \/>\n@data<br \/>\n<br \/>\n0,1,1,0,0,0,0.132498,0.077848,0.229227,0.602629,0.512861,0.467404,0.529733,0.573498,0.592831,0.520031,0.598853,0.537699,0.780658,0.462982,0.407108,0.684364,0.135824,0.245631,0.157515,0.301285,0.350107,0.459476,0.583274,0.430053,0.416198,0.581916,0.342758,0.309345,0.388929,0.323521,0.455207,0.26139,0.027559,0.149077,0.195433,0.571354,0.326404,0.246745,0.524645,0.354798,0.240244,0.239788,0.128689,0.173252,0.204863,0.131632,0.245653,0.144607,0.258203,0.470051,0.259909,0.61364,0.458314,0.434716,0.448941,0.370609,0.285647,0.663082,0.29708,0.273671,0.286411,0.197026,0.196244,0.164323,0.030017,0.253968,0.008473,0.240602,0.136735,0.058442,0.107594 &nbsp;%\u7b2c\u4e00\u6761\u6570\u636e<br \/>\n1,0,0,0,0,1,0.384281,0.355249,0.16719,0.853089,0.260577,0.332757,0.15393,0.519381,0.268043,0.251955,0.459922,0.430814,0.654323,0.641021,0.356511,0.647367,0.367659,0.539078,0.100569,0.133502,0.337194,0.319752,0.349012,0.171182,0.191357,0.390569,0.289253,0.208641,0.341328,0.265669,0.273736,0.181791,0.028513,0.252827,0.25819,0.011351,0.236247,0.069285,0.192754,0.154258,0.128671,0.116726,0.059704,0.073697,0.080341,0.062701,0.075672,0.041256,0.207782,0.300735,0.888274,0.444,0.294673,0.210429,0.132036,0.167474,0.205996,0.155514,0.086631,0.071462,0.067492,0.093526,0.085649,0.025101,0.182955,0.285714,0.156764,0.270677,0.191377,0.153728,0.197951 &nbsp;%\u7b2c\u4e8c\u6761\u6570\u636e<\/div><\/div>\n<p>\u4e0eweka\u6709\u70b9\u533a\u522b\u7684\u662f\uff0c\u5bf9\u4e8e\u6807\u7b7e\u5728\u6bcf\u4e2a\u6837\u672c\u96c6\u4e2d\u7684\u4f4d\u7f6e\uff0cweka\u4e00\u822c\u662f\u653e\u5728\u6bcf\u884c\u672b\u5c3e\uff0c\u867d\u7136\u53ef\u4ee5\u653e\u5728\u6bcf\u884c\u7684\u4efb\u610f\u4f4d\u7f6e\uff0c\u53ef\u4ee5\u901a\u8fc7Instances.setClassIndex(n)\u65b9\u6cd5\uff0c\u6765\u6307\u5b9a\u6bcf\u884c\u7684\u7b2cn\u4f4d\u662f\u5c5e\u4e8e\u5206\u7c7b\u6807\u7b7e\u3002<br \/>\n\u5148\u6765\u4e0a\u4ee3\u7801\u5427\uff1a<\/p>\n<div class=\"codecolorer-container java railscasts\" style=\"overflow:auto;white-space:nowrap;width:100%;height:100%;\"><div class=\"java codecolorer\"><span class=\"kw1\">package<\/span> <span class=\"co2\">com.ayonel.meka<\/span><span class=\"sy0\">;<\/span><br \/>\n<span class=\"kw1\">import<\/span> <span class=\"co2\">meka.classifiers.multilabel.BR<\/span><span class=\"sy0\">;<\/span><br \/>\n<span class=\"kw1\">import<\/span> <span class=\"co2\">weka.classifiers.bayes.NaiveBayesMultinomialUpdateable<\/span><span class=\"sy0\">;<\/span><br \/>\n<span class=\"kw1\">import<\/span> <span class=\"co2\">weka.core.Instances<\/span><span class=\"sy0\">;<\/span><br \/>\n<span class=\"kw1\">import<\/span> <span class=\"co2\">weka.core.converters.ArffLoader<\/span><span class=\"sy0\">;<\/span><br \/>\n<br \/>\n<span class=\"kw1\">import<\/span> <span class=\"co2\">java.io.File<\/span><span class=\"sy0\">;<\/span><br \/>\n<br \/>\n<span class=\"co3\">\/**<br \/>\n&nbsp;* @author ayonel<br \/>\n&nbsp;* @created_at 16\/9\/27<br \/>\n&nbsp;*\/<\/span><br \/>\n<br \/>\n<span class=\"kw1\">public<\/span> <span class=\"kw1\">class<\/span> YYRec <span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; <span class=\"kw1\">public<\/span> <span class=\"kw1\">static<\/span> <span class=\"kw4\">void<\/span> main<span class=\"br0\">&#40;<\/span><span class=\"kw3\">String<\/span><span class=\"br0\">&#91;<\/span><span class=\"br0\">&#93;<\/span> args<span class=\"br0\">&#41;<\/span> <span class=\"kw1\">throws<\/span> <span class=\"kw3\">Exception<\/span><span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; ArffLoader loader <span class=\"sy0\">=<\/span> <span class=\"kw1\">new<\/span> ArffLoader<span class=\"br0\">&#40;<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; loader.<span class=\"me1\">setFile<\/span><span class=\"br0\">&#40;<\/span><span class=\"kw1\">new<\/span> <span class=\"kw3\">File<\/span><span class=\"br0\">&#40;<\/span><span class=\"st0\">&quot;testdata\/Music.arff&quot;<\/span><span class=\"br0\">&#41;<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span> <span class=\"co1\">\/\/\u8bfb\u53d6\u6d4b\u8bd5\u96c6<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; loader.<span class=\"me1\">getStructure<\/span><span class=\"br0\">&#40;<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; Instances originDataSet <span class=\"sy0\">=<\/span> loader.<span class=\"me1\">getDataSet<\/span><span class=\"br0\">&#40;<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span> <span class=\"co1\">\/\/\u83b7\u53d6\u6d4b\u8bd5\u96c6<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; originDataSet.<span class=\"me1\">setClassIndex<\/span><span class=\"br0\">&#40;<\/span><span class=\"nu0\">6<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span> <span class=\"co1\">\/\/\u8fd9\u4e00\u6b65\u662f\u6307\u5b9a\u524d6\u4e2a\u5143\u7d20\u4f5c\u4e3a\u5206\u7c7b\u6807\u7b7e<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; BR br <span class=\"sy0\">=<\/span> <span class=\"kw1\">new<\/span> BR<span class=\"br0\">&#40;<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span> <span class=\"co1\">\/\/\u5efa\u7acb\u5206\u7c7b\u5668<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; br.<span class=\"me1\">buildClassifier<\/span><span class=\"br0\">&#40;<\/span>originDataSet<span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><span class=\"co1\">\/\/\u5f00\u59cb\u8bad\u7ec3<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"kw4\">double<\/span> <span class=\"br0\">&#91;<\/span><span class=\"br0\">&#93;<\/span> result <span class=\"sy0\">=<\/span> br.<span class=\"me1\">distributionForInstance<\/span><span class=\"br0\">&#40;<\/span>originDataSet.<span class=\"me1\">instance<\/span><span class=\"br0\">&#40;<\/span><span class=\"nu0\">0<\/span><span class=\"br0\">&#41;<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><span class=\"co1\">\/\/\u5bf9\u8bad\u7ec3\u96c6\u4e2d\u7684\u7b2c\u4e00\u4e2a\u5b9e\u4f8b\u8fdb\u884c\u9884\u6d4b<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"co1\">\/\/\u8f93\u51fa\u6bcf\u4e2a\u6807\u7b7e\u7684\u9884\u6d4b\u7ed3\u679c\uff08\u4e3a1\u7684\u6982\u7387\u503c\uff09<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"kw1\">for<\/span><span class=\"br0\">&#40;<\/span><span class=\"kw4\">int<\/span> i<span class=\"sy0\">=<\/span><span class=\"nu0\">0<\/span><span class=\"sy0\">;<\/span> i<span class=\"sy0\">&lt;<\/span>result.<span class=\"me1\">length<\/span><span class=\"sy0\">;<\/span> i<span class=\"sy0\">++<\/span><span class=\"br0\">&#41;<\/span> <span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"kw3\">System<\/span>.<span class=\"me1\">out<\/span>.<span class=\"me1\">println<\/span><span class=\"br0\">&#40;<\/span>result<span class=\"br0\">&#91;<\/span>i<span class=\"br0\">&#93;<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"br0\">&#125;<\/span><br \/>\n&nbsp; &nbsp; <span class=\"br0\">&#125;<\/span><br \/>\n<span class=\"br0\">&#125;<\/span><\/div><\/div>\n<p>\u8f93\u51fa\u7ed3\u679c\uff1a<\/p>\n<div class=\"codecolorer-container text railscasts\" style=\"overflow:auto;white-space:nowrap;width:100%;\"><div class=\"text codecolorer\">0.0<br \/>\n1.0<br \/>\n0.9859154929577465<br \/>\n0.034482758620689655<br \/>\n0.0<br \/>\n0.013452914798206279<\/div><\/div>\n<p>\u751a\u81f3\u8fd8\u53ef\u4ee5\u4f7f\u7528\u591a\u6807\u7b7e\u5206\u7c7b\u8fdb\u884c\u589e\u91cf\u5b66\u4e60\uff0c\u4f7f\u7528\uff1a<br \/>\nmeka.classifiers.multilabel.incremental.BRUpdateable\u7c7b\uff0c\u8be5\u7c7b\u5e95\u5c42\u4f7f\u7528weka.classifiers.trees.HoeffdingTree\u6765\u5b9e\u73b0\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e4d\u4e00\u770b\u9898\u76ee\uff0c\u4f7f\u7528&#8221;meka&#8220;\u5b9e\u73b0\u5206\u7c7b\u5668\uff0c\u662f\u4e0d\u662f\u7b14\u8005\u6253\u9519\u4e86\u554a\uff0c\u5e94\u8be5\u662fweka\u554a\u3002\u5176\u5b9e\u4e0d\u7136 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[],"class_list":["post-202","post","type-post","status-publish","format-standard","hentry","category-machine-learning"],"_links":{"self":[{"href":"https:\/\/ayonel.malash.net\/index.php\/wp-json\/wp\/v2\/posts\/202","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ayonel.malash.net\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ayonel.malash.net\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ayonel.malash.net\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ayonel.malash.net\/index.php\/wp-json\/wp\/v2\/comments?post=202"}],"version-history":[{"count":3,"href":"https:\/\/ayonel.malash.net\/index.php\/wp-json\/wp\/v2\/posts\/202\/revisions"}],"predecessor-version":[{"id":206,"href":"https:\/\/ayonel.malash.net\/index.php\/wp-json\/wp\/v2\/posts\/202\/revisions\/206"}],"wp:attachment":[{"href":"https:\/\/ayonel.malash.net\/index.php\/wp-json\/wp\/v2\/media?parent=202"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ayonel.malash.net\/index.php\/wp-json\/wp\/v2\/categories?post=202"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ayonel.malash.net\/index.php\/wp-json\/wp\/v2\/tags?post=202"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}