{"id":215453,"date":"2014-03-13T17:41:03","date_gmt":"2014-03-13T13:41:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=215453"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=215453","title":{"rendered":"<span class=\"post_title\">\u041c\u043e\u0434\u0435\u043b\u044c Random Forest \u0434\u043b\u044f \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438, \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043d\u0430 c#<\/span>"},"content":{"rendered":"<div class=\"content html_format\">   \t<img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/e7a\/aad\/06b\/e7aaad06bdbca9cc09f6400df3e63fd3.jpg\" align=\"right\" width=\"320\"\/> \u0414\u043e\u0431\u0440\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0441\u0443\u0442\u043e\u043a, \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044c. <a href=\"http:\/\/en.wikipedia.org\/wiki\/Random_forest\">Random Forest<\/a> \u0441\u0435\u0433\u043e\u0434\u043d\u044f \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0434\u043d\u0438\u043c \u0438\u0437 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u0435\u0439\u0448\u0438\u0445 \u0438 \u043a\u0440\u0430\u0439\u043d\u0435 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u0447 \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f, \u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f \u0438 \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u044f. \u041f\u043e \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438 \u043e\u043d \u043a\u043e\u043d\u043a\u0443\u0440\u0438\u0440\u0443\u0435\u0442 \u0441 \u043c\u0430\u0448\u0438\u043d\u0430\u043c\u0438 \u043e\u043f\u043e\u0440\u043d\u044b\u0445 \u0432\u0435\u043a\u0442\u043e\u0440\u043e\u0432, \u043d\u0435\u0439\u0440\u043e\u043d\u043d\u044b\u043c\u0438 \u0441\u0435\u0442\u044f\u043c\u0438 \u0438 \u0431\u0443\u0441\u0442\u0438\u043d\u0433\u043e\u043c, \u0445\u043e\u0442\u044f \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u043d\u0435 \u043b\u0438\u0448\u0435\u043d \u0441\u0432\u043e\u0438\u0445 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u043e\u0432. \u0421 \u0432\u0438\u0434\u0443 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u043a\u0440\u0430\u0439\u043d\u0435 \u043f\u0440\u043e\u0441\u0442 (\u0432 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0438 \u0441\u043a\u0430\u0436\u0435\u043c \u0441 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u043c \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u043c\u0430\u0448\u0438\u043d\u044b \u043e\u043f\u043e\u0440\u043d\u044b\u0445 \u0432\u0435\u043a\u0442\u043e\u0440\u043e\u0432, \u043a\u043e\u043c\u0443 \u043c\u0430\u043b\u043e \u043e\u0441\u0442\u0440\u044b\u0445 \u043e\u0449\u0443\u0449\u0435\u043d\u0438\u0439 \u0432 \u0436\u0438\u0437\u043d\u0438, \u043a\u0440\u0430\u0439\u043d\u0435 \u0441\u043e\u0432\u0435\u0442\u0443\u044e \u0437\u0430\u043d\u044f\u0442\u044c\u0441\u044f \u044d\u0442\u0438\u043c \u043d\u0430 \u0434\u043e\u0441\u0443\u0433\u0435). \u041c\u044b \u0436\u0435 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0432 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0439 \u0444\u043e\u0440\u043c\u0435 \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u0438\u0434\u0435\u044f\u0445, \u0437\u0430\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0445 \u0432 Random Forest (\u0431\u0438\u043d\u0430\u0440\u043d\u043e\u0435 \u0434\u0435\u0440\u0435\u0432\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0439, \u0431\u0443\u0442\u0441\u0442\u0440\u0435\u043f \u0430\u0433\u0433\u0440\u0435\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0438\u043b\u0438 \u0431\u044d\u0433\u0433\u0438\u043d\u0433, \u043c\u0435\u0442\u043e\u0434 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0445 \u043f\u043e\u0434\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432 \u0438 \u0434\u0435\u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u044f) \u0438 \u043f\u043e\u043d\u044f\u0442\u044c \u043f\u043e\u0447\u0435\u043c\u0443 \u0432\u0441\u0435 \u044d\u0442\u043e \u0432\u043c\u0435\u0441\u0442\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442. \u041c\u043e\u0434\u0435\u043b\u044c \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u0432\u043e\u0438\u0445 \u043a\u043e\u043d\u043a\u0443\u0440\u0435\u043d\u0442\u043e\u0432 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0442\u0430\u043a\u0438 \u043c\u043e\u043b\u043e\u0434\u0430\u044f: \u043d\u0430\u0447\u0430\u043b\u043e\u0441\u044c \u0432\u0441\u0435 \u0441\u043e <a href=\"http:\/\/www.cis.jhu.edu\/publications\/papers_in_database\/GEMAN\/shape.pdf\">\u0441\u0442\u0430\u0442\u044c\u0438 1997 \u0433\u043e\u0434\u0430<\/a> \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0430\u0432\u0442\u043e\u0440\u044b \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u043b\u0438 \u0441\u043f\u043e\u0441\u043e\u0431 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u043e\u0434\u043d\u043e\u0433\u043e \u0434\u0435\u0440\u0435\u0432\u0430 \u0440\u0435\u0448\u0435\u043d\u0438\u0439, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043c\u0435\u0442\u043e\u0434 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0445 \u043f\u043e\u0434\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432 \u043f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u043d\u043e\u0432\u044b\u0445 \u0443\u0437\u043b\u043e\u0432 \u0434\u0435\u0440\u0435\u0432\u0430; \u0437\u0430\u0442\u0435\u043c \u0431\u044b\u043b \u0440\u044f\u0434 \u0441\u0442\u0430\u0442\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u043b\u0441\u044f <a href=\"http:\/\/stat-www.berkeley.edu\/users\/breiman\/RandomForests\/cc_home.htm\">\u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0435\u0439 \u043a\u0430\u043d\u043e\u043d\u0438\u0447\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u0432 2001 \u0433\u043e\u0434\u0443<\/a>, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0441\u0442\u0440\u043e\u0438\u0442\u0441\u044f \u0430\u043d\u0441\u0430\u043c\u0431\u043b\u044c \u0440\u0435\u0448\u0430\u044e\u0449\u0438\u0445 \u0434\u0435\u0440\u0435\u0432\u044c\u0435\u0432 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0431\u0443\u0442\u0441\u0442\u0440\u0435\u043f \u0430\u0433\u0440\u0435\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0438\u043b\u0438 \u0431\u044d\u0433\u0433\u0438\u043d\u0433\u0430. \u0412 \u043a\u043e\u043d\u0446\u0435 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d \u043f\u0440\u043e\u0441\u0442\u043e\u0439, \u0441\u043e\u0432\u0441\u0435\u043c \u043d\u0435 \u0448\u0443\u0441\u0442\u0440\u044b\u0439, \u043d\u043e \u043a\u0440\u0430\u0439\u043d\u0435 \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u044d\u0442\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \u043d\u0430 c#, \u0430 \u0442\u0430\u043a \u0436\u0435 \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043d \u0440\u044f\u0434 \u0442\u0435\u0441\u0442\u043e\u0432. \u041a\u0441\u0442\u0430\u0442\u0438 \u043d\u0430 <a href=\"http:\/\/tainy.net\/3598-zagadka-tancuyushhego-lesa.html\">\u0444\u043e\u0442\u043a\u0435 \u0441\u043f\u0440\u0430\u0432\u0430<\/a> \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0442\u044c \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0438\u0439 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0439 \u043b\u0435\u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u043e\u0438\u0437\u0440\u0430\u0441\u0442\u0430\u0435\u0442 \u0443 \u043d\u0430\u0441 \u0442\u0443\u0442 \u0432 \u041a\u0430\u043b\u0438\u043d\u0438\u043d\u0433\u0440\u0430\u0434\u0441\u043a\u043e\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u043d\u0430 <a href=\"http:\/\/ru.wikipedia.org\/wiki\/\u041a\u0443\u0440\u0448\u0441\u043a\u0430\u044f_\u043a\u043e\u0441\u0430\">\u041a\u0443\u0440\u0448\u0441\u043a\u043e\u0439 \u043a\u043e\u0441\u0435<\/a>.<\/p>\n<p>  <a name=\"habracut\"><\/a><\/p>\n<h4>\u0411\u0438\u043d\u0430\u0440\u043d\u043e\u0435 \u0434\u0435\u0440\u0435\u0432\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0439<\/h4>\n<p>  \u041d\u0430\u0447\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0441 \u0434\u0435\u0440\u0435\u0432\u0430, \u043a\u0430\u043a \u0441 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0433\u043e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043d\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u043b\u0435\u0441\u0430, \u043d\u043e \u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435 \u0438\u0437\u0443\u0447\u0430\u0435\u043c\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438. \u0418\u0437\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0431\u0443\u0434\u0435\u0442 \u0441\u0442\u0440\u043e\u0438\u0442\u0441\u044f \u043d\u0430 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0438, \u0447\u0442\u043e \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044c \u043f\u043e\u043d\u0438\u043c\u0430\u0435\u0442, \u0447\u0442\u043e \u0438\u0437 \u0441\u0435\u0431\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 <a href=\"http:\/\/ru.wikipedia.org\/wiki\/\u0414\u0435\u0440\u0435\u0432\u043e_(\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430_\u0434\u0430\u043d\u043d\u044b\u0445)\">\u0434\u0435\u0440\u0435\u0432\u043e, \u043a\u0430\u043a \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0434\u0430\u043d\u043d\u044b\u0445<\/a>. \u041f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435 \u0434\u0435\u0440\u0435\u0432\u0430 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f <i>\u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e<\/i> \u043f\u043e <a href=\"http:\/\/ru.wikipedia.org\/wiki\/CART_(\u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c)\">\u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0443 CART<\/a> (Classification and Regression Tree), \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u0442\u0440\u043e\u0438\u0442 \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0435 \u0434\u0435\u0440\u0435\u0432\u044c\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u0439. \u041a\u0441\u0442\u0430\u0442\u0438 \u0442\u0443\u0442 \u043d\u0430 \u0445\u0430\u0431\u0440\u0435 \u0435\u0441\u0442\u044c \u0433\u043e\u0434\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u043f\u043e \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044e \u0442\u0430\u043a\u0438\u0445 <a href=\"http:\/\/habrahabr.ru\/post\/171759\/\">\u0434\u0435\u0440\u0435\u0432\u044c\u0435\u0432 \u043d\u0430 \u0431\u0430\u0437\u0435 \u043c\u0438\u043d\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u044d\u043d\u0442\u0440\u043e\u043f\u0438\u0438<\/a>, \u0432 \u043d\u0430\u0448\u0435\u043c \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0435 \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0447\u0430\u0441\u0442\u043d\u044b\u043c \u0441\u043b\u0443\u0447\u0430\u0435\u043c. \u0418\u0442\u0430\u043a \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u044c\u0442\u0435 \u0441\u0435\u0431\u0435 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432, \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c \u0434\u0432\u0443\u043c\u0435\u0440\u043d\u043e\u0435, \u0447\u0442\u043e \u0431\u044b \u0431\u044b\u043b\u043e \u043b\u0435\u0433\u0447\u0435 \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0437\u0430\u0434\u0430\u043d\u043e \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0434\u0432\u0443\u0445 \u043a\u043b\u0430\u0441\u0441\u043e\u0432.<br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/261\/592\/978\/261592978406aff5388d5da09af69782.png\"\/><br \/>  \u0412\u0432\u0435\u0434\u0435\u043c \u0440\u044f\u0434 \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439. \u041e\u0431\u043e\u0437\u043d\u0430\u0447\u0438\u043c \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/29f\/817\/af4\/29f817af4c1da4e21c903de9d54e4505.gif\"\/><br \/>  \u0414\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0430 \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0434\u0435\u043b\u0438\u0442\u044c \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0435\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439, \u043e\u0441\u043d\u043e\u0432\u044b\u0432\u0430\u044f\u0441\u044c \u043b\u0438\u0431\u043e \u043d\u0430 \u043e\u0431\u0443\u0447\u0430\u044e\u0449\u0435\u043c \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0435, \u043b\u0438\u0431\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0434\u0440\u0443\u0433\u0443\u044e \u0430\u043f\u0440\u0438\u043e\u0440\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0437\u0430\u0434\u0430\u0447\u0435, \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0435 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0430:<br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/3fa\/6e6\/0e1\/3fa6e60e1dda5cf78b28397ed661a202.gif\"\/><br \/>  \u0422\u0430\u043a \u0436\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0432\u0432\u0435\u0441\u0442\u0438 \u0442\u0430\u043a \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u0443\u044e \u043c\u0435\u0440\u0443 <i>\u043d\u0435\u043e\u0434\u043d\u043e\u0440\u043e\u0434\u043d\u043e\u0441\u0442\u0438<\/i> \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0430 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0435\u0433\u043e \u043c\u0435\u0442\u043e\u043a. \u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u044c\u0442\u0435, \u0447\u0442\u043e \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043f\u043e\u0434\u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043e\u0431\u0443\u0447\u0430\u044e\u0449\u0435\u0433\u043e \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0430 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 <b>5<\/b> \u043a\u0440\u0430\u0441\u043d\u044b\u0445 \u0438 <b>10 <\/b>\u0441\u0438\u043d\u0438\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432, \u0442\u043e\u0433\u0434\u0430 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0430\u0442\u044c, \u0447\u0442\u043e \u0432 \u044d\u0442\u043e\u043c \u043f\u043e\u0434\u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0435 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0432\u044b\u0442\u044f\u043d\u0443\u0442\u044c \u043a\u0440\u0430\u0441\u043d\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 \u0431\u0443\u0434\u0435\u0442 <b>1\/3<\/b>, \u0430 \u0441\u0438\u043d\u0438\u0439 <b>2\/3<\/b>. \u041e\u0431\u043e\u0437\u043d\u0430\u0447\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c k-\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 \u0432 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043f\u043e\u0434\u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0435 \u043e\u0431\u0443\u0447\u0430\u044e\u0449\u0435\u0433\u043e \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0430:<br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/b25\/19d\/1af\/b2519d1af8448b6317200e7d0ebd94c7.gif\"\/><br \/>  \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043c\u044b \u0437\u0430\u0434\u0430\u043b\u0438 \u044d\u043c\u043f\u0438\u0440\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0434\u0438\u0441\u043a\u0440\u0435\u0442\u043d\u043e\u0435 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u043d\u043e\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043c\u0435\u0442\u043e\u043a \u0432 \u043f\u043e\u0434\u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0435 \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u0439. \u041c\u0435\u0440\u043e\u0439 <i>\u043d\u0435\u043e\u0434\u043d\u043e\u0440\u043e\u0434\u043d\u043e\u0441\u0442\u0438<\/i> \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u0434\u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0430 \u0431\u0443\u0434\u0435\u043c \u043d\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0432\u0438\u0434\u0430, \u0433\u0434\u0435 <b>K(A)<\/b> \u2014 \u043e\u0431\u0449\u0435\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043c\u0435\u0442\u043e\u043a \u043f\u043e\u0434\u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0430 <b>A<\/b>:<br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/4e8\/eda\/b08\/4e8edab08834bedbd845060e99490365.gif\"\/><br \/>  \u041c\u0435\u0440\u0430 \u043d\u0435\u043e\u0434\u043d\u043e\u0440\u043e\u0434\u043d\u043e\u0441\u0442\u0438 \u0437\u0430\u0434\u0430\u0435\u0442\u0441\u044f \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0447\u0442\u043e \u0431\u044b \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043f\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0432\u043e\u0437\u0440\u0430\u0441\u0442\u0430\u043b\u043e \u043f\u0440\u0438 \u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u0438 <i>\u0440\u0430\u0437\u043d\u043e\u0448\u0435\u0440\u0441\u0442\u043d\u043e\u0441\u0442\u0438<\/i> \u043d\u0430\u0431\u043e\u0440\u0430, \u0434\u043e\u0441\u0442\u0438\u0433\u0430\u044f \u0441\u0432\u043e\u0435\u0433\u043e \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c\u0430 \u0442\u043e\u0433\u0434\u0430, \u043a\u043e\u0433\u0434\u0430 \u043d\u0430\u0431\u043e\u0440 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e\u0433\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0432\u0441\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u043a, \u0438 \u043c\u0438\u043d\u0438\u043c\u0443\u043c\u0430 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0435\u0441\u043b\u0438 \u043d\u0430\u0431\u043e\u0440 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0438\u0437 \u043c\u0435\u0442\u043e\u043a \u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 (\u0435\u0449\u0435 \u0440\u0430\u0437 \u0441\u043e\u0432\u0435\u0442\u0443\u044e \u0432\u0437\u0433\u043b\u044f\u043d\u0443\u0442\u044c <a href=\"http:\/\/habrahabr.ru\/post\/171759\/\">\u043d\u0430 \u044d\u043d\u0442\u0440\u043e\u043f\u0438\u0439\u043d\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u0441 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0430\u043c\u0438<\/a>).<\/p>\n<p>  \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0432\u0437\u0433\u043b\u044f\u043d\u0435\u043c \u043d\u0430 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u043c\u0435\u0440 \u043d\u0435\u043e\u0434\u043d\u043e\u0440\u043e\u0434\u043d\u043e\u0441\u0442\u0438 (\u0432\u0435\u043a\u0442\u043e\u0440 <b>p<\/b> \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 <b>m<\/b> \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0435\u0439 \u043c\u0435\u0442\u043e\u043a \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u044e\u0449\u0438\u0445\u0441\u044f \u0432 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043f\u043e\u0434\u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0435 <b>A<\/b> \u043e\u0431\u0443\u0447\u0430\u044e\u0449\u0435\u0433\u043e \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0430):  <\/p>\n<ul>\n<li> Most commonly occurring class: <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/011\/706\/9b3\/0117069b35a016710a84b14e5801c036.gif\"\/><\/li>\n<li> <a href=\"http:\/\/en.wikipedia.org\/wiki\/Gini_coefficient\">Gini index<\/a>: <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/7f1\/52f\/c30\/7f152fc308c9005d8f6c099874db0bd6.gif\"\/><\/li>\n<li> <a href=\"http:\/\/en.wikipedia.org\/wiki\/Cross_entropy\">Cross-entropy<\/a>: <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/f46\/b81\/0b3\/f46b810b322faeecdae706e86ab61b0b.gif\"\/><\/li>\n<\/ul>\n<p>  \u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u0431\u0438\u043d\u0430\u0440\u043d\u043e\u0433\u043e \u0434\u0435\u0440\u0435\u0432\u0430 \u0440\u0435\u0448\u0435\u043d\u0438\u0439 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043f\u043e \u0441\u0445\u0435\u043c\u0435 <a href=\"http:\/\/ru.wikipedia.org\/wiki\/\u0416\u0430\u0434\u043d\u044b\u0439_\u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\">\u0436\u0430\u0434\u043d\u043e\u0433\u043e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430<\/a>: \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u0439 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0438 \u0434\u043b\u044f \u0432\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u043f\u043e\u0434\u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0430 \u043e\u0431\u0443\u0447\u0430\u044e\u0449\u0435\u0433\u043e \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0430 \u0441\u0442\u0440\u043e\u0438\u0442\u0441\u044f \u0442\u0430\u043a\u043e\u0435 \u0440\u0430\u0437\u0431\u0438\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430 \u0433\u0438\u043f\u0435\u0440\u043f\u043b\u043e\u0441\u043a\u043e\u0441\u0442\u044c\u044e (\u043e\u0440\u0442\u043e\u0433\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0439 \u043e\u0434\u043d\u043e\u0439 \u0438\u0445 \u043e\u0441\u0435\u0439 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442), \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043c\u0438\u043d\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043b\u043e \u0431\u044b \u0441\u0440\u0435\u0434\u043d\u044e\u044e \u043c\u0435\u0440\u0443 \u043d\u0435\u043e\u0434\u043d\u043e\u0440\u043e\u0434\u043d\u043e\u0441\u0442\u0438 \u0434\u0432\u0443\u0445 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0445 \u043f\u043e\u0434\u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432. \u0414\u0430\u043d\u043d\u0430\u044f \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0440\u0435\u043a\u0443\u0440\u0441\u0438\u0432\u043d\u043e \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0433\u043e \u043f\u043e\u0434\u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0430 \u0434\u043e \u0442\u0435\u0445 \u043f\u043e\u0440, \u043f\u043e\u043a\u0430 \u043d\u0435 \u0431\u0443\u0434\u0443\u0442 \u0434\u043e\u0441\u0442\u0438\u0433\u043d\u0443\u0442\u044b \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u0438 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438. \u0417\u0430\u043f\u0438\u0448\u0435\u043c \u044d\u0442\u043e \u0431\u043e\u043b\u0435\u0435 \u0444\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e, \u0434\u043b\u044f \u0432\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0430 <b>A<\/b> \u043d\u0430\u0439\u0434\u0435\u043c \u043f\u0430\u0440\u0443 &lt;<b>\u043f\u0440\u0438\u0437\u043d\u0430\u043a<\/b>, <b>\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0430<\/b>&gt;, \u0447\u0442\u043e \u043c\u0435\u0440\u0430 \u043d\u0435\u043e\u0434\u043d\u043e\u0440\u043e\u0434\u043d\u043e\u0441\u0442\u0438 \u0431\u0443\u0434\u0435\u0442 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u0430:<br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/2eb\/738\/8c4\/2eb7388c494153fb283a15a1f377a98b.gif\"\/><br \/>  \u0433\u0434\u0435 <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/b09\/8cc\/300\/b098cc300aacc16f6a70bc234fed4ec5.gif\"\/> \u2014 \u0432\u0435\u043a\u0442\u043e\u0440 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0435\u0439 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 \u043f\u043e \u0432\u044b\u0448\u0435\u043e\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0439 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0435 \u043e\u0442 \u043f\u043e\u0434\u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0430 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0430 <b>A<\/b>, \u0441\u043e\u0441\u0442\u043e\u044f\u0449\u0435\u0433\u043e \u0438\u0437 \u0442\u0435\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0434\u043b\u044f \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0443\u0441\u043b\u043e\u0432\u0438\u0435 <b>f &lt; x<\/b>. \u0422\u0430\u043a \u0436\u0435 \u043d\u0435 \u0441\u0442\u043e\u0438\u0442 \u0437\u0430\u0431\u044b\u0432\u0430\u0442\u044c, \u0447\u0442\u043e \u0441\u0440\u0435\u0434\u043d\u044f\u044f \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c \u0440\u0430\u0437\u0431\u0438\u0435\u043d\u0438\u044f \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u0430 \u043f\u0440\u0435\u0432\u044b\u0448\u0430\u0442\u044c \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0430. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0442\u0435\u043f\u0435\u0440\u044c \u0432\u0435\u0440\u043d\u0435\u043c\u0441\u044f \u043a \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0439 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0435 \u0438 \u0433\u043b\u044f\u043d\u0435\u043c \u0447\u0442\u043e \u0440\u0435\u0430\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442, \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u043c \u0432\u044b\u0448\u0435\u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0435 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0434\u0430\u043d\u043d\u044b\u0445:<br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/64f\/ec3\/120\/64fec3120cdc76553df31a518c945243.png\"\/><br \/>  \u041a\u0430\u043a \u0432\u0438\u0434\u0438\u0442\u0435 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0432\u044b\u0448\u0435 \u043b\u0438\u043d\u0438\u0438 <b>y=2.840789<\/b> \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u0441\u0438\u043d\u0438\u0445 \u043c\u0435\u0442\u043e\u043a, \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0438\u043c\u0435\u0435\u0442 \u0441\u043c\u044b\u043b \u0440\u0430\u0437\u0431\u0438\u0432\u0430\u0442\u044c \u0434\u0430\u043b\u0435\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u0442\u043e\u0440\u043e\u0435 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e. <br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/648\/bb4\/554\/648bb4554ef1f3f54332165a2172717e.png\"\/><br \/>  \u0412 \u044d\u0442\u043e\u0442 \u0440\u0430\u0437 \u043b\u0438\u043d\u0438\u044f <b>x=2.976719<\/b>. \u0412 \u043e\u0431\u0449\u0435\u043c \u043a\u043e\u043c\u0443 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u043f\u043e\u0431\u0430\u043b\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0441 \u044d\u0442\u043e\u0439 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u043e\u0439, \u0432\u043e\u0442 \u043a\u043e\u0434 \u043d\u0430 R:  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043e\u0434 \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"diff\">rm(list=ls()) library(mvtnorm)  labCount &lt;- 100 lab1 &lt;- rmvnorm(n=labCount, mean=c(1,1), sigma=diag(c(1, 1))) lab0 &lt;- rmvnorm(n=labCount, mean=c(2,2), sigma=diag(c(0.5, 2))) df &lt;- data.frame(x=append(lab1[, 1], lab0[, 1]),                  y=append(lab1[, 2], lab0[, 2]),                  lab=append(rep(1, labCount), rep(0, labCount)))  plot(df$x, df$y, col=append(rep(&quot;red&quot;, labCount), rep(&quot;blue&quot;, labCount)), pch=19,      xlab=&quot;Feature 1&quot;, ylab=&quot;Feature 2&quot;)  giniIdx &lt;- function(data) {   p1 &lt;- sum(data$lab == 1)\/length(data$lab)   p0 &lt;- sum(data$lab == 0)\/length(data$lab)   return(p0*(1 - p0) + p1*(1 - p1))  }  p.norm &lt;- giniIdx   getSeparator &lt;- function(data) {   idx &lt;- NA   idx.val &lt;- NA   cost &lt;- p.norm(data)   for(i in 1:(dim(data)[2] - 1))   {     for(i.val in unique(data[, i]))     {       #print(paste(&quot;i = &quot;, i, &quot;; v = &quot;, i.val, sep=&quot;&quot;))       cost.tmp &lt;- 0.5*(p.norm(data[data[, i] &lt; i.val, ]) +                        p.norm(data[data[, i] &gt;= i.val, ]))       if(is.nan(cost.tmp))       {         next       }       if(cost.tmp &lt; cost)       {         cost &lt;- cost.tmp         idx &lt;- i         idx.val &lt;- i.val       }     }   }   return(c(idx, idx.val)) }  s1 &lt;- getSeparator(df) lines(c(-100, 100), c(s1[2], s1[2]), lty=2, lwd=2, type=&quot;l&quot;) <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u041f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0438\u043c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u0438 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438: \u0434\u043e\u0441\u0442\u0438\u0433\u043d\u0443\u0442\u0430 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u0430\u044f \u0433\u043b\u0443\u0431\u0438\u043d\u0430 \u0443\u0437\u043b\u0430; \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0434\u043e\u043c\u0438\u043d\u0438\u0440\u0443\u044e\u0449\u0435\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 \u0432 \u0440\u0430\u0437\u0431\u0438\u0435\u043d\u0438\u0438 \u043f\u0440\u0435\u0432\u044b\u0448\u0430\u0435\u0442 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0440\u043e\u0433 (\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e 0.95); \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0432 \u043f\u043e\u0434\u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0435 \u043c\u0435\u043d\u044c\u0448\u0435 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043f\u043e\u0440\u043e\u0433\u0430. \u0412 \u0438\u0442\u043e\u0433\u0435 \u0443 \u043d\u0430\u0441 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u0440\u0430\u0437\u0431\u0438\u0435\u043d\u0438\u0435 \u0432\u0441\u0435\u0433\u043e \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0430 \u043d\u0430 (\u0433\u0438\u043f\u0435\u0440)\u043f\u0440\u044f\u043c\u043e\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a\u0438, \u0438 \u043a\u0430\u0436\u0434\u043e\u0435 \u0442\u0430\u043a\u043e\u0435 \u043f\u043e\u0434\u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0430 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u0431\u0443\u0434\u0435\u0442 \u0430\u0441\u0441\u043e\u0446\u0438\u0438\u0440\u043e\u0432\u0430\u043d\u043e \u0441 \u043e\u0434\u043d\u0438\u043c \u043b\u0438\u0441\u0442\u043e\u043c \u0434\u0435\u0440\u0435\u0432\u0430, \u0430 \u0432\u0441\u0435 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0435 \u0443\u0437\u043b\u044b \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0438\u0437 \u0441\u0435\u0431\u044f \u043e\u0434\u043d\u043e \u0438\u0437 \u0443\u0441\u043b\u043e\u0432\u0438\u0439 \u0440\u0430\u0437\u0431\u0438\u0435\u043d\u0438\u044f; \u0438\u043b\u0438 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0435\u0434\u0438\u043a\u0430\u0442. \u0423 \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u0443\u0437\u043b\u0430, \u043b\u0435\u0432\u044b\u0439 \u043f\u043e\u0442\u043e\u043c\u043e\u043a \u0430\u0441\u0441\u043e\u0446\u0438\u0438\u0440\u043e\u0432\u0430\u043d \u0441 \u0442\u0435\u043c\u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c\u0438 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0430, \u0434\u043b\u044f \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043f\u0440\u0435\u0434\u0438\u043a\u0430\u0442 \u0432\u0435\u0440\u0435\u043d, \u0430 \u043f\u0440\u0430\u0432\u044b\u0439 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0441 \u0442\u0435\u043c\u0443 \u0434\u043b\u044f \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043f\u0440\u0435\u0434\u0438\u043a\u0430\u0442 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043b\u043e\u0436\u044c. \u0412\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u044d\u0442\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<br \/>  <img decoding=\"async\" src=\"\/\/habrastorage.org\/files\/e74\/68c\/875\/e7468c875acd4abba1b557e456ed52ed.png\"\/><br \/>  \u0418\u0442\u0430\u043a \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u0434\u0435\u0440\u0435\u0432\u043e, \u043a\u0430\u043a \u0436\u0435 \u043f\u0440\u0438\u043d\u044f\u0442\u044c \u043d\u0430 \u043d\u0435\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u0435? \u041d\u0430\u043c \u043d\u0435 \u0441\u043e\u0441\u0442\u0430\u0432\u0438\u0442 \u0442\u0440\u0443\u0434\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043a \u043a\u0430\u043a\u043e\u043c\u0443 \u0438\u0437 \u043f\u043e\u0434\u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432 \u043e\u0431\u0443\u0447\u0430\u044e\u0449\u0435\u0433\u043e \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0430 \u043f\u0440\u0438\u043d\u0430\u0434\u043b\u0435\u0436\u0438\u0442 \u043b\u044e\u0431\u043e\u0439 \u0432\u0445\u043e\u0434\u043d\u043e\u0439 \u043e\u0431\u0440\u0430\u0437, \u043f\u043e \u043c\u043d\u0435\u043d\u0438\u044e \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u0434\u0435\u0440\u0435\u0432\u0430 \u0440\u0435\u0448\u0435\u043d\u0438\u0439. \u0414\u0430\u043b\u0435\u0435 \u043d\u0430\u043c \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0434\u043e\u043c\u0438\u043d\u0438\u0440\u0443\u044e\u0449\u0438\u0439 \u043a\u043b\u0430\u0441\u0441 \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u043e\u0434\u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0435 \u0438 \u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0435\u0433\u043e \u043a\u043b\u0438\u0435\u043d\u0442\u0443, \u043b\u0438\u0431\u043e \u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u043d\u043e\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043c\u0435\u0442\u043e\u043a \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u043e\u0434\u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0435. <\/p>\n<p>  \u041a\u0441\u0442\u0430\u0442\u0438 \u043d\u0430 \u0441\u0447\u0435\u0442 \u0437\u0430\u0434\u0430\u0447\u0438 <b>\u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u0438<\/b>. \u041e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u0434\u0435\u0440\u0435\u0432\u0430 \u043b\u0435\u0433\u043a\u043e \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0441 \u0437\u0430\u0434\u0430\u0447\u0438 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043d\u0430 \u0437\u0430\u0434\u0430\u0447\u0443 \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u0438. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u043c\u0435\u0440\u0443 \u043d\u0435\u043e\u0434\u043d\u043e\u0440\u043e\u0434\u043d\u043e\u0441\u0442\u0438 \u043d\u0430 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043c\u0435\u0440\u0443 \u043e\u0448\u0438\u0431\u043a\u0438 \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u043d\u0430 \u0441\u0440\u0435\u0434\u043d\u0435\u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0438\u0447\u043d\u043e\u0435 \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0435. \u0410 \u043f\u0440\u0438 \u043f\u0440\u0438\u043d\u044f\u0442\u0438\u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0432\u043c\u0435\u0441\u0442\u043e \u0434\u043e\u043c\u0438\u043d\u0438\u0440\u0443\u044e\u0449\u0435\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0441\u0440\u0435\u0434\u043d\u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0446\u0435\u043b\u0435\u0432\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439.<\/p>\n<p>  \u0412\u0440\u043e\u0434\u0435 \u0441 \u0434\u0435\u0440\u0435\u0432\u044c\u044f\u043c\u0438 \u0432\u0441\u0435 \u043f\u043e\u0440\u0435\u0448\u0430\u043b\u0438. \u041c\u044b \u043d\u0435 \u0431\u0443\u0434\u0435\u043c \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u043f\u043b\u044e\u0441\u0430\u0445 \u0438 \u043c\u0438\u043d\u0443\u0441\u0430\u0445 \u044d\u0442\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430, \u0432 <a href=\"http:\/\/ru.wikipedia.org\/wiki\/\u0414\u0435\u0440\u0435\u0432\u043e_\u043f\u0440\u0438\u043d\u044f\u0442\u0438\u044f_\u0440\u0435\u0448\u0435\u043d\u0438\u0439\">\u0432\u0438\u043a\u0438\u043f\u0435\u0434\u0438\u0438 \u0435\u0441\u0442\u044c \u0445\u043e\u0440\u043e\u0448\u0438\u0439 \u0441\u043f\u0438\u0441\u043e\u043a<\/a>. \u041d\u043e \u0432 \u043a\u043e\u043d\u0446\u0435 \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0438\u043b\u043b\u044e\u0441\u0442\u0440\u0430\u0446\u0438\u044e \u0438\u0437 \u043a\u043d\u0438\u0433\u0438 <a href=\"http:\/\/www-bcf.usc.edu\/~gareth\/ISL\/\">An Introduction to Statistical Learning<\/a> \u043f\u0440\u043e \u0440\u0430\u0437\u043d\u0438\u0446\u0443 \u043b\u0438\u043d\u0435\u0439\u043d\u044b\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0438 \u0434\u0435\u0440\u0435\u0432\u044c\u0435\u0432.<br \/>  <img decoding=\"async\" src=\"\/\/habrastorage.org\/files\/c6f\/f70\/de5\/c6ff70de55794bbfb4855dea661d5d09.png\"\/><br \/>  \u0414\u0430\u043d\u043d\u0430\u044f \u0438\u043b\u043b\u044e\u0441\u0442\u0440\u0430\u0446\u0438\u044f \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0440\u0430\u0437\u043d\u0438\u0446\u0443 \u043c\u0435\u0436\u0434\u0443 \u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u044c\u044e \u0438 \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u043c \u0434\u0435\u0440\u0435\u0432\u043e\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u0439, \u043a\u0430\u043a \u0432\u0438\u0434\u0438\u0442\u0435 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0439 \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u043c\u043e\u0441\u0442\u0438, \u0432 \u043e\u0431\u0449\u0435\u043c \u0434\u0435\u0440\u0435\u0432\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043c\u0435\u043d\u0435\u0435 \u0442\u043e\u0447\u043d\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043d\u0435\u0436\u0435\u043b\u0438 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043b\u0438\u043d\u0435\u0439\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440. <\/p>\n<h4>Bootstrap aggregating \u0438\u043b\u0438 bagging<\/h4>\n<p>  \u041f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043a \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0438\u0434\u0435\u0439\u043d\u043e\u0439 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0435\u0439 random forest&#8217;\u0430. \u0418\u0442\u0430\u043a \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 BAGging, \u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u043e \u043e\u0442 Bootstrap AGgregating. \u0412 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0435 \u043f\u043e\u0434 \u0431\u0443\u0442\u0441\u0442\u0440\u0435\u043f\u043e\u043c \u043f\u043e\u043d\u0438\u043c\u0430\u044e\u0442 \u043a\u0430\u043a \u0441\u043f\u043e\u0441\u043e\u0431 \u043e\u0446\u0435\u043d\u043a\u0438 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u043e\u0448\u0438\u0431\u043a\u0438 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a \u0432\u044b\u0431\u043e\u0440\u043e\u0447\u043d\u043e\u0433\u043e \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u043d\u043e\u0433\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f, \u0442\u0430\u043a \u0438 \u0441\u043f\u043e\u0441\u043e\u0431 <a href=\"http:\/\/en.wikipedia.org\/wiki\/Sampling_(statistics)\">\u0441\u0435\u043c\u043f\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f <\/a>\u0432\u044b\u0431\u043e\u0440\u043e\u043a \u0438\u0437 \u043d\u0430\u0431\u043e\u0440\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043d\u0430 <a href=\"http:\/\/ru.wikipedia.org\/wiki\/\u041c\u0435\u0442\u043e\u0434_\u041c\u043e\u043d\u0442\u0435-\u041a\u0430\u0440\u043b\u043e\">\u043c\u0435\u0442\u043e\u0434\u0435 \u041c\u043e\u043d\u0442\u0435-\u041a\u0430\u0440\u043b\u043e<\/a>. <\/p>\n<p>  \u0411\u0443\u0442\u0441\u0442\u0440\u0435\u043f \u0441\u0435\u043c\u043f\u043b\u0438\u043d\u0433 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0442\u0430\u043a\u0438 \u043f\u0440\u043e\u0441\u0442 \u043f\u043e \u0441\u0432\u043e\u0435\u0439 \u0438\u0434\u0435\u0435, \u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0442\u043e\u0433\u0434\u0430, \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u043d\u0435 \u0438\u043c\u0435\u0435\u043c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0432\u044b\u0431\u043e\u0440\u043e\u043a \u0438\u0437 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f, \u0430 \u044d\u0442\u043e \u043f\u043e\u0447\u0442\u0438 \u0432\u0441\u0435\u0433\u0434\u0430 \u0442\u0430\u043a. \u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c <b>m<\/b> \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432 \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u0439 \u0440\u0430\u0437\u043c\u0435\u0440\u0430 <b>n<\/b>, \u043d\u043e \u0443 \u043d\u0430\u0441 \u0432 \u0440\u0430\u0441\u043f\u043e\u0440\u044f\u0436\u0435\u043d\u0438\u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u043d\u043e \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0438\u0437 <b>n<\/b> \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u0439. \u0422\u043e\u0433\u0434\u0430 \u043c\u044b \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c <b>m<\/b> \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432 <a href=\"http:\/\/en.wikipedia.org\/wiki\/Uniform_distribution_(discrete)\">\u0440\u0430\u0432\u043d\u043e\u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044b\u043c <\/a>\u0432\u044b\u0431\u043e\u0440\u043e\u043c <b>n<\/b> \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0438\u0437 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0430 \u0441 \u0432\u043e\u0437\u0432\u0440\u0430\u0442\u043e\u043c \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 (<a href=\"http:\/\/ru.wikipedia.org\/wiki\/\u0420\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u0438\u0435\">\u0432\u044b\u0431\u043e\u0440\u043a\u0430 \u0441 \u043f\u043e\u0432\u0442\u043e\u0440\u0435\u043d\u0438\u0435\u043c \u0438\u043b\u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0435\u043d\u0438\u0435\u043c<\/a>). \u041f\u0440\u0438 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u0445 <b>n<\/b>, \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0433\u043e \u0431\u0443\u0442\u0441\u0442\u0440\u0435\u043f \u0441\u0435\u043c\u043f\u043b\u0438\u043d\u0433\u043e\u043c \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0430 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c <b>(1 \u2014 1\/e) \u2248 63.2%<\/b> \u043e\u0442 \u043e\u0431\u0449\u0435\u0433\u043e \u0447\u0438\u0441\u043b\u0430 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0445 \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u0439 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0430. \u041e\u0431\u043e\u0437\u043d\u0430\u0447\u0438\u043c <b>D<sup>i<\/sup><\/b> \u2014 <b>i<\/b>-\u043e\u0435 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0435 \u0431\u0443\u0442\u0441\u0442\u0440\u0435\u043f \u0441\u0435\u043c\u043f\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c, \u043c\u044b \u043e\u0446\u0435\u043d\u0438\u0432\u0430\u0435\u043c \u043d\u0430 \u043d\u0435\u043c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <b>a<sup>i<\/sup><\/b>, \u0438 \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0435\u043c \u044d\u0442\u0443 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0443 <b>m<\/b> \u0440\u0430\u0437. \u0421\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430 \u0431\u0443\u0442\u0441\u0442\u0440\u0435\u043f \u043e\u0446\u0435\u043d\u043a\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<br \/>  <img decoding=\"async\" src=\"\/\/habrastorage.org\/files\/f02\/be4\/dcd\/f02be4dcda024047846c8b511aa3e802.gif\"\/><br \/>  \u0418\u0442\u0430\u043a, <i>\u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0431\u0443\u0442\u0441\u0442\u0440\u0435\u043f<\/i> \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043e\u0446\u0435\u043d\u0438\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0443 \u043e\u0446\u0435\u043d\u043a\u0438 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f. \u041d\u043e \u044d\u0442\u043e \u0442\u0430\u043a \u043e\u0442\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u0435 \u043e\u0442 \u0442\u0435\u043c\u044b, \u043d\u0430\u043c \u0436\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0435\u043d \u043c\u0435\u0442\u043e\u0434 \u0431\u0443\u0442\u0441\u0442\u0440\u0435\u043f \u0441\u0435\u043c\u043f\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f.<\/p>\n<p>  \u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430\u0431\u043e\u0440 \u0438\u0437 <b>m<\/b> \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u044b\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 <b>x<\/b> \u0438\u0437 \u043e\u0434\u043d\u043e\u0433\u043e \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u043d\u043e\u0433\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f, \u0441 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u0435\u043c \u0438 \u0434\u0438\u0441\u043f\u0435\u0440\u0441\u0438\u0435\u0439 <b>\u03c3<sup>2<\/sup><\/b>. \u0422\u043e\u0433\u0434\u0430 \u0432\u044b\u0431\u043e\u0440\u043e\u0447\u043d\u043e\u0435 \u0441\u0440\u0435\u0434\u043d\u0435\u0435 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0432\u043d\u043e:<br \/>  <img decoding=\"async\" src=\"\/\/habrastorage.org\/files\/c89\/903\/d2b\/c89903d2b1d6474bb81e474d65f0dcf6.gif\"\/><br \/>  \u0412\u044b\u0431\u043e\u0440\u043e\u0447\u043d\u043e\u0435 \u0441\u0440\u0435\u0434\u043d\u0435\u0435 \u2014 \u044d\u0442\u043e \u043d\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f, \u0432 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 \u043c\u0430\u0442\u043e\u0436\u0438\u0434\u0430\u043d\u0438\u044f \u0438 \u0434\u0438\u0441\u043f\u0435\u0440\u0441\u0438\u0438, \u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043e\u0442 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445, \u0442.\u0435. \u0442\u043e\u0436\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439, \u0438\u0437 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u043d\u043e\u0433\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0432\u044b\u0431\u043e\u0440\u043e\u0447\u043d\u044b\u0445 \u0441\u0440\u0435\u0434\u043d\u0438\u0445. \u0410 \u043e\u043d\u043e \u0432 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u043e\u0431\u043b\u0430\u0434\u0430\u0435\u0442 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u043c \u0434\u0438\u0441\u043f\u0435\u0440\u0441\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b\u0440\u0430\u0436\u0430\u0435\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<br \/>  <img decoding=\"async\" src=\"\/\/habrastorage.org\/files\/36c\/f82\/92a\/36cf8292a30c4733995d4f4d5fdf1b0b.gif\"\/><br \/>  \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e <i>\u0443\u0441\u0440\u0435\u0434\u043d\u0435\u043d\u0438\u0435 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0443\u043c\u0435\u043d\u044c\u0448\u0430\u0435\u0442 \u0432\u0430\u0440\u0438\u0430\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u044c<\/i>. \u041d\u0430 \u044d\u0442\u043e\u043c \u0438 \u0441\u0442\u0440\u043e\u0438\u0442\u0441\u044f \u0438\u0434\u0435\u044f \u0430\u0433\u0440\u0435\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0431\u0443\u0442\u0441\u0442\u0440\u0435\u043f \u0432\u044b\u0431\u043e\u0440\u043e\u043a. \u0421\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c <b>m<\/b> \u0431\u0443\u0442\u0441\u0442\u0440\u0435\u043f \u0432\u044b\u0431\u043e\u0440\u043e\u043a \u0440\u0430\u0437\u043c\u0435\u0440\u0430 <b>n<\/b> \u0438\u0437 \u043e\u0431\u0443\u0447\u0430\u044e\u0449\u0435\u0433\u043e \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0430 <b>D<\/b> (\u0442\u043e\u0436\u0435 \u0440\u0430\u0437\u043c\u0435\u0440\u0430 <b>n<\/b>):<br \/>  <img decoding=\"async\" src=\"\/\/habrastorage.org\/files\/15b\/61a\/005\/15b61a0057bd49c482dd6510d1c7e7c8.gif\"\/><br \/>  \u041d\u0430 \u043a\u0430\u0436\u0434\u043e\u0439 \u0431\u0443\u0442\u0441\u0442\u0440\u0435\u043f \u0432\u044b\u0431\u043e\u0440\u043a\u0435 \u043e\u0431\u0443\u0447\u0438\u043c \u043c\u043e\u0434\u0435\u043b\u044c <b>f<\/b> \u0438 \u0432\u0432\u0435\u0434\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u0442\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u0438 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f bootstrap aggregating \u0438\u043b\u0438 bagging:<br \/>  <img decoding=\"async\" src=\"\/\/habrastorage.org\/files\/159\/839\/ccb\/159839ccb63c46eda5a1b3f88b499491.gif\"\/><br \/>  Bagging \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0438\u043b\u043b\u044e\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c <a href=\"http:\/\/en.wikipedia.org\/wiki\/Bootstrap_aggregating\">\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u0433\u0440\u0430\u0444\u0438\u043a\u043e\u043c \u0438\u0437 \u0432\u0438\u043a\u0438\u043f\u0435\u0434\u0438\u0438<\/a>, \u0433\u0434\u0435 bag-\u043c\u043e\u0434\u0435\u043b\u044c \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0430 \u043a\u0440\u0430\u0441\u043d\u043e\u0439 \u043b\u0438\u043d\u0438\u0435\u0439 \u0438 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0443\u0441\u0440\u0435\u0434\u043d\u0435\u043d\u0438\u0435\u043c \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0430 \u0434\u0440\u0443\u0433\u0438\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439.<br \/>  <img decoding=\"async\" src=\"\/\/habrastorage.org\/files\/c7b\/fe6\/1c1\/c7bfe61c116e430bb60c92a6cbd3027b.png\"\/><\/p>\n<h4>\u0414\u0435\u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u044f<\/h4>\n<p>  \u0414\u0443\u043c\u0430\u044e \u0443\u0436\u0435 \u043f\u043e\u043d\u044f\u0442\u043d\u043e \u043a\u0430\u043a \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u043e \u043b\u0435\u0441: \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0431\u0443\u0442\u0441\u0442\u0440\u0435\u043f \u0432\u044b\u0431\u043e\u0440\u043e\u043a \u0438 \u043e\u0431\u0443\u0447\u0438\u043c \u0434\u0435\u0440\u0435\u0432\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0439 \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u0439 \u0438\u0437 \u043d\u0438\u0445. \u041d\u043e \u0442\u0443\u0442 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0430\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430, \u043f\u043e\u0447\u0442\u0438 \u0432\u0441\u0435 \u0434\u0435\u0440\u0435\u0432\u044c\u044f \u0431\u0443\u0434\u0443\u0442 \u0431\u043e\u043b\u0435\u0435 \u0438\u043b\u0438 \u043c\u0435\u043d\u0435\u0435 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043c \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442, \u0432\u043e\u0437\u044c\u043c\u0435\u043c <a href=\"https:\/\/archive.ics.uci.edu\/ml\/datasets\/Breast+Cancer+Wisconsin+(Diagnostic)\">\u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0441 \u0434\u0432\u0443\u043c\u044f \u043a\u043b\u0430\u0441\u0441\u0430\u043c\u0438 \u0438 32-\u043c\u044f \u0444\u0438\u0447\u0430\u043c\u0438<\/a>, \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u043c 1000 \u0434\u0435\u0440\u0435\u0432\u044c\u0435\u0432 \u0440\u0435\u0448\u0435\u043d\u0438\u0439 \u043d\u0430 \u0431\u0443\u0442\u0441\u0442\u0440\u0435\u043f \u0441\u0435\u043c\u043f\u043b\u0430\u0445, \u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u0432\u0430\u0440\u0438\u0430\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u0435\u0434\u0438\u043a\u0430\u0442\u0430 \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u0433\u043e \u0443\u0437\u043b\u0430.<br \/>  <img decoding=\"async\" src=\"\/\/habrastorage.org\/files\/341\/f33\/4c3\/341f334c31284c5ebf00a85f0e3b2104.png\"\/><br \/>  \u041c\u044b \u0432\u0438\u0434\u0438\u043c \u0447\u0442\u043e \u0438\u0437 1000 \u0434\u0435\u0440\u0435\u0432\u044c\u0435\u0432 22-\u043e\u0439 \u043f\u0440\u0438\u0437\u043d\u0430\u043a (\u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0444\u0438\u0447\u0438 \u043e\u0434\u043d\u043e \u0438 \u0442\u043e\u0436\u0435) \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u0435\u0442\u0441\u044f \u0432 526 \u0434\u0435\u0440\u0435\u0432\u044c\u044f\u0445, \u0438 \u043f\u043e\u0447\u0442\u0438 \u0432\u043e \u0432\u0441\u0435\u0445 \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u0435 \u043d\u043e\u0434\u044b \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0435. \u0414\u0440\u0443\u0433\u0438\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438 \u0434\u0435\u0440\u0435\u0432\u044c\u044f <i>\u0441\u043a\u043e\u0440\u0440\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b<\/i> \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u0440\u0443\u0433 \u0434\u0440\u0443\u0433\u0430. \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u043d\u0435\u0442 \u0441\u043c\u044b\u0441\u043b\u0430 \u0441\u0442\u0440\u043e\u0438\u0442\u044c 1000 \u0434\u0435\u0440\u0435\u0432\u044c\u0435\u0432, \u0435\u0441\u043b\u0438 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0432\u0441\u0435\u0433\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445, \u0430 \u0447\u0430\u0449\u0435 \u0432\u0441\u0435\u0433\u043e \u043e\u0434\u043d\u043e\u0433\u043e \u0438\u043b\u0438 \u0434\u0432\u0443\u0445. \u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u043f\u0440\u0438 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0438 \u0434\u0435\u0440\u0435\u0432\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0438 \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u0438 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0443\u0437\u043b\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432 \u0438\u0437 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0430 \u0432\u0441\u0435\u0445 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432, \u0441\u043a\u0430\u0436\u0435\u043c 7 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0445 \u0438\u0437 32.<br \/>  <img decoding=\"async\" src=\"\/\/habrastorage.org\/files\/fbc\/f49\/5c9\/fbcf495c9b614ea3ad8ed30b2ab6c3ba.png\"\/><br \/>  \u041a\u0430\u043a \u0432\u0438\u0434\u0438\u0442\u0435, \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u043e\u0441\u044c \u0432 \u0441\u0442\u043e\u0440\u043e\u043d\u0443 \u0431\u043e\u043b\u044c\u0448\u0435\u0433\u043e \u0440\u0430\u0437\u043d\u043e\u043e\u0431\u0440\u0430\u0437\u0438\u044f \u0434\u0435\u0440\u0435\u0432\u044c\u0435\u0432 (\u043a\u0441\u0442\u0430\u0442\u0438 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u043c \u0443\u0437\u043b\u0435, \u043d\u043e \u0438 \u0432 \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u0445), \u0447\u0442\u043e \u0438 \u0431\u044b\u043b\u043e \u0446\u0435\u043b\u044c\u044e \u0442\u0430\u043a\u043e\u0433\u043e \u0442\u0440\u044e\u043a\u0430. \u0422\u0435\u043f\u0435\u0440\u044c 22 \u043f\u0440\u0438\u0437\u043d\u0430\u043a \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0432 158 \u0441\u043b\u0443\u0447\u0430\u044f\u0445. \u0412\u044b\u0431\u043e\u0440 &quot;<i>7 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0445 \u0438\u0437 32<\/i> \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432&quot; \u043e\u0431\u043e\u0441\u043d\u043e\u0432\u0430\u043d \u044d\u043c\u043f\u0438\u0440\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u0435\u043c (\u044f \u0442\u0430\u043a \u0438 \u043d\u0435 \u043d\u0430\u0448\u0435\u043b \u0430\u0432\u0442\u043e\u0440\u0430 \u044d\u0442\u043e\u0433\u043e \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u044f), \u0438 \u0432 \u0437\u0430\u0434\u0430\u0447\u0430\u0445 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u044d\u0442\u043e \u043a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u043d\u044b\u0439 \u043a\u043e\u0440\u0435\u043d\u044c \u0438\u0437 \u043e\u0431\u0449\u0435\u0433\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432. \u0414\u0440\u0443\u0433\u0438\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438 \u0434\u0435\u0440\u0435\u0432\u044c\u044f \u0441\u0442\u0430\u043b\u0438 \u043c\u0435\u043d\u0435\u0435 <i>\u0441\u043a\u043e\u0440\u0435\u043b\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438<\/i>, \u0430 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f <i>\u0434\u0435\u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u044f<\/i>.<\/p>\n<p>  \u0422\u0430\u043a\u043e\u0439 \u043c\u0435\u0442\u043e\u0434, \u0432 \u043e\u0431\u0449\u0435\u043c, \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f <a href=\"http:\/\/Random subspace method\">Random subspace method<\/a> \u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u0434\u0435\u0440\u0435\u0432\u044c\u0435\u0432 \u0440\u0435\u0448\u0435\u043d\u0438\u0439, \u043d\u043e \u0438 \u0434\u043b\u044f \u0434\u0440\u0443\u0433\u0438\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439, \u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a \u043d\u0435\u0439\u0440\u043e\u0441\u0435\u0442\u0438.<\/p>\n<p>  \u0412 \u043e\u0431\u0449\u0435\u043c \u043a\u0430\u043a \u0442\u043e \u0442\u0430\u043a.<br \/>  <img decoding=\"async\" src=\"\/\/habrastorage.org\/files\/157\/18b\/522\/15718b52265a44009c6a1c268fa648aa.jpg\"\/><\/p>\n<h4>\u041a\u043e\u0434<\/h4>\n<p>  \u041f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043a \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438. \u0415\u0449\u0435 \u0440\u0430\u0437 \u0445\u043e\u0447\u0443 \u043d\u0430\u043f\u043e\u043c\u043d\u0438\u0442\u044c, \u0447\u0442\u043e \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0439 \u043c\u043d\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0431\u044b\u0441\u0442\u0440\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439 random forest&#8217;\u0430, \u0430 \u043d\u043e\u0441\u0438\u0442 \u0443\u0447\u0435\u0431\u043d\u044b\u0439 \u043b\u0438\u0448\u044c \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440, \u043f\u0440\u0438\u0437\u0432\u0430\u043d\u043d\u043e\u0439 \u043f\u043e\u043c\u043e\u0447\u044c \u043f\u043e\u043d\u044f\u0442\u044c \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0438\u0434\u0435\u0438 \u043c\u043e\u0434\u0435\u043b\u0438. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 <a href=\"http:\/\/semanticsearchart.com\/downloads\/RF.txt\">\u0442\u0443\u0442 \u0432\u044b \u043d\u0430\u0439\u0434\u0435\u0442\u0435 \u043f\u0440\u0438\u043c\u0435\u0440 \u0433\u043e\u0434\u043d\u043e\u0439 \u0438 \u0448\u0443\u0441\u0442\u0440\u043e\u0439 \u0438\u043c\u043f\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438<\/a>, \u043d\u043e \u043a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e \u043c\u0435\u043d\u0435\u0435 \u043f\u043e\u043d\u044f\u0442\u043d\u043e\u0439.<\/p>\n<p>  \u041a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438 \u044f \u0431\u0443\u0434\u0443 \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u0442\u0430\u043c \u0433\u0434\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0440\u044f\u043c\u043e \u0432 \u043a\u043e\u0434\u0435, \u0447\u0442\u043e \u0431\u044b \u043d\u0435 \u0440\u0430\u0437\u0431\u0438\u0432\u0430\u0442\u044c \u043a\u043b\u0430\u0441\u0441\u044b \u043d\u0430 \u043a\u0443\u0441\u043a\u0438.  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041e\u0431\u044b\u0447\u043d\u043e\u0435 \u0434\u0435\u0440\u0435\u0432\u043e<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cs\">\/\/ \u043e\u0431\u044b\u0447\u043d\u043e\u0435 \u0442\u0435\u043c\u043f\u043b\u0435\u0439\u0442 \u0434\u0435\u0440\u0435\u0432\u043e, \u0445\u043e\u0442\u044f \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0434\u043b\u044f \u0431\u0438\u043d\u0430\u0440\u043d\u043e\u0433\u043e \u0434\u0435\u0440\u0435\u0432\u0430 \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0438 \u043f\u0440\u043e\u0449\u0435  public class TreeNode&lt;T&gt; {     public TreeNode()     {         Childs = new LinkedList&lt;TreeNode&lt;T&gt;&gt;();     }      public TreeNode(T data)     {         Data = data;         Childs = new LinkedList&lt;TreeNode&lt;T&gt;&gt;();     }      public TreeNode&lt;T&gt; Parent { get; set; }     public LinkedList&lt;TreeNode&lt;T&gt;&gt; Childs { get; set; }     public T Data { get; set; }      public virtual bool AddChild(T data)     {         TreeNode&lt;T&gt; node = new TreeNode&lt;T&gt;() {Data = data};         node.Parent = this;         Childs.AddLast(node);         return true;     }      public virtual bool AddChild(TreeNode&lt;T&gt; node)     {         node.Parent = this;         Childs.AddLast(node);         return true;     }      public bool IsLeaf     {         get         {             return Childs.Count == 0;         }     }      public int Depth     {         get         {             int d = 0;             TreeNode&lt;T&gt; node = this;             while (node.Parent != null)             {                 d++;                 node = node.Parent;             }             return d;         }     } } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0415\u0434\u0438\u043d\u0438\u0446\u0430 \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u044f \u0432 \u043c\u043e\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043a\u043b\u0430\u0441\u0441\u043e\u043c.  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">Observation<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cs\">public class DataItem&lt;T&gt; {      private T[] _input = null;     private T[] _output = null;       public DataItem()     {     }      public DataItem(T[] input, T[] output)     {         _input = input;         _output = output;     }      public T[] Input     {         get { return _input; }         set { _input = value; }     }      public T[] Output      {          get { return _output; }         set { _output = value; }     }  } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0414\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0443\u0437\u043b\u0430 \u0434\u0435\u0440\u0435\u0432\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u043f\u0440\u0435\u0434\u0438\u043a\u0430\u0442\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u043f\u0440\u0438\u043d\u044f\u0442\u0438\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043e \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438.  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0414\u0430\u043d\u043d\u044b\u0435 \u0443\u0437\u043b\u0430 \u0434\u0435\u0440\u0435\u0432\u0430<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cs\">public class ClassificationTreeNodeData {     \/\/ \u0432\u0435\u043a\u0442\u043e\u0440 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0435\u0439 &lt;id \u043a\u043b\u0430\u0441\u0441\u0430, \u0435\u0433\u043e \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c&gt;, \u0431\u0443\u0434\u0435\u043c \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0447\u0442\u043e \u043e\u043d \u043e\u0442\u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d \u043f\u043e \u0443\u0431\u044b\u0432\u0430\u043d\u0438\u044e \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0435\u0439     \/\/ \u044d\u0442\u043e \u0442\u043e \u0441\u0430\u043c\u043e\u0435 p \u0438\u0437 \u0432\u044b\u0448\u0435\u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0445 \u0444\u043e\u0440\u043c\u0443\u043b \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0440\u0430\u0437\u0434\u0435\u043b\u0430     internal IDictionary&lt;double, double&gt; Probabilities { get; set; }      \/\/ \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0443\u0437\u043b\u0430, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0431\u044b \u0440\u0430\u0437\u0431\u0438\u0435\u043d\u0438\u0435 \u043d\u0435 \u0431\u044b\u043b\u043e \u0434\u043e\u0440\u043e\u0436\u0435 \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u0438     \/\/ \u0447\u0443\u0442\u044c \u043d\u0438\u0436\u0435 \u043c\u044b \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043c \u044d\u0442\u043e \u043a\u0430\u043a \u043d\u043e\u0440\u043c\u0443 \u0432\u0435\u043a\u0442\u043e\u0440\u0430     internal double Cost { get; set; }      \/\/ \u043f\u0440\u0435\u0434\u0438\u043a\u0430\u0442 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u043f\u0440\u0438\u043d\u044f\u0442\u0438\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f, \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0438\u0437\u043b\u0438\u0448\u043d\u0438\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442,      \/\/ \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d \u0442\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0434\u0438 \u044d\u0441\u0442\u0435\u0442\u0438\u043a\u0438, \u0432\u0435\u0434\u044c \u043c\u044b \u043d\u0435 \u043f\u0440\u0435\u0441\u043b\u0435\u0434\u0443\u0435\u043c \u0446\u0435\u043b\u044c \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043e\u0447\u0435\u043d\u044c \u0431\u044b\u0441\u0442\u0440\u044b\u0439 \u0438 \u044d\u043a\u043e\u043d\u043e\u043c\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 -)     internal Predicate&lt;double[]&gt; Predicate { get; set; }      \/\/ \u0434\u0430\u043d\u043d\u044b\u0435 \u0430\u0441\u0441\u043e\u0446\u0438\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0441 \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u043d\u043e\u0434\u043e\u0439, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u0434\u0435\u0440\u0435\u0432\u0430     internal IList&lt;DataItem&lt;double&gt;&gt; DataSet { get; set; }      \/\/ \u0438\u043c\u044f \u043d\u043e\u0434\u044b, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u0435\u0440\u0435\u0432\u0430     internal string Name { get; set; }      \/\/ \u0438\u043d\u0434\u0435\u043a\u0441 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u0438\u043d\u0438\u043c\u0438\u0437\u0438\u0440\u0443\u0435\u0442 \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c \u043f\u0440\u0438 \u0440\u0430\u0437\u0431\u0438\u0435\u043d\u0438\u0438     internal int FeatureIndex { get; set; }      \/\/ \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u043e\u0440\u043e\u0433\u0430 \u0438\u0437 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0430     internal double FeatureValue { get; set; }      \/\/ \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0434\u0432\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043d\u0443\u0436\u043d\u044b \u0438\u0437\u0437\u0430 \u0442\u043e\u0433\u043e \u0447\u0442\u043e \u0434\u043e\u0442\u043d\u0435\u0442 \u043d\u0435 \u0445\u043e\u0447\u0435\u0442 \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0437\u0430\u043c\u044b\u043a\u0430\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u0435\u0434\u0438\u043a\u0430\u0442     [OnSerializing]     private void OnSerializing(StreamingContext context)     {         Predicate = null;     }      [OnDeserialized]     [OnSerialized]     private void OnDeserialized(StreamingContext context)     {         Predicate = v =&gt; v[FeatureIndex] &lt; FeatureValue;     }  } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043a\u043b\u0430\u0441\u0441 \u0431\u0438\u043d\u0430\u0440\u043d\u043e\u0433\u043e \u0440\u0435\u0448\u0430\u044e\u0449\u0435\u0433\u043e \u0434\u0435\u0440\u0435\u0432\u0430.  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0411\u0438\u043d\u0430\u0440\u043d\u043e\u0435 \u0440\u0435\u0448\u0430\u044e\u0449\u0435\u0435 \u0434\u0435\u0440\u0435\u0432\u043e<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cs\">public class ClassificationBinaryTree {     private TreeNode&lt;ClassificationTreeNodeData&gt; _rootNode = null;     private INorm&lt;double&gt; _norm = null;     \/\/ \u043d\u043e\u0440\u043c\u0430 \u0432\u0435\u043a\u0442\u043e\u0440\u0430 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0435\u0439      private int _minLeafDataCount = 1;    \/\/ \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u043d\u0430\u0431\u043e\u0440\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0439 \u043d\u043e\u0434\u044b     private int[] _trainingFeaturesSubset = null;    \/\/ \u043f\u043e\u0434\u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0444\u0438\u0447\u044c \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u0443\u0447\u0430\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0432 \u0441\u043f\u043b\u0438\u0442\u0442\u0438\u043d\u0433\u0435 \u0443\u0437\u043b\u0430      private int _randomSubsetSize = 0;    \/\/ \u0440\u0430\u0437\u043c\u0435\u0440 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c\u044b\u0445 \u0444\u0438\u0447, \u043a\u0430\u043a \u043a\u0430\u043d\u0434\u0438\u0434\u0430\u0442\u043e\u0432 \u043f\u0440\u0438 \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u0438 \u043d\u043e\u0434\u044b     private Random _random = null;     private double _maxProbability = 0;     \/\/ \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u0430\u044f \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u043a\u043b\u0430\u0441\u0441\u0430, \u043f\u043e\u0441\u043b\u0435 \u0434\u043e\u0441\u0442\u0438\u0436\u0435\u043d\u0438\u044f \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043d\u043e\u0434\u044b \u043d\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442     private int _maxDepth = Int32.MaxValue;     \/\/ \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u0430\u044f \u0433\u043b\u0443\u0431\u0438\u043d\u0430 \u043d\u043e\u0434\u044b     private bool _showLog = false;     private int _featuresCount = 0;       public ClassificationBinaryTree(INorm&lt;double&gt; norm, int minLeafDataCount, int[] trainingFeaturesSubset = null,          int randomSubsetSize = 0, double maxProbability = 0.95, int maxDepth = Int32.MaxValue,         bool showLog = false)     {         _norm = norm;         _minLeafDataCount = minLeafDataCount;         _trainingFeaturesSubset = trainingFeaturesSubset;         _randomSubsetSize = randomSubsetSize;         _maxProbability = maxProbability;         _maxDepth = maxDepth;         _showLog = showLog;     }      public TreeNode&lt;ClassificationTreeNodeData&gt; RootNode     {         get         {             return _rootNode;         }     }      \/\/ \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 \u0434\u0435\u0440\u0435\u0432\u0430     public void Train(IList&lt;DataItem&lt;double&gt;&gt; data)     {         _featuresCount = data.First().Input.Length;         if (_randomSubsetSize &gt; 0)         {             _random = new Random(Helper.GetSeed());         }         IDictionary&lt;double, double&gt; rootProbs = ComputeLabelsProbabilities(data);         _rootNode = new TreeNode&lt;ClassificationTreeNodeData&gt;(new ClassificationTreeNodeData()         {             DataSet = data,             Probabilities = rootProbs,             Cost = _norm.Calculate(rootProbs.Select(x =&gt; x.Value).ToArray())         });                                     \/\/ \u043d\u0435 \u043b\u044e\u0431\u043b\u044e \u0440\u0435\u043a\u0443\u0440\u0441\u0438\u0438            Queue&lt;TreeNode&lt;ClassificationTreeNodeData&gt;&gt; queue = new Queue&lt;TreeNode&lt;ClassificationTreeNodeData&gt;&gt;();         queue.Enqueue(_rootNode);         while (queue.Count &gt; 0)         {             if (_showLog)             {                 Logger.Instance.Log(&quot;Tree training: queue size is &quot; + queue.Count);             }             TreeNode&lt;ClassificationTreeNodeData&gt; node = queue.Dequeue();             int sourceCount = node.Data.DataSet.Count;                          \/\/ \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043d\u043e\u0434\u044b             TrainNode(node, node.Data.DataSet, _trainingFeaturesSubset, _randomSubsetSize);             if (_showLog && node.Childs.Count() &gt; 0)             {                 Logger.Instance.Log(&quot;Tree training: source &quot; + sourceCount + &quot; is splitted into &quot; +                                 node.Childs.First().Data.DataSet.Count + &quot; and &quot; +                                 node.Childs.Last().Data.DataSet.Count);             }              \/\/ \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0438 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0435\u043d\u0438\u0435 \u0440\u043e\u0441\u0442\u0430 \u0434\u0435\u0440\u0435\u0432\u0430             foreach (TreeNode&lt;ClassificationTreeNodeData&gt; child in node.Childs)             {                 if (child.Data.Probabilities.Count == 1 ||                      child.Data.DataSet.Count &lt;= _minLeafDataCount ||                     child.Data.Probabilities.First().Value &gt; _maxProbability ||                     child.Depth &gt;= _maxDepth)                 {                     child.Data.DataSet = null;                     continue;                 }                 queue.Enqueue(child);             }         }       }      \/\/ \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043d\u043e\u0434\u044b     private void TrainNode(TreeNode&lt;ClassificationTreeNodeData&gt; node, IList&lt;DataItem&lt;double&gt;&gt; data, int[] featuresSubset, int randomSubsetSize)     {         \/\/ argmin \u043d\u043e\u0440\u043c\u044b         double minCost = node.Data.Cost;         int idx = -1;         double threshold = 0;         IDictionary&lt;double, double&gt; minLeftProbs = null;         IDictionary&lt;double, double&gt; minRightProbs = null;         IList&lt;DataItem&lt;double&gt;&gt; minLeft = null;         IList&lt;DataItem&lt;double&gt;&gt; minRight = null;         double minLeftCost = 0;         double minRightCost = 0;          \/\/ \u0435\u0441\u043b\u0438 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0435 \u043f\u043e\u0434\u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0444\u0438\u0447, \u0442\u043e \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435         if (randomSubsetSize &gt; 0)         {             featuresSubset = new int[randomSubsetSize];             IList&lt;int&gt; candidates = new List&lt;int&gt;();             for (int i = 0; i &lt; _featuresCount; i++)             {                 candidates.Add(i);             }             for (int i = 0; i &lt; randomSubsetSize; i++)             {                 int idxRandom = _random.Next(0, candidates.Count);                 featuresSubset[i] = candidates[idxRandom];                 candidates.RemoveAt(idxRandom);             }         }         else if (featuresSubset == null)         {             featuresSubset = new int[data.First().Input.Length];             for (int i = 0; i &lt; data.First().Input.Length; i++)             {                 featuresSubset[i] = i;             }         }          \/\/ \u043f\u0440\u043e\u0431\u0435\u0433\u0430\u0435\u043c\u0441\u044f \u043f\u043e \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u044b\u043c \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0430\u043c         foreach (int i in featuresSubset)         {             IList&lt;double&gt; domain = data.Select(x =&gt; x.Input[i]).Distinct().ToList();                          \/\/ \u0438 \u0438\u0449\u0435\u043c \u043f\u043e\u0440\u043e\u0433 \u0434\u043b\u044f \u043c\u0438\u043d\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u0438 \u0440\u0430\u0437\u0431\u0438\u0435\u043d\u0438\u044f             foreach (double t in domain)             {                 IList&lt;DataItem&lt;double&gt;&gt; left = new List&lt;DataItem&lt;double&gt;&gt;(); \/\/ \u043f\u043e\u0434\u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043e\u0431\u0443\u0447\u0430\u044e\u0449\u0435\u0433\u043e \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0430 \u043b\u0435\u0432\u043e\u0433\u043e \u043f\u043e\u0442\u043e\u043c\u043a\u0430                 IList&lt;DataItem&lt;double&gt;&gt; right = new List&lt;DataItem&lt;double&gt;&gt;(); \/\/ \u043d\u0443 \u0438 \u043f\u0440\u0430\u0432\u043e\u0433\u043e                 IDictionary&lt;double, double&gt; leftProbs = new Dictionary&lt;double, double&gt;(); \/\/ \u0432\u0435\u043a\u0442\u043e\u0440 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0435\u0439 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u0432 \u043f\u043e\u0434\u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0435                 IDictionary&lt;double, double&gt; rightProbs = new Dictionary&lt;double, double&gt;();                 foreach (DataItem&lt;double&gt; di in data)                 {                     if (di.Input[i] &lt; t)                     {                         left.Add(di);                         if (!leftProbs.ContainsKey(di.Output[0]))                         {                             leftProbs.Add(di.Output[0], 0);                         }                         leftProbs[di.Output[0]]++;                     }                     else                     {                         right.Add(di);                         if (!rightProbs.ContainsKey(di.Output[0]))                         {                             rightProbs.Add(di.Output[0], 0);                         }                         rightProbs[di.Output[0]]++;                     }                 }                 if (right.Count == 0 || left.Count == 0)                 {                     continue;                 }                  \/\/ \u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0435\u0439                  leftProbs = leftProbs.ToDictionary(x =&gt; x.Key, x =&gt; x.Value\/left.Count);                 rightProbs = rightProbs.ToDictionary(x =&gt; x.Key, x =&gt; x.Value\/right.Count);                 double leftCost = _norm.Calculate(leftProbs.Select(x =&gt; x.Value).ToArray());    \/\/ \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u0438 \u0440\u0430\u0437\u0431\u0438\u0435\u043d\u0438\u044f                                            double rightCost = _norm.Calculate(rightProbs.Select(x =&gt; x.Value).ToArray());                 double avgCost = (leftCost + rightCost)\/2;    \/\/ \u0441\u0440\u0435\u0434\u043d\u044f\u044f \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c \u0440\u0430\u0437\u0431\u0438\u0435\u043d\u0438\u044f                 if (avgCost &lt; minCost)                 {                     minCost = avgCost;                     idx = i;                     threshold = t;                     minLeftProbs = leftProbs;                     minRightProbs = rightProbs;                     minLeft = left;                     minRight = right;                     minLeftCost = leftCost;                     minRightCost = rightCost;                 }             }         }          \/\/ \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u043d\u043e\u0434\u044b \u0438 \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043f\u043e\u0442\u043e\u043c\u043a\u043e\u0432         node.Data.DataSet = null;         if (idx != -1)         {             \/\/node should be splitted             node.Data.Predicate = v =&gt; v[idx] &lt; threshold;    \/\/ \u043f\u0440\u0435\u0434\u0438\u043a\u0430\u0442 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u0440\u0438 \u043f\u0440\u0438\u043d\u044f\u0442\u0438\u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u0439             node.Data.Name = &quot;x[&quot; + idx + &quot;] &lt; &quot; + threshold;             node.Data.Probabilities = null;             node.Data.FeatureIndex = idx;             node.Data.FeatureValue = threshold;             node.AddChild(new ClassificationTreeNodeData()             {                 Probabilities = minLeftProbs.OrderByDescending(x =&gt; x.Value).ToDictionary(x =&gt; x.Key, x =&gt; x.Value),                 DataSet = minLeft,                 Cost = minLeftCost             });             node.AddChild(new ClassificationTreeNodeData()             {                 Probabilities = minRightProbs.OrderByDescending(x =&gt; x.Value).ToDictionary(x =&gt; x.Key, x =&gt; x.Value),                 DataSet = minRight,                 Cost = minRightCost             });         }     }      \/\/ \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0435\u0439 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u0432 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0435, \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438     private IDictionary&lt;double, double&gt; ComputeLabelsProbabilities(IList&lt;DataItem&lt;double&gt;&gt; data)     {         IDictionary&lt;double, double&gt; p = new Dictionary&lt;double, double&gt;();         double denominator = data.Count;         foreach (double label in data.Select(x =&gt; x.Output[0]).Distinct())         {             p.Add(label, data.Where(x =&gt; x.Output[0] == label).Count() \/ denominator);         }         return p;     }      \/\/ \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f \u0432\u0445\u043e\u0436\u043d\u043e\u0433\u043e \u043e\u0431\u0440\u0430\u0437\u0430     public IDictionary&lt;double, double&gt; Classify(double[] v)     {         TreeNode&lt;ClassificationTreeNodeData&gt; node = _rootNode;         while (!node.IsLeaf)         {             node = node.Data.Predicate(v) ? node.Childs.First() : node.Childs.Last();         }         return node.Data.Probabilities;     }      \/\/ \u0437\u0430\u043f\u0438\u0441\u044c \u0434\u0435\u0440\u0435\u0432\u0430 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 GraphVis http:\/\/www.graphviz.org\/     public void WriteDotFile(StreamWriter sw, bool separateTerminalNode = false)     {         sw.WriteLine(&quot;digraph G{&quot;);         sw.WriteLine(&quot;graph [ordering=\\&quot;out\\&quot;];&quot;);         Queue&lt;TreeNode&lt;ClassificationTreeNodeData&gt;&gt; q = new Queue&lt;TreeNode&lt;ClassificationTreeNodeData&gt;&gt;();         q.Enqueue(_rootNode);         int terminalCount = 0;         ISet&lt;string&gt; styles = new HashSet&lt;string&gt;();         while (q.Count &gt; 0)         {             TreeNode&lt;ClassificationTreeNodeData&gt; node = q.Dequeue();             foreach (TreeNode&lt;ClassificationTreeNodeData&gt; child in node.Childs)             {                 string childName = child.Data.Name;                 if (String.IsNullOrEmpty(childName))                 {                     if (separateTerminalNode)                     {                         childName = &quot;TNode #&quot; + terminalCount + &quot;; Class: &quot; + child.Data.Probabilities.First().Key;                     }                     else                     {                         childName = &quot;Class: &quot; + child.Data.Probabilities.First().Key;                     }                     styles.Add(&quot;\\&quot;&quot; + childName + &quot;\\&quot; [&quot; +                                 &quot;color=red, style=filled&quot; +                                 &quot;];&quot;);                     terminalCount++;                 }                 sw.WriteLine(&quot;\\&quot;&quot; + node.Data.Name + &quot;\\&quot; -&gt; &quot; + &quot;\\&quot;&quot; + childName + &quot;\\&quot;;&quot;);                 q.Enqueue(child);             }         }         foreach (string style in styles)         {             sw.WriteLine(style);         }         sw.WriteLine(&quot;}&quot;);     }  } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u041e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c\u0441\u044f \u043d\u0430 <a href=\"http:\/\/en.wikipedia.org\/wiki\/Norm_(mathematics)\">\u043d\u043e\u0440\u043c\u0435<\/a>, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u043e\u0439 \u0432 \u043a\u043b\u0430\u0441\u0441\u0435 \u0440\u0435\u0448\u0430\u044e\u0449\u0435\u0433\u043e \u0434\u0435\u0440\u0435\u0432\u0430.  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0418\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u043d\u043e\u0440\u043c\u044b<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cs\">public interface INorm&lt;T&gt; {     double Calculate(T[] v); } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0418\u043d\u0434\u0435\u043a\u0441 Gini<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cs\">internal class GiniIndex : INorm&lt;double&gt; {     #region INorm&lt;double&gt; Members      public double Calculate(double[] v)     {         return v.Sum(p =&gt; p*(1 - p));     }      #endregion } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u0435\u0440\u0435\u043a\u0440\u0435\u0441\u0442\u043d\u0430\u044f \u044d\u043d\u0442\u0440\u043e\u043f\u0438\u044f<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cs\">internal class MetricsBasedNorm&lt;T&gt; : INorm&lt;T&gt; {      private IMetrics&lt;T&gt; _m = null;       internal MetricsBasedNorm(IMetrics&lt;T&gt; m)     {         _m = m;     }      #region INorm&lt;T&gt; Members      public double Calculate(T[] v)     {         return _m.Calculate(v, v);     }      #endregion }  public interface IMetrics&lt;T&gt; {     \/\/\/ &lt;summary&gt;     \/\/\/ Calculate value of metrics     \/\/\/ &lt;\/summary&gt;     double Calculate(T[] v1, T[] v2);      \/\/\/ &lt;summary&gt;     \/\/\/ Get centroid\/clusteroid of data     \/\/\/ &lt;\/summary&gt;     T[] GetCentroid(IList&lt;T[]&gt; data);      \/\/\/ &lt;summary&gt;     \/\/\/ Calculate value of partial derivative by v2[v2Index]     \/\/\/ &lt;\/summary&gt;     T CalculatePartialDerivaitveByV2Index(T[] v1, T[] v2, int v2Index); }  internal class CrossEntropy : MetricsBase&lt;double&gt; {      internal CrossEntropy()     {     }      \/\/\/ &lt;summary&gt;     \/\/\/ \\sum_i v1_i * ln(v2_i)     \/\/\/ &lt;\/summary&gt;     public override double Calculate(double[] v1, double[] v2)     {         if (v1.Length != v2.Length)         {             throw new ArgumentException(&quot;Length of v1 and v2 should be equal&quot;);         }         if (v1.Length == 0 || v2.Length == 0)         {             throw new ArgumentException(&quot;Vector dimension can't be 0&quot;);         }         double d = 0;         for (int i = 0; i &lt; v1.Length; i++)         {             d += v1[i]*Math.Log(v2[i] + Double.Epsilon);         }         return -d;     }      public override double CalculatePartialDerivaitveByV2Index(double[] v1, double[] v2, int v2Index)     {         return v2[v2Index] - v1[v2Index];     } } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u041d\u0443 \u0438 \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0430\u043c \u043a\u043b\u0430\u0441\u0441 random forest.  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">Random Forest<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cs\">public class ClassificationRandomForest {     \/\/ \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043f\u043e\u0447\u0442\u0438 \u0442\u0435 \u0436\u0435 \u0441\u0430\u043c\u044b\u0435, \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0441\u044f \u043e\u0434\u0438\u043d     private INorm&lt;double&gt; _norm = null;     private int _minLeafDataCount = 1;     private int[] _trainingFeaturesSubset = null;     private int _randomSubsetSize = 0; \/\/zero if all features needed     private double _maxProbability = 0;     private int _maxDepth = Int32.MaxValue;     private bool _showLog = false;     private int _forestSize = 0;    \/\/ \u0440\u0430\u0437\u043c\u0435\u0440 \u043b\u0435\u0441\u0430     private ConcurrentBag&lt;ClassificationBinaryTree&gt; _trees = null;       public ClassificationRandomForest(INorm&lt;double&gt; norm, int forestSize, int minLeafDataCount, int[] trainingFeaturesSubset = null,          int randomSubsetSize = 0, double maxProbability = 0.95, int maxDepth = Int32.MaxValue,         bool showLog = false)     {         _norm = norm;         _minLeafDataCount = minLeafDataCount;         _trainingFeaturesSubset = trainingFeaturesSubset;         _randomSubsetSize = randomSubsetSize;         _maxProbability = maxProbability;         _maxDepth = maxDepth;         _forestSize = forestSize;         _showLog = showLog;     }      public void Train(IList&lt;DataItem&lt;double&gt;&gt; data)     {         if (_showLog)         {             Logger.Instance.Log(&quot;Training is started&quot;);         }          \/\/ \u0433\u0440\u0435\u0445 \u043d\u0435 \u0440\u0430\u0441\u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u0438\u0442\u044c \u0442\u0430\u043a\u043e\u0435 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435, \u0447\u0442\u043e \u0431\u044b \u043a\u0430\u0436\u0434\u043e\u0435 \u0434\u0435\u0440\u0435\u0432\u043e \u0440\u043e\u0441\u043b\u043e \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e         _trees = new ConcurrentBag&lt;ClassificationBinaryTree&gt;();         Parallel.For(0, _forestSize, i =&gt;         {             ClassificationBinaryTree ct = new ClassificationBinaryTree(                 _norm,                 _minLeafDataCount,                 _trainingFeaturesSubset,                 _randomSubsetSize,                 _maxProbability,                 _maxDepth,                 false                 );             ct.Train(BasicStatFunctions.Sample(data, data.Count, true));             _trees.Add(ct);             if (_showLog)             {                 Logger.Instance.Log(&quot;Training of tree #&quot; + _trees.Count + &quot; is completed!&quot;);             }         });     }      \/\/ \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f, \u043f\u043e \u0441\u0443\u0442\u0438 \u044d\u0442\u043e \u0438 \u0435\u0441\u0442\u044c bagging     public IDictionary&lt;double, double&gt; Classify(double[] v)     {         IDictionary&lt;double, double&gt; p = new Dictionary&lt;double, double&gt;();         foreach (ClassificationBinaryTree ct in _trees)         {             IDictionary&lt;double, double&gt; tr = ct.Classify(v);             double winClass = tr.First().Key;             if (!p.ContainsKey(winClass))             {                 p.Add(winClass, 0);             }             p[winClass]++;         }         double denominator = p.Sum(x =&gt; x.Value);         return             p.ToDictionary(x =&gt; x.Key, x =&gt; x.Value\/denominator)                 .OrderByDescending(x =&gt; x.Value)                 .ToDictionary(x =&gt; x.Key, x =&gt; x.Value);     }      public IList&lt;ClassificationBinaryTree&gt; Forest     {         get         {             return _trees.ToList();         }     } } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<h4>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0438 \u0441\u0441\u044b\u043b\u043a\u0438<\/h4>\n<p>  \u0415\u0441\u043b\u0438 \u0432\u044b \u0441\u043c\u043e\u0442\u0440\u0435\u043b\u0438 \u0432 \u043a\u043e\u0434, \u0442\u043e \u043c\u043e\u0433\u043b\u0438 \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0432 \u0434\u0435\u0440\u0435\u0432\u0435 \u0435\u0441\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0434\u043b\u044f \u0437\u0430\u043f\u0438\u0441\u0438 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0438 \u0443\u0441\u043b\u043e\u0432\u0438\u0439 \u0432 <a href=\"http:\/\/www.graphviz.org\/\">dot \u0444\u043e\u0440\u043c\u0430\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043e\u0439 GraphVis<\/a>. \u0415\u0441\u043b\u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0439 \u043b\u0435\u0441 \u0441\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438 <a href=\"https:\/\/archive.ics.uci.edu\/ml\/datasets\/Breast+Cancer+Wisconsin+(Diagnostic)\">\u043d\u0430 \u0432\u044b\u0448\u0435\u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u043e\u043c \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0435<\/a>:<\/p>\n<pre><code class=\"cs\">ClassificationRandomForest crf = new ClassificationRandomForest(         NormCreator.CreateByMetrics(MetricsCreator.CrossEntropy()),         10,         1,         null,         Convert.ToInt32(Math.Round(Math.Sqrt(ds.TrainSet.First().Input.Length))),         0.95,         1000,         true     ); crf.Train(ds.TrainSet); <\/code><\/pre>\n<p>  \u0422\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434 \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u043c \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u043b\u0435\u0441:  <\/p>\n<pre><code class=\"cs\">foreach (ClassificationBinaryTree tree in crf.Forest) {     using (StreamWriter sw = new StreamWriter(@&quot;e:\\Neuroximator\\NetworkTrainingOCR\\TreeTestData\\Forest\\&quot; +             (new DirectoryInfo(@&quot;e:\\Neuroximator\\NetworkTrainingOCR\\TreeTestData\\Forest\\&quot;)).GetFiles().Count()         + &quot;.dot&quot;))     {         tree.WriteDotFile(sw);         sw.Close();     } } <\/code><\/pre>\n<pre><code class=\"bash\">dot.exe -Tpng &quot;tree.dot&quot; -o &quot;tree.png&quot; <\/code><\/pre>\n<p>  \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0433\u043b\u044f\u043d\u0435\u043c \u043d\u0430 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0437 \u043d\u0438\u0445, \u043e\u043d\u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u044e\u0442\u0441\u044f \u0441\u043e\u0432\u0441\u0435\u043c \u0440\u0430\u0437\u043d\u044b\u0435 \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0434\u0435\u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u0438.  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0420\u0430\u0437<\/b><\/p>\n<div class=\"spoiler_text\"><img decoding=\"async\" src=\"\/\/habrastorage.org\/files\/b4e\/c85\/364\/b4ec853641a047c183e3ba5113f60755.png\"\/>  <\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0414\u0432\u0430<\/b><\/p>\n<div class=\"spoiler_text\"><img decoding=\"async\" src=\"\/\/habrastorage.org\/files\/7ed\/02e\/f75\/7ed02ef7507642f2858406758e585d4c.png\"\/>  <\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0422\u0440\u0438<\/b><\/p>\n<div class=\"spoiler_text\"><img decoding=\"async\" src=\"\/\/habrastorage.org\/files\/629\/7df\/2b0\/6297df2b02d04f44a10810740d4c94c5.png\"\/>  <\/div>\n<\/div>\n<p>  \u041d\u0443 \u0438 \u043d\u0430\u043f\u043e\u0441\u043b\u0435\u0434\u043e\u043a \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0445 \u0441\u0441\u044b\u043b\u043e\u043a:  <\/p>\n<ul>\n<li> <a href=\"http:\/\/www-bcf.usc.edu\/~gareth\/ISL\/\">An Introduction to Statistical Learning<\/a><\/li>\n<li> <a href=\"http:\/\/semanticsearchart.com\/downloads\/RF.txt\">C# Elementary DEMO of Random Forest<\/a><\/li>\n<\/ul>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/215453\/\"> http:\/\/habrahabr.ru\/post\/215453\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">   \t<img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/e7a\/aad\/06b\/e7aaad06bdbca9cc09f6400df3e63fd3.jpg\" align=\"right\" width=\"320\"\/> \u0414\u043e\u0431\u0440\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0441\u0443\u0442\u043e\u043a, \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044c. <a href=\"http:\/\/en.wikipedia.org\/wiki\/Random_forest\">Random Forest<\/a> \u0441\u0435\u0433\u043e\u0434\u043d\u044f \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0434\u043d\u0438\u043c \u0438\u0437 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u0435\u0439\u0448\u0438\u0445 \u0438 \u043a\u0440\u0430\u0439\u043d\u0435 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u0447 \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f, \u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f \u0438 \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u044f. \u041f\u043e \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438 \u043e\u043d \u043a\u043e\u043d\u043a\u0443\u0440\u0438\u0440\u0443\u0435\u0442 \u0441 \u043c\u0430\u0448\u0438\u043d\u0430\u043c\u0438 \u043e\u043f\u043e\u0440\u043d\u044b\u0445 \u0432\u0435\u043a\u0442\u043e\u0440\u043e\u0432, \u043d\u0435\u0439\u0440\u043e\u043d\u043d\u044b\u043c\u0438 \u0441\u0435\u0442\u044f\u043c\u0438 \u0438 \u0431\u0443\u0441\u0442\u0438\u043d\u0433\u043e\u043c, \u0445\u043e\u0442\u044f \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u043d\u0435 \u043b\u0438\u0448\u0435\u043d \u0441\u0432\u043e\u0438\u0445 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u043e\u0432. \u0421 \u0432\u0438\u0434\u0443 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u043a\u0440\u0430\u0439\u043d\u0435 \u043f\u0440\u043e\u0441\u0442 (\u0432 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0438 \u0441\u043a\u0430\u0436\u0435\u043c \u0441 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u043c \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u043c\u0430\u0448\u0438\u043d\u044b \u043e\u043f\u043e\u0440\u043d\u044b\u0445 \u0432\u0435\u043a\u0442\u043e\u0440\u043e\u0432, \u043a\u043e\u043c\u0443 \u043c\u0430\u043b\u043e \u043e\u0441\u0442\u0440\u044b\u0445 \u043e\u0449\u0443\u0449\u0435\u043d\u0438\u0439 \u0432 \u0436\u0438\u0437\u043d\u0438, \u043a\u0440\u0430\u0439\u043d\u0435 \u0441\u043e\u0432\u0435\u0442\u0443\u044e \u0437\u0430\u043d\u044f\u0442\u044c\u0441\u044f \u044d\u0442\u0438\u043c \u043d\u0430 \u0434\u043e\u0441\u0443\u0433\u0435). \u041c\u044b \u0436\u0435 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0432 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0439 \u0444\u043e\u0440\u043c\u0435 \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u0438\u0434\u0435\u044f\u0445, \u0437\u0430\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0445 \u0432 Random Forest (\u0431\u0438\u043d\u0430\u0440\u043d\u043e\u0435 \u0434\u0435\u0440\u0435\u0432\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0439, \u0431\u0443\u0442\u0441\u0442\u0440\u0435\u043f \u0430\u0433\u0433\u0440\u0435\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0438\u043b\u0438 \u0431\u044d\u0433\u0433\u0438\u043d\u0433, \u043c\u0435\u0442\u043e\u0434 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0445 \u043f\u043e\u0434\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432 \u0438 \u0434\u0435\u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u044f) \u0438 \u043f\u043e\u043d\u044f\u0442\u044c \u043f\u043e\u0447\u0435\u043c\u0443 \u0432\u0441\u0435 \u044d\u0442\u043e \u0432\u043c\u0435\u0441\u0442\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442. \u041c\u043e\u0434\u0435\u043b\u044c \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u0432\u043e\u0438\u0445 \u043a\u043e\u043d\u043a\u0443\u0440\u0435\u043d\u0442\u043e\u0432 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0442\u0430\u043a\u0438 \u043c\u043e\u043b\u043e\u0434\u0430\u044f: \u043d\u0430\u0447\u0430\u043b\u043e\u0441\u044c \u0432\u0441\u0435 \u0441\u043e <a href=\"http:\/\/www.cis.jhu.edu\/publications\/papers_in_database\/GEMAN\/shape.pdf\">\u0441\u0442\u0430\u0442\u044c\u0438 1997 \u0433\u043e\u0434\u0430<\/a> \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0430\u0432\u0442\u043e\u0440\u044b \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u043b\u0438 \u0441\u043f\u043e\u0441\u043e\u0431 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u043e\u0434\u043d\u043e\u0433\u043e \u0434\u0435\u0440\u0435\u0432\u0430 \u0440\u0435\u0448\u0435\u043d\u0438\u0439, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043c\u0435\u0442\u043e\u0434 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0445 \u043f\u043e\u0434\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432 \u043f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u043d\u043e\u0432\u044b\u0445 \u0443\u0437\u043b\u043e\u0432 \u0434\u0435\u0440\u0435\u0432\u0430; \u0437\u0430\u0442\u0435\u043c \u0431\u044b\u043b \u0440\u044f\u0434 \u0441\u0442\u0430\u0442\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u043b\u0441\u044f <a href=\"http:\/\/stat-www.berkeley.edu\/users\/breiman\/RandomForests\/cc_home.htm\">\u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0435\u0439 \u043a\u0430\u043d\u043e\u043d\u0438\u0447\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u0432 2001 \u0433\u043e\u0434\u0443<\/a>, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0441\u0442\u0440\u043e\u0438\u0442\u0441\u044f \u0430\u043d\u0441\u0430\u043c\u0431\u043b\u044c \u0440\u0435\u0448\u0430\u044e\u0449\u0438\u0445 \u0434\u0435\u0440\u0435\u0432\u044c\u0435\u0432 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0431\u0443\u0442\u0441\u0442\u0440\u0435\u043f \u0430\u0433\u0440\u0435\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0438\u043b\u0438 \u0431\u044d\u0433\u0433\u0438\u043d\u0433\u0430. \u0412 \u043a\u043e\u043d\u0446\u0435 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d \u043f\u0440\u043e\u0441\u0442\u043e\u0439, \u0441\u043e\u0432\u0441\u0435\u043c \u043d\u0435 \u0448\u0443\u0441\u0442\u0440\u044b\u0439, \u043d\u043e \u043a\u0440\u0430\u0439\u043d\u0435 \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u044d\u0442\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \u043d\u0430 c#, \u0430 \u0442\u0430\u043a \u0436\u0435 \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043d \u0440\u044f\u0434 \u0442\u0435\u0441\u0442\u043e\u0432. \u041a\u0441\u0442\u0430\u0442\u0438 \u043d\u0430 <a href=\"http:\/\/tainy.net\/3598-zagadka-tancuyushhego-lesa.html\">\u0444\u043e\u0442\u043a\u0435 \u0441\u043f\u0440\u0430\u0432\u0430<\/a> \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0442\u044c \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0438\u0439 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0439 \u043b\u0435\u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u043e\u0438\u0437\u0440\u0430\u0441\u0442\u0430\u0435\u0442 \u0443 \u043d\u0430\u0441 \u0442\u0443\u0442 \u0432 \u041a\u0430\u043b\u0438\u043d\u0438\u043d\u0433\u0440\u0430\u0434\u0441\u043a\u043e\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u043d\u0430 <a href=\"http:\/\/ru.wikipedia.org\/wiki\/\u041a\u0443\u0440\u0448\u0441\u043a\u0430\u044f_\u043a\u043e\u0441\u0430\">\u041a\u0443\u0440\u0448\u0441\u043a\u043e\u0439 \u043a\u043e\u0441\u0435<\/a>.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-215453","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/215453","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=215453"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/215453\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=215453"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=215453"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=215453"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}