{"id":371175,"date":"2024-05-21T04:42:05","date_gmt":"2024-05-21T04:42:05","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=371175"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=371175","title":{"rendered":"<span>\u0411\u044d\u0433\u0433\u0438\u043d\u0433 \u0438 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0439 \u043b\u0435\u0441. \u041a\u043b\u044e\u0447\u0435\u0432\u044b\u0435 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0441 \u043d\u0443\u043b\u044f \u043d\u0430 Python<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"float full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/276\/640\/852\/2766408521ddc05d76437814da1839b1.png\" width=\"762\" height=\"425\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/276\/640\/852\/2766408521ddc05d76437814da1839b1.png\"\/><\/figure>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043f\u043e\u0439\u0434\u0451\u0442 \u0440\u0435\u0447\u044c \u043f\u0440\u043e \u0431\u044d\u0433\u0433\u0438\u043d\u0433 \u0438 \u043c\u043e\u0439 \u0441\u0430\u043c\u044b\u0439 \u043b\u044e\u0431\u0438\u043c\u044b\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u2014 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0439 \u043b\u0435\u0441. \u041d\u0435 \u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u044d\u0442\u043e \u043e\u0434\u043d\u0438 \u0438\u0437 \u0441\u0430\u043c\u044b\u0445 \u043f\u0435\u0440\u0432\u044b\u0445 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432 \u0441\u0440\u0435\u0434\u0438 \u0441\u0435\u043c\u0435\u0439\u0441\u0442\u0432\u0430 \u0430\u043d\u0441\u0430\u043c\u0431\u043b\u0435\u0439, \u043e\u043d\u0438 \u0434\u043e \u0441\u0438\u0445 \u043f\u043e\u0440 \u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u043e\u0441\u0442\u044c\u044e \u0437\u0430 \u0441\u0447\u0451\u0442 \u0441\u0432\u043e\u0435\u0439 \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u044b \u0438 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438, \u0437\u0430\u0447\u0430\u0441\u0442\u0443\u044e \u043d\u0435 \u0443\u0441\u0442\u0443\u043f\u0430\u044f \u0431\u0443\u0441\u0442\u0438\u043d\u0433\u0430\u043c \u0432 \u043f\u043b\u0430\u043d\u0435 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438. \u041e \u0442\u043e\u043c, \u0447\u0442\u043e \u044d\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u0438 \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u0434\u0430\u043b\u0435\u0435 \u0432 \u0441\u0442\u0430\u0442\u044c\u0435.<\/p>\n<blockquote>\n<p>\u041d\u043e\u0443\u0442\u0431\u0443\u043a \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430\u043c\u0438 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u043d\u0430\u00a0<a href=\"https:\/\/www.kaggle.com\/code\/egazakharenko\/bagging-random-forest-from-scratch-in-python\" rel=\"noopener noreferrer nofollow\"><strong>Kaggle<\/strong><\/a>\u00a0(eng) \u0438\u00a0<a href=\"https:\/\/github.com\/egaoharu-kensei\/ML-algorithms-from-scratch.-Course-for-beginners\/blob\/main\/Notebooks%20%5Brus%5D\/ML-%D0%B0%D0%BB%D0%B3%D0%BE%D1%80%D0%B8%D1%82%D0%BC%D1%8B%20%D1%81%20%D0%BD%D1%83%D0%BB%D1%8F\/08%29%20%D0%91%D1%8D%D0%B3%D0%B3%D0%B8%D0%BD%D0%B3%20%D0%B8%20%D1%81%D0%BB%D1%83%D1%87%D0%B0%D0%B9%D0%BD%D1%8B%D0%B9%20%D0%BB%D0%B5%D1%81.ipynb\" rel=\"noopener noreferrer nofollow\"><strong>GitHub<\/strong><\/a>\u00a0(rus).<\/p>\n<\/blockquote>\n<h4>\u041a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u044b \u0438 \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u043e\u0440\u044b \u0441 \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u0430\u043d\u0438\u0435\u043c<\/h4>\n<p>\u041f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u043c, \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u043e\u0432, \u043e\u0431\u0443\u0447\u0435\u043d\u043d\u044b\u0445 \u043d\u0430\u00a0\u043e\u0434\u043d\u0438\u0445 \u0438 \u0442\u0435\u0445\u00a0\u0436\u0435 \u0434\u0430\u043d\u043d\u044b\u0445. \u041f\u0440\u043e\u0441\u0442\u044b\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0431\u043e\u043b\u0435\u0435 \u0441\u0438\u043b\u044c\u043d\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0430 \u0431\u0443\u0434\u0435\u0442 \u043c\u0430\u0436\u043e\u0440\u0438\u0442\u0430\u0440\u043d\u043e\u0435 \u0430\u0433\u0440\u0435\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u043e\u0432 \u043d\u0430\u00a0\u0438\u0445 \u043e\u0441\u043d\u043e\u0432\u0435, \u0442\u043e \u0435\u0441\u0442\u044c \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u043c \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u043e\u043c \u0431\u0443\u0434\u0435\u0442 \u043a\u043b\u0430\u0441\u0441 \u0441\u00a0\u043d\u0430\u0438\u0431\u043e\u043b\u044c\u0448\u0438\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u0433\u043e\u043b\u043e\u0441\u043e\u0432. \u0422\u0430\u043a\u043e\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f <em>\u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u043e\u043c \u0441\u00a0\u0436\u0451\u0441\u0442\u043a\u0438\u043c \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u0430\u043d\u0438\u0435\u043c (hard voting classifier)<\/em>.<\/p>\n<p>\u0415\u0441\u043b\u0438\u00a0\u0436\u0435 \u0431\u0430\u0437\u043e\u0432\u044b\u0435 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u044b \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u044b \u043e\u0446\u0435\u043d\u0438\u0432\u0430\u0442\u044c \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0438 \u043a\u043b\u0430\u0441\u0441\u043e\u0432, \u0442\u043e \u0435\u0441\u0442\u044c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442 \u043c\u0435\u0442\u043e\u0434 \u00abpredict_proba\u00bb, \u0442\u043e\u0433\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440, \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u0438\u0440\u0443\u044e\u0449\u0438\u0439 \u043a\u043b\u0430\u0441\u0441 \u0441\u00a0\u043d\u0430\u0438\u0431\u043e\u043b\u044c\u0448\u0435\u0439 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c\u044e, \u0443\u0441\u0440\u0435\u0434\u043d\u0451\u043d\u043d\u044b\u0439 \u043f\u043e\u00a0\u0432\u0441\u0435\u043c \u0431\u0430\u0437\u043e\u0432\u044b\u043c \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0430\u043c. \u0422\u0430\u043a\u043e\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f <em>\u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u043e\u043c \u0441\u00a0\u043c\u044f\u0433\u043a\u0438\u043c \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u0430\u043d\u0438\u0435\u043c (soft voting classifier)<\/em> \u0438 \u0438\u043c\u0435\u0435\u0442 \u0431\u043e\u043b\u0435\u0435 \u0432\u044b\u0441\u043e\u043a\u0443\u044e \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u0437\u0430\u00a0\u0441\u0447\u0451\u0442 \u043f\u0440\u0438\u0434\u0430\u043d\u0438\u044f \u0431\u043e\u043b\u044c\u0448\u0435\u0433\u043e \u0432\u0435\u0441\u0430 \u0433\u043e\u043b\u043e\u0441\u0430\u043c \u0441\u00a0\u0432\u044b\u0441\u043e\u043a\u043e\u0439 \u0434\u043e\u0441\u0442\u043e\u0432\u0435\u0440\u043d\u043e\u0441\u0442\u044c\u044e.<\/p>\n<p>\u0412\u00a0\u0441\u043b\u0443\u0447\u0430\u0435 \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u0438 \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u044b \u0431\u0430\u0437\u043e\u0432\u044b\u0445 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432 \u0443\u0441\u0440\u0435\u0434\u043d\u044f\u044e\u0442\u0441\u044f \u0438 \u0442\u0430\u043a\u043e\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f <em>\u0440\u0435\u0433\u0440\u0435\u0441\u0441\u043e\u0440\u043e\u043c \u0441\u00a0\u0433\u043e\u043b\u043e\u0441\u043e\u0432\u0430\u043d\u0438\u0435\u043c<\/em>.<\/p>\n<p>\u0412\u00a0scikit\u2011learn \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u044b \u0438 \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u043e\u0440\u044b \u0441\u00a0\u0433\u043e\u043b\u043e\u0441\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b \u0432\u00a0\u0432\u0438\u0434\u0435 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 <em>VotingClassifier<\/em> \u0438 <em>VotingRegressor<\/em> \u0438, \u0432\u00a0\u0446\u0435\u043b\u043e\u043c, \u043e\u0442\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0442 \u043b\u0443\u0447\u0448\u0435 \u043a\u0430\u0436\u0434\u043e\u0439 \u0431\u0430\u0437\u043e\u0432\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \u043f\u043e\u00a0\u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438, \u043e\u0434\u043d\u0430\u043a\u043e \u043e\u043d\u0438 \u043f\u043e\u2011\u043f\u0440\u0435\u0436\u043d\u0435\u043c\u0443 \u043f\u043b\u043e\u0445\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0441\u00a0\u0432\u044b\u0431\u0440\u043e\u0441\u0430\u043c\u0438 \u0438 \u043f\u043e\u0434\u0432\u0435\u0440\u0436\u0435\u043d\u044b \u043f\u0435\u0440\u0435\u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044e \u0437\u0430\u00a0\u0441\u0447\u0451\u0442 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0432\u0445\u043e\u0434\u044f\u0449\u0435\u0439 \u0432\u00a0\u043d\u0438\u0445 \u043c\u043e\u0434\u0435\u043b\u0438 \u043d\u0430\u00a0\u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e\u043c \u043d\u0430\u0431\u043e\u0440\u0435 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<h4>\u0411\u044d\u0433\u0433\u0438\u043d\u0433 \u0438 \u0432\u0441\u0442\u0430\u0432\u043a\u0430<\/h4>\n<p>\u0411\u043e\u043b\u0435\u0435 \u043f\u0440\u043e\u0434\u0432\u0438\u043d\u0443\u0442\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043f\u0440\u0435\u0434\u0443\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u0442 \u043c\u043d\u043e\u0433\u043e\u043a\u0440\u0430\u0442\u043d\u043e\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043e\u0434\u043d\u043e\u0439 \u0438 \u0442\u043e\u0439 \u0436\u0435 \u0431\u0430\u0437\u043e\u0432\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438, \u043e\u0431\u0443\u0447\u0435\u043d\u043d\u043e\u0439 \u043d\u0430 \u0440\u0430\u0437\u043d\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0445 \u043f\u043e\u0434\u043d\u0430\u0431\u043e\u0440\u0430\u0445 \u0442\u0440\u0435\u043d\u0438\u0440\u043e\u0432\u043e\u0447\u043d\u043e\u0433\u043e \u0434\u0430\u0442\u0430\u0441\u0435\u0442\u0430. \u0415\u0441\u043b\u0438 \u0432\u044b\u0431\u043e\u0440\u043a\u0430 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0435\u043d\u0438\u0435\u043c, \u0442\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f\u00a0<em>\u0431\u044d\u0433\u0433\u0438\u043d\u0433\u043e\u043c (bagging \u2014 \u0441\u043e\u043a\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u043e\u0442 bootstrap aggregating)<\/em>, \u0430 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0432\u044b\u0431\u043e\u0440\u043a\u0438 \u0431\u0435\u0437 \u0437\u0430\u043c\u0435\u043d\u044b \u2014\u00a0<em>\u0432\u0441\u0442\u0430\u0432\u043a\u043e\u0439 (pasting)<\/em>.<\/p>\n<blockquote>\n<p>\u0412 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0435 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0430 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e\u0439 \u0432\u044b\u0431\u043e\u0440\u043a\u0438 \u0441 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0435\u043d\u0438\u0435\u043c \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f\u00a0\u0431\u0443\u0442\u0441\u0442\u0440\u0430\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c (bootstrapping). \u041f\u0440\u0438\u043c\u0435\u0440 \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u043d \u043d\u0438\u0436\u0435.<\/p>\n<\/blockquote>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/5ae\/5aa\/1d2\/5ae5aa1d2ecb4e668be57129e1a97899.png\" alt=\"\u0421\u0445\u0435\u043c\u0430 \u0431\u0443\u0442\u0441\u0442\u0440\u0430\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f\" title=\"\u0421\u0445\u0435\u043c\u0430 \u0431\u0443\u0442\u0441\u0442\u0440\u0430\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f\" width=\"941\" height=\"693\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/5ae\/5aa\/1d2\/5ae5aa1d2ecb4e668be57129e1a97899.png\"\/><\/p>\n<div><figcaption><strong>\u0421\u0445\u0435\u043c\u0430 \u0431\u0443\u0442\u0441\u0442\u0440\u0430\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f<\/strong><\/figcaption><\/div>\n<\/figure>\n<p>\u041f\u043e\u0441\u043b\u0435 \u043c\u043d\u043e\u0433\u043e\u043a\u0440\u0430\u0442\u043d\u043e\u0433\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f n \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0445 \u0431\u0430\u0437\u043e\u0432\u044b\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u043d\u0430 \u0431\u0443\u0442\u0441\u0442\u0440\u0430\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0432\u044b\u0431\u043e\u0440\u043a\u0430\u0445, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 \u0430\u043d\u0441\u0430\u043c\u0431\u043b\u044c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442 \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0439 \u043f\u0440\u043e\u0433\u043d\u043e\u0437, \u043f\u0440\u043e\u0441\u0442\u043e \u0430\u0433\u0440\u0435\u0433\u0438\u0440\u0443\u044f \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u044b \u0431\u0430\u0437\u043e\u0432\u044b\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439. \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0430\u0433\u0440\u0435\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u043c\u043e\u0434\u0443, \u0430 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u0438 \u2014 \u0441\u0440\u0435\u0434\u043d\u0435\u0435 \u0430\u0440\u0438\u0444\u043c\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435. \u0422\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0443\u043c\u0435\u043d\u044c\u0448\u0438\u0442\u044c \u043a\u0430\u043a \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435, \u0442\u0430\u043a \u0438 \u0434\u0438\u0441\u043f\u0435\u0440\u0441\u0438\u044e.  <\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/33d\/61f\/1e8\/33d61f1e88d7f778c35324be97cfa141.png\" alt=\"\u0421\u0445\u0435\u043c\u0430 \u0440\u0430\u0431\u043e\u0442\u044b \u0431\u044d\u0433\u0433\u0438\u043d\u0433\u0430 \u0438 \u0432\u0441\u0442\u0430\u0432\u043a\u0438\" title=\"\u0421\u0445\u0435\u043c\u0430 \u0440\u0430\u0431\u043e\u0442\u044b \u0431\u044d\u0433\u0433\u0438\u043d\u0433\u0430 \u0438 \u0432\u0441\u0442\u0430\u0432\u043a\u0438\" width=\"1277\" height=\"691\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/33d\/61f\/1e8\/33d61f1e88d7f778c35324be97cfa141.png\"\/><\/p>\n<div><figcaption><strong>\u0421\u0445\u0435\u043c\u0430 \u0440\u0430\u0431\u043e\u0442\u044b \u0431\u044d\u0433\u0433\u0438\u043d\u0433\u0430 \u0438 \u0432\u0441\u0442\u0430\u0432\u043a\u0438<\/strong><\/figcaption><\/div>\n<\/figure>\n<p>\u041a\u0430\u043a\u00a0\u043c\u043e\u0436\u043d\u043e\u00a0\u0431\u044b\u043b\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0431\u0430\u0437\u043e\u0432\u044b\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u043c\u043e\u0433\u0443\u0442 \u043e\u0431\u0443\u0447\u0430\u0442\u044c\u0441\u044f \u0438 \u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u044b \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e, \u0447\u0442\u043e\u00a0\u0434\u0435\u043b\u0430\u0435\u0442 \u0431\u044d\u0433\u0433\u0438\u043d\u0433 \u0438 \u0432\u0441\u0442\u0430\u0432\u043a\u0443 \u0445\u043e\u0440\u043e\u0448\u043e \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u0443\u0435\u043c\u044b\u043c\u0438 \u043c\u0435\u0442\u043e\u0434\u0430\u043c\u0438\u00a0\u2014 \u044d\u0442\u043e \u043e\u0434\u043d\u0430 \u0438\u0437\u00a0\u043f\u0440\u0438\u0447\u0438\u043d \u0438\u0445 \u0448\u0438\u0440\u043e\u043a\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f. \u0412\u00a0\u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 scikit\u2011learn \u0434\u043b\u044f\u00a0\u0431\u044d\u0433\u0433\u0438\u043d\u0433\u0430 <em>\u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u0430 \u0441\u00a0\u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 joblib<\/em>, \u0430\u00a0\u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0445 \u044f\u0434\u0435\u0440 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0441\u00a0\u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u00abn_jobs\u00bb (\u043f\u0440\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0438 -1\u00a0\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0432\u0441\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0435 \u044f\u0434\u0440\u0430). \u0412\u00a0\u043d\u0430\u0448\u0435\u0439 \u0440\u0443\u0447\u043d\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043c\u044b \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u043c \u0442\u0430\u043a\u0436\u0435 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e\u0435 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 \u0441\u00a0\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0434\u0430\u043d\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438.<\/p>\n<blockquote>\n<p>\u0412 \u0446\u0435\u043b\u043e\u043c, \u0431\u044d\u0433\u0433\u0438\u043d\u0433 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043b\u0443\u0447\u0448\u0435 \u0432\u0441\u0442\u0430\u0432\u043a\u0438 \u0437\u0430 \u0441\u0447\u0451\u0442 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0431\u0443\u0442\u0441\u0442\u0440\u0430\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u043e\u0437\u0434\u0430\u0451\u0442 \u0431\u043e\u043b\u0435\u0435 \u043e\u0442\u043b\u0438\u0447\u043d\u044b\u0435 \u0434\u0440\u0443\u0433 \u043e\u0442 \u0434\u0440\u0443\u0433\u0430 \u043e\u0431\u0443\u0447\u0430\u044e\u0449\u0438\u0435 \u0432\u044b\u0431\u043e\u0440\u043a\u0438.<\/p>\n<\/blockquote>\n<h4>\u041e\u0446\u0435\u043d\u043a\u0430 \u043d\u0430 \u043d\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0445 \u043e\u0431\u0440\u0430\u0437\u0446\u0430\u0445<\/h4>\n<p>\u0423\u0447\u0438\u0442\u044b\u0432\u0430\u044f, \u0447\u0442\u043e\u00a0\u043f\u0440\u0438\u00a0\u0431\u044d\u0433\u0433\u0438\u043d\u0433\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0432\u044b\u0431\u043e\u0440\u043a\u0430 \u0441\u00a0\u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0435\u043d\u0438\u0435\u043c, \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u0443\u0435\u043c\u0430\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u043c \u00abbooststrap=True\u00bb (\u0432 \u0441\u043b\u0443\u0447\u0430\u0435 False \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0432\u0441\u0442\u0430\u0432\u043a\u0430), \u0442\u043e \u0432\u00a0\u0441\u0440\u0435\u0434\u043d\u0435\u043c \u0438\u0437\u00a0m \u043e\u0431\u0443\u0447\u0430\u044e\u0449\u0438\u0445 \u043e\u0431\u0440\u0430\u0437\u0446\u043e\u0432 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0431\u0438\u0440\u0430\u0442\u044c\u0441\u044f \u043e\u043a\u043e\u043b\u043e 63% \u0434\u043b\u044f\u00a0\u043a\u0430\u0436\u0434\u043e\u0439 \u0431\u0430\u0437\u043e\u0432\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438. \u041e\u0441\u0442\u0430\u0432\u0448\u0438\u0435\u0441\u044f 37% \u043d\u0430\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f <em>\u043d\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u043c\u0438 \u043e\u0431\u0443\u0447\u0430\u044e\u0449\u0438\u043c\u0438 \u043e\u0431\u0440\u0430\u0437\u0446\u0430\u043c\u0438<\/em> (out\u2011of\u2011bag \u0438\u043b\u0438\u00a0oob), \u0447\u0442\u043e\u00a0\u043c\u043e\u0436\u043d\u043e \u043b\u0435\u0433\u043a\u043e \u0434\u043e\u043a\u0430\u0437\u0430\u0442\u044c:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"lim_{m \\to \\infty}(1 - \\frac{1}{m})^{m} = \\frac{1}{e} \\approx 0.37\" alt=\"lim_{m \\to \\infty}(1 - \\frac{1}{m})^{m} = \\frac{1}{e} \\approx 0.37\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/ace\/c27\/4e0\/acec274e0e2cec336c275bf7843662ed.svg\" width=\"259\" height=\"42\"\/><\/p>\n<p>\u0421\u0442\u043e\u0438\u0442 \u0442\u0430\u043a\u0436\u0435 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0442\u0430\u043a\u0438\u0435 37% \u043f\u0440\u043e\u0446\u0435\u043d\u0442\u043e\u0432 \u043e\u0431\u0440\u0430\u0437\u0446\u043e\u0432 \u0431\u0443\u0434\u0443\u0442 \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0431\u0430\u0437\u043e\u0432\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \u0432 \u0430\u043d\u0441\u0430\u043c\u0431\u043b\u0435.<\/p>\n<p>\u0423\u0447\u0438\u0442\u044b\u0432\u0430\u044f, \u0447\u0442\u043e\u00a0\u0431\u0430\u0437\u043e\u0432\u044b\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u043d\u0435\u00a0\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 oob\u2011\u043e\u0431\u0440\u0430\u0437\u0446\u044b \u0432\u043e\u00a0\u0432\u0440\u0435\u043c\u044f \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f, \u0438\u0445 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u00a0\u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u043d\u0430\u0431\u043e\u0440\u0430 \u0438\u043b\u0438\u00a0\u043f\u0440\u0438\u00a0\u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0438 \u043a\u0440\u043e\u0441\u0441\u2011\u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438, \u0430\u00a0\u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043e\u0446\u0435\u043d\u043a\u0443 \u0432\u0441\u0435\u0433\u043e \u0430\u043d\u0441\u0430\u043c\u0431\u043b\u044f \u043c\u043e\u0436\u043d\u043e \u043f\u0443\u0442\u0435\u043c \u0443\u0441\u0440\u0435\u0434\u043d\u0435\u043d\u0438\u044f oob\u2011score \u043a\u0430\u0436\u0434\u043e\u0439 \u0431\u0430\u0437\u043e\u0432\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438, \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0432 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u00aboob_score=True\u00bb.<\/p>\n<h4>\u041c\u0435\u0442\u043e\u0434\u044b \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0445 \u0443\u0447\u0430\u0441\u0442\u043a\u043e\u0432 \u0438 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0445 \u043f\u043e\u0434\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432<\/h4>\n<p>\u0412\u044b\u0431\u043e\u0440 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0441\u0440\u0430\u0437\u0443 \u043e\u0431\u0443\u0447\u0430\u044e\u0449\u0438\u0445 \u043e\u0431\u0440\u0430\u0437\u0446\u043e\u0432 \u0438 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f\u00a0<em>\u043c\u0435\u0442\u043e\u0434\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0445 \u0443\u0447\u0430\u0441\u0442\u043a\u043e\u0432 (random patches method)<\/em>, \u0430 \u0432\u044b\u0431\u043e\u0440\u043a\u0430 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432 (bootstrap_features=True \u0438\/\u0438\u043b\u0438 max_features &lt; 1.0) \u0441 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435\u043c \u0432\u0441\u0435\u0445 \u043e\u0431\u0443\u0447\u0430\u044e\u0449\u0438\u0445 \u043e\u0431\u0440\u0430\u0437\u0446\u043e\u0432 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f\u00a0<em>\u043c\u0435\u0442\u043e\u0434\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0445 \u043f\u043e\u0434\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432 (random subspaces method)<\/em>. \u0414\u0430\u043d\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u044b \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432\u044b\u0441\u043e\u043a\u043e\u0439 \u0440\u0430\u0437\u043c\u0435\u0440\u043d\u043e\u0441\u0442\u0438.<\/p>\n<blockquote>\n<p>\u0421\u0442\u043e\u0438\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0432\u044b\u0431\u043e\u0440\u043a\u0430 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u043e\u0442\u043b\u0438\u0447\u043d\u044b\u0435 \u0434\u0440\u0443\u0433 \u043e\u0442 \u0434\u0440\u0443\u0433\u0430 \u0431\u0430\u0437\u043e\u0432\u044b\u0435 \u043c\u043e\u0434\u0435\u043b\u0438, \u0441\u043b\u0435\u0433\u043a\u0430 \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u044f \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u0438 \u0443\u043c\u0435\u043d\u044c\u0448\u0430\u044f \u0434\u0438\u0441\u043f\u0435\u0440\u0441\u0438\u044e.<\/p>\n<\/blockquote>\n<h4>\u0421\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0439 \u043b\u0435\u0441 \u0438 \u043e\u0441\u043e\u0431\u043e \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0435 \u0434\u0435\u0440\u0435\u0432\u044c\u044f<\/h4>\n<p>\u0421\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0439 \u043b\u0435\u0441 \u2014 \u044d\u0442\u043e \u0447\u0430\u0441\u0442\u043d\u044b\u0439, \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0441\u043b\u0443\u0447\u0430\u0439 \u0431\u044d\u0433\u0433\u0438\u043d\u0433\u0430 \u0438 \u0432\u0441\u0442\u0430\u0432\u043a\u0438 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0440\u0435\u0448\u0430\u044e\u0449\u0438\u0445 \u0434\u0435\u0440\u0435\u0432\u044c\u0435\u0432.<\/p>\n<p>\u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0441\u0442\u0440\u043e\u0438\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<ol>\n<li>\n<p>\u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u0441\u0442\u0440\u043e\u0438\u0442\u0441\u044f n \u0431\u0443\u0442\u0441\u0442\u0440\u0430\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0432\u044b\u0431\u043e\u0440\u043e\u043a, \u043a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u043e, \u043c\u0435\u0442\u043e\u0434\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0445 \u043f\u043e\u0434\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432;<\/p>\n<\/li>\n<li>\n<p>n \u0434\u0435\u0440\u0435\u0432\u044c\u0435\u0432 \u043e\u0431\u0443\u0447\u0430\u044e\u0442\u0441\u044f \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e \u043d\u0430 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0445 \u0432\u044b\u0431\u043e\u0440\u043a\u0430\u0445 \u0438 \u0434\u0435\u043b\u0430\u044e\u0442 \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u044b \u043d\u0430 X_test;<\/p>\n<\/li>\n<li>\n<p>\u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u044b \u0430\u0433\u0440\u0435\u0433\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u043c\u043e\u0434\u043e\u0439 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0438 \u0441\u0440\u0435\u0434\u043d\u0438\u043c \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u0438.<\/p>\n<\/li>\n<\/ol>\n<p><strong>\u0424\u043e\u0440\u043c\u0443\u043b\u044b \u0434\u043b\u044f \u0440\u0430\u0441\u0447\u0451\u0442\u043e\u0432<\/strong><\/p>\n<p>\u041f\u0440\u043e\u0433\u043d\u043e\u0437 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0433\u043e \u043b\u0435\u0441\u0430 \u0434\u043b\u044f \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u0438:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"\\hat{f}_{rf}^{B} (x) = \\frac{1}{B} \\sum\\limits_{b=1}^{B} T_{b} (x)\" alt=\"\\hat{f}_{rf}^{B} (x) = \\frac{1}{B} \\sum\\limits_{b=1}^{B} T_{b} (x)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/276\/e5a\/bf4\/276e5abf4efb92084bf39228eb4b1c58.svg\" width=\"182\" height=\"60\"\/><\/p>\n<p>\u041f\u0440\u043e\u0433\u043d\u043e\u0437 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0433\u043e \u043b\u0435\u0441\u0430 \u0434\u043b\u044f \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"\\hat{C}_{rf}^{B} (x) = {majority \\ vote} [{\\hat{C}_{b} (x)}]_{1}^{B}\" alt=\"\\hat{C}_{rf}^{B} (x) = {majority \\ vote} [{\\hat{C}_{b} (x)}]_{1}^{B}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/133\/3c9\/519\/1333c9519c85ac9729c3e1eb0988649f.svg\" width=\"269\" height=\"33\"\/><\/p>\n<p>\u041f\u0440\u043e\u0433\u043d\u043e\u0437 b-\u0433\u043e \u0431\u0443\u0442\u0441\u0442\u0440\u0430\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0434\u0435\u0440\u0435\u0432\u0430 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u0438: <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"T_{b} (x)\" alt=\"T_{b} (x)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/fb7\/448\/e40\/fb7448e407ce980a631d7599734e8b09.svg\" width=\"45\" height=\"22\"\/> <\/p>\n<p>\u0421\u043f\u0440\u043e\u0433\u043d\u043e\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 b-\u0433\u043e \u0431\u0443\u0442\u0441\u0442\u0440\u0430\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0434\u0435\u0440\u0435\u0432\u0430 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438: <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"\\hat{C}_{b} (x)\" alt=\"\\hat{C}_{b} (x)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/560\/327\/c1f\/560327c1f384babc3360509ff90ba587.svg\" width=\"48\" height=\"26\"\/> <\/p>\n<p>\u041c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432 \u0434\u043b\u044f \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u0438: <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"m = \\frac{p}{3}\" alt=\"m = \\frac{p}{3}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/9ab\/c04\/dc7\/9abc04dc7c746965544c34adf487028c.svg\" width=\"59\" height=\"38\"\/> <\/p>\n<p>\u041c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432 \u0434\u043b\u044f \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u0438 \u0432 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 scikit-learn: <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"m = p\" alt=\"m = p\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/144\/987\/941\/144987941ae3ad755d074b806ecdb0ae.svg\" width=\"52\" height=\"15\"\/> <\/p>\n<p>\u041c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432 \u0434\u043b\u044f \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438: <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"m = \\sqrt{p}\" alt=\"m = \\sqrt{p}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/cf7\/ec1\/74e\/cf7ec174ee78dcdab83add99d9c541d3.svg\" width=\"68\" height=\"23\"\/><\/p>\n<p>\u0427\u0438\u0441\u043b\u043e \u0432\u0441\u0435\u0445 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432 \u0432 \u0434\u0430\u0442\u0430\u0441\u0435\u0442\u0435: <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"p\" alt=\"p\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/be7\/03d\/619\/be703d61989a29e098abf173f031d83c.svg\" width=\"10\" height=\"15\"\/> <\/p>\n<blockquote>\n<p>\u0414\u0435\u0440\u0435\u0432\u044c\u044f \u0432 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u043c \u043b\u0435\u0441\u0435 \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0435\u0449\u0451 \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u043c\u0438 \u0437\u0430 \u0441\u0447\u0451\u0442 \u0432\u044b\u0431\u043e\u0440\u0430 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0445 \u043f\u043e\u0440\u043e\u0433\u043e\u0432\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0430 \u0432\u043c\u0435\u0441\u0442\u043e \u043f\u043e\u0438\u0441\u043a\u0430 \u043d\u0430\u0438\u043b\u0443\u0447\u0448\u0435\u0433\u043e, \u043a\u0430\u043a \u044d\u0442\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043e \u0432 CART. \u041b\u0435\u0441 \u0441 \u0442\u0430\u043a\u0438\u043c\u0438 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u043c\u0438 \u0434\u0435\u0440\u0435\u0432\u044c\u044f\u043c\u0438 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f\u00a0<strong>\u0430\u043d\u0441\u0430\u043c\u0431\u043b\u0435\u043c \u043e\u0441\u043e\u0431\u043e \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0445 \u0434\u0435\u0440\u0435\u0432\u044c\u0435\u0432 (extremely randomized trees ensemble \u0438\u043b\u0438 extra-trees)<\/strong>. \u0412 \u043e\u0441\u043e\u0431\u043e \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0445 \u0434\u0435\u0440\u0435\u0432\u044c\u044f\u0445 \u043a\u0430\u0436\u0434\u043e\u0435 \u0434\u0435\u0440\u0435\u0432\u043e \u0435\u0449\u0451 \u0431\u043e\u043b\u0435\u0435 \u043e\u0442\u043b\u0438\u0447\u043d\u043e \u0434\u0440\u0443\u0433 \u043e\u0442 \u0434\u0440\u0443\u0433\u0430, \u0447\u0435\u043c \u0432 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u043c \u043b\u0435\u0441\u0435, \u0447\u0442\u043e \u0442\u0430\u043a\u0436\u0435 \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0435\u0442 \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u0438 \u0441\u043d\u0438\u0436\u0430\u0435\u0442 \u0434\u0438\u0441\u043f\u0435\u0440\u0441\u0438\u044e. \u041f\u043e\u043c\u0438\u043c\u043e \u044d\u0442\u043e\u0433\u043e, \u0442\u0430\u043a\u0438\u0435 \u0434\u0435\u0440\u0435\u0432\u044c\u044f \u043e\u0431\u0443\u0447\u0430\u044e\u0442\u0441\u044f \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0431\u044b\u0441\u0442\u0440\u0435\u0435.  <\/p>\n<\/blockquote>\n<h4>\u0417\u043d\u0430\u0447\u0438\u043c\u043e\u0441\u0442\u044c \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432<\/h4>\n<p>\u0415\u0449\u0451 \u043e\u0434\u043d\u0438\u043c \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u043c \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0433\u043e \u043b\u0435\u0441\u0430 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u0435 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0437\u043d\u0430\u0447\u0438\u043c\u043e\u0441\u0442\u0438 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0430, \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u043d\u0430 \u0442\u043e\u043c, \u043a\u0430\u043a \u0441\u0438\u043b\u044c\u043d\u043e \u0432 \u0443\u0437\u043b\u0430\u0445 \u0434\u0435\u0440\u0435\u0432\u0430 \u0441\u043d\u0438\u0436\u0430\u0435\u0442\u0441\u044f \u0437\u0430\u0433\u0440\u044f\u0437\u043d\u0451\u043d\u043d\u043e\u0441\u0442\u044c \u0432 \u0441\u0440\u0435\u0434\u043d\u0435\u043c \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0430. \u041f\u0440\u043e\u0449\u0435 \u0433\u043e\u0432\u043e\u0440\u044f, \u0437\u043d\u0430\u0447\u0438\u043c\u043e\u0441\u0442\u044c \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0430 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u0437\u0432\u0435\u0448\u0435\u043d\u043d\u044b\u043c \u0441\u0440\u0435\u0434\u043d\u0438\u043c, \u0433\u0434\u0435 \u0432\u0435\u0441 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0443\u0437\u043b\u0430 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0443 \u0430\u0441\u0441\u043e\u0446\u0438\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0441 \u043d\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u0446\u043e\u0432: \u0447\u0435\u043c \u0431\u043e\u043b\u044c\u0448\u0435 \u0432\u0435\u0441 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0430, \u0442\u0435\u043c \u0431\u043e\u043b\u044c\u0448\u0435 \u0435\u0433\u043e \u0432\u043a\u043b\u0430\u0434 \u0432 \u043e\u0431\u0449\u0443\u044e \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u0438.<\/p>\n<blockquote>\n<p>\u0421\u0442\u043e\u0438\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0432 \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u043c \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0438 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u043e\u0434\u0432\u0438\u043d\u0443\u0442\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0446\u0438\u0438 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u043c\u043e\u0434\u0435\u043b\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440\u00a0<a href=\"https:\/\/medium.com\/@bneeraj026\/shap-feature-importance-deep-dive-1b96a9d43d08\" rel=\"noopener noreferrer nofollow\">SHAP<\/a>\u00a0\u0438\u043b\u0438\u00a0<a href=\"https:\/\/coderzcolumn.com\/tutorials\/machine-learning\/how-to-use-lime-to-understand-sklearn-models-predictions\" rel=\"noopener noreferrer nofollow\">LIME<\/a>.<\/p>\n<\/blockquote>\n<h4>\u0418\u043c\u043f\u043e\u0440\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a<\/h4>\n<pre><code class=\"python\">import numpy as np import pandas as pd import matplotlib.pyplot as plt from sklearn.datasets import load_diabetes from sklearn.preprocessing import LabelEncoder from sklearn.model_selection import train_test_split from sklearn.metrics import accuracy_score, mean_absolute_percentage_error from sklearn.svm import SVC from sklearn.linear_model import LogisticRegression from sklearn.tree import DecisionTreeClassifier, DecisionTreeRegressor from sklearn.ensemble import RandomForestClassifier, RandomForestRegressor from sklearn.ensemble import BaggingClassifier, VotingClassifier, ExtraTreesClassifier from joblib import Parallel, delayed from mlxtend.plotting import plot_decision_regions<\/code><\/pre>\n<h4>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043d\u0430 Python \u0441 \u043d\u0443\u043b\u044f<\/h4>\n<pre><code class=\"python\">class RandomForest:     def __init__(self, regression=False, n_estimators=100, max_depth=None,                  max_features=1.0, n_jobs=-1, random_state=0, ccp_alpha=0.0):         self.regression = regression         self.n_estimators = n_estimators         self.max_depth = max_depth         self.max_features = max_features         self.n_jobs = n_jobs         self.random_state = random_state         self.ccp_alpha = ccp_alpha         self.trained_trees_info = []         self.general_random = np.random.RandomState(self.random_state)      #bootstrapping with random subspaces method     def _rsm_bootstrapping(self, X, y):         n_samples, n_features = X.shape         if self.regression:             max_features = self.max_features * n_features         else:             max_features = np.sqrt(n_features)          sample_indexes = self.general_random.choice(n_samples, n_samples)         features = self.general_random.choice(X.columns, round(max_features))         X_b, y_b = X.iloc[sample_indexes][features], y.iloc[sample_indexes]          return X_b, y_b      def _train_tree(self, X, y):         if self.regression:             tree = DecisionTreeRegressor(max_depth=self.max_depth,                                          random_state=self.random_state,                                          ccp_alpha=self.ccp_alpha)         else:             tree = DecisionTreeClassifier(max_depth=self.max_depth,                                           random_state=self.random_state,                                           ccp_alpha=self.ccp_alpha)          return tree.fit(X, y), X.columns      def fit(self, X, y):         boot_data = (self._rsm_bootstrapping(X, y) for _ in range(self.n_estimators))         train_trees = (delayed(self._train_tree)(X_b, y_b) for X_b, y_b in boot_data)         self.trained_trees_info = Parallel(n_jobs=self.n_jobs)(train_trees)      def predict(self, samples):         prediction = (delayed(tree_i.predict)(samples[tree_i_features])                       for (tree_i, tree_i_features) in self.trained_trees_info)          trees_predictions = pd.DataFrame(Parallel(n_jobs=self.n_jobs)(prediction))          if self.regression:             forest_prediction = trees_predictions.mean(axis=0)         else:             forest_prediction = trees_predictions.mode(axis=0).iloc[0]          return np.array(forest_prediction)<\/code><\/pre>\n<h4>\u041a\u043e\u0434 \u0434\u043b\u044f \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0438 \u0433\u0440\u0430\u0444\u0438\u043a\u0430<\/h4>\n<pre><code class=\"python\">def decision_boundary_plot(X, y, X_train, y_train, clf, feature_indexes, title=None):     feature1_name, feature2_name = X.columns[feature_indexes]     X_feature_columns = X.values[:, feature_indexes]     X_train_feature_columns = X_train.values[:, feature_indexes]     clf.fit(X_train_feature_columns, y_train.values)      plot_decision_regions(X=X_feature_columns, y=y.values, clf=clf)     plt.xlabel(feature1_name)     plt.ylabel(feature2_name)     plt.title(title)<\/code><\/pre>\n<h4>\u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0434\u0430\u0442\u0430\u0441\u0435\u0442\u043e\u0432<\/h4>\n<p>\u0414\u043b\u044f \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u00a0<a href=\"https:\/\/www.kaggle.com\/datasets\/uciml\/glass\" rel=\"noopener noreferrer nofollow\">Glass Classification<\/a>\u00a0\u0434\u0430\u0442\u0430\u0441\u0435\u0442, \u0433\u0434\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0432\u0435\u0440\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0442\u0438\u043f \u0441\u0442\u0435\u043a\u043b\u0430 \u043f\u043e \u0435\u0433\u043e \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0430\u043c. \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f Diabetes \u0434\u0430\u0442\u0430\u0441\u0435\u0442 \u0438\u0437 scikit-learn.<\/p>\n<pre><code class=\"python\">df_path = \"\/content\/drive\/MyDrive\/glass.csv\" glass_df = pd.read_csv(df_path) X1, y1 = glass_df.iloc[:, :-1], glass_df.iloc[:, -1] y1 = pd.Series(LabelEncoder().fit_transform(y1)) X1_train, X1_test, y1_train, y1_test = train_test_split(X1, y1, random_state=0) print(glass_df)             RI     Na    Mg    Al     Si     K    Ca    Ba   Fe  Type 0    1.52101  13.64  4.49  1.10  71.78  0.06  8.75  0.00  0.0     1 1    1.51761  13.89  3.60  1.36  72.73  0.48  7.83  0.00  0.0     1 2    1.51618  13.53  3.55  1.54  72.99  0.39  7.78  0.00  0.0     1 3    1.51766  13.21  3.69  1.29  72.61  0.57  8.22  0.00  0.0     1 4    1.51742  13.27  3.62  1.24  73.08  0.55  8.07  0.00  0.0     1 ..       ...    ...   ...   ...    ...   ...   ...   ...  ...   ... 209  1.51623  14.14  0.00  2.88  72.61  0.08  9.18  1.06  0.0     7 210  1.51685  14.92  0.00  1.99  73.06  0.00  8.40  1.59  0.0     7 211  1.52065  14.36  0.00  2.02  73.42  0.00  8.44  1.64  0.0     7 212  1.51651  14.38  0.00  1.94  73.61  0.00  8.48  1.57  0.0     7 213  1.51711  14.23  0.00  2.08  73.36  0.00  8.62  1.67  0.0     7  [214 rows x 10 columns]<\/code><\/pre>\n<pre><code class=\"python\">X2, y2 = load_diabetes(return_X_y=True, as_frame=True) X2_train, X2_test, y2_train, y2_test = train_test_split(X2, y2, random_state=0) print(X2, y2, sep='\\n')             age       sex       bmi        bp        s1        s2        s3  \\ 0    0.038076  0.050680  0.061696  0.021872 -0.044223 -0.034821 -0.043401    1   -0.001882 -0.044642 -0.051474 -0.026328 -0.008449 -0.019163  0.074412    2    0.085299  0.050680  0.044451 -0.005670 -0.045599 -0.034194 -0.032356    3   -0.089063 -0.044642 -0.011595 -0.036656  0.012191  0.024991 -0.036038    4    0.005383 -0.044642 -0.036385  0.021872  0.003935  0.015596  0.008142    ..        ...       ...       ...       ...       ...       ...       ...    437  0.041708  0.050680  0.019662  0.059744 -0.005697 -0.002566 -0.028674    438 -0.005515  0.050680 -0.015906 -0.067642  0.049341  0.079165 -0.028674    439  0.041708  0.050680 -0.015906  0.017293 -0.037344 -0.013840 -0.024993    440 -0.045472 -0.044642  0.039062  0.001215  0.016318  0.015283 -0.028674    441 -0.045472 -0.044642 -0.073030 -0.081413  0.083740  0.027809  0.173816                s4        s5        s6   0   -0.002592  0.019907 -0.017646   1   -0.039493 -0.068332 -0.092204   2   -0.002592  0.002861 -0.025930   3    0.034309  0.022688 -0.009362   4   -0.002592 -0.031988 -0.046641   ..        ...       ...       ...   437 -0.002592  0.031193  0.007207   438  0.034309 -0.018114  0.044485   439 -0.011080 -0.046883  0.015491   440  0.026560  0.044529 -0.025930   441 -0.039493 -0.004222  0.003064    [442 rows x 10 columns] 0      151.0 1       75.0 2      141.0 3      206.0 4      135.0        ...   437    178.0 438    104.0 439    132.0 440    220.0 441     57.0 Name: target, Length: 442, dtype: float64<\/code><\/pre>\n<h4>\u041e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0438 \u043e\u0446\u0435\u043d\u043a\u0430 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0445 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432<\/h4>\n<p>\u041a\u0430\u043a \u0438 \u043e\u0436\u0438\u0434\u0430\u043b\u043e\u0441\u044c, \u0431\u044d\u0433\u0433\u0438\u043d\u0433 \u0438 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0439 \u043b\u0435\u0441 \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u0438 \u043f\u0440\u0438\u0440\u043e\u0441\u0442 \u0432 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438 \u043f\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044e \u0441 \u0434\u0435\u0440\u0435\u0432\u043e\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u0439. \u0420\u0430\u0437\u043d\u0438\u0446\u0430 \u0435\u0449\u0451 \u0431\u043e\u043b\u0435\u0435 \u0437\u0430\u043c\u0435\u0442\u043d\u0430 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043e\u0441\u043e\u0431\u043e \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0445 \u0434\u0435\u0440\u0435\u0432\u044c\u0435\u0432, \u0430 \u0432\u043e\u0442 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0441 \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043f\u0440\u0438\u0440\u043e\u0441\u0442\u0430 \u0432 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438 \u043d\u0435 \u0434\u0430\u043b.<\/p>\n<blockquote>\n<p>\u0421\u0442\u043e\u0438\u0442 \u0442\u0430\u043a\u0436\u0435 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u043e\u0441\u043e\u0431\u043e \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0435 \u0434\u0435\u0440\u0435\u0432\u044c\u044f \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u0432\u044b\u0438\u0433\u0440\u044b\u0432\u0430\u044e\u0442 \u0432 \u043f\u043b\u0430\u043d\u0435 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438 \u0432 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0438 \u0441\u043e \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u043c \u043b\u0435\u0441\u043e\u043c \u0438 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c \u0434\u043e\u0441\u0442\u043e\u0432\u0435\u0440\u043d\u044b\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c \u0443\u0437\u043d\u0430\u0442\u044c \u043a\u0430\u043a\u043e\u0439 \u0438\u0437 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432 \u043b\u0443\u0447\u0448\u0435, \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0438\u0445 \u043f\u0440\u044f\u043c\u043e\u0435 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0441 \u043f\u043e\u0434\u0431\u043e\u0440\u043e\u043c \u0440\u0430\u0437\u043d\u044b\u0445 \u0433\u0438\u043f\u0435\u0440\u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432.<\/p>\n<\/blockquote>\n<p>\u041d\u0438\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u044b \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0438 \u0433\u0440\u0430\u0444\u0438\u043a\u0438 \u0440\u0435\u0448\u0430\u044e\u0449\u0438\u0445 \u0433\u0440\u0430\u043d\u0438\u0446 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430.<\/p>\n<p><strong>Random Forest \u0434\u043b\u044f \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438<\/strong>  <\/p>\n<pre><code class=\"python\">random_forest_classifier = RandomForest(random_state=0) random_forest_classifier.fit(X1_train, y1_train) rf_clf_pred_res = random_forest_classifier.predict(X1_test) rf_clf_accuracy = accuracy_score(rf_clf_pred_res, y1_test) print(rf_clf_pred_res) print(f'rf_clf accuracy: {rf_clf_accuracy}')  sk_random_forest_classifier = RandomForestClassifier(random_state=0) sk_random_forest_classifier.fit(X1_train, y1_train) sk_rf_clf_pred_res = sk_random_forest_classifier.predict(X1_test) sk_rf_clf_accuracy = accuracy_score(sk_rf_clf_pred_res, y1_test) print(sk_rf_clf_pred_res) print(f'sk_rf_clf accuracy: {sk_rf_clf_accuracy}')   [5 0 1 4 3 1 0 1 1 1 0 0 1 1 1 5 0 1 2 0 1 0 5 5 0 0 5 0 1 1 0 0 1 0 0 0 0  0 0 5 1 4 1 0 1 1 0 1 0 1 0 1 5 0] rf_clf accuracy: 0.7222222222222222  [5 0 1 4 3 1 0 1 1 1 1 0 1 1 1 5 2 1 2 1 3 0 5 5 0 0 5 0 1 1 0 0 1 0 0 0 0  0 0 5 3 4 1 0 1 1 0 1 0 1 0 1 5 0] sk_rf_clf accuracy: 0.7037037037037037<\/code><\/pre>\n<p><strong>Random Forest \u0434\u043b\u044f \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u0438<\/strong>  <\/p>\n<pre><code class=\"python\">random_forest_regressor = RandomForest(regression=True, random_state=0) random_forest_regressor.fit(X2_train, y2_train) rf_reg_pred_res = random_forest_regressor.predict(X2_test) mape = mean_absolute_percentage_error(rf_reg_pred_res, y2_test) print(f'mape: {mape}') print(rf_reg_pred_res)  sk_random_forest_regressor = RandomForestRegressor(random_state=0) sk_random_forest_regressor.fit(X2_train, y2_train) sk_rf_reg_pred_res = sk_random_forest_regressor.predict(X2_test) sk_mape = mean_absolute_percentage_error(sk_rf_reg_pred_res, y2_test) print(f'sk_mape: {sk_mape}') print(sk_rf_reg_pred_res)   mape: 0.3162321058884571 [233.89 236.14 160.42 114.39 182.3  233.59 101.64 231.75 134.16 209.1  157.81 157.92 148.37 112.27 276.42 106.68 148.94  82.27 110.39 221.53  163.31 132.82 158.98 114.09 201.66 187.82 144.77  81.82 194.05 173.86  174.28  84.67 135.73 162.31 148.59 188.1  163.34 144.86 108.44 212.66  111.   159.73 123.71 173.85 177.94  87.07 122.24 141.52 111.05 220.33  159.28  75.79 156.81 173.54 234.88 204.58 180.04 118.67 146.71 167.36  216.98 153.32 132.07 105.45 239.33 150.75  93.58 224.83 200.27 112.72   86.13 135.73 117.98 135.13 136.06 180.59 137.36 225.1  244.43 209.96  133.33 210.47  78.8  240.79 124.75  96.83 144.62 189.53 112.04 146.64  103.61 114.46  95.39 186.43 105.3   90.85 232.33 216.32 143.46 156.55  156.59 112.41 176.95 100.51 227.5  143.1  213.6  255.85 106.35  92.22  237.11]  sk_mape: 0.3313513936725928 [250.61 251.57 169.22  92.96 208.8  261.45  91.43 240.08 128.06 240.07  167.75 151.67 127.6   95.09 289.77  90.21 162.    77.62 107.74 220.32  186.06 125.12 163.62 130.02 218.6  189.48 130.9   81.49 210.22 156.14  180.66  74.   110.35 161.2  143.94 183.56 152.95 124.07  95.37 230.31  100.23 166.91 125.19 185.65 184.5   75.85 115.77 137.16 110.79 249.37  149.82  71.63 178.53 165.67 262.99 190.86 186.88  99.41 141.24 168.4  252.62 155.37 126.8   99.8  261.6  151.19  81.   225.57 221.44 118.12   83.09 148.36 115.91 128.14 130.36 178.47 115.51 229.29 262.53 196.85  114.72 205.47  79.18 246.56 119.8   88.36 149.19 211.39 100.69 142.92  101.3   98.92  96.19 171.63 101.3   94.   253.01 237.53 138.73 146.03  143.91 107.73 167.38 101.56 245.   147.27 231.09 263.92 102.98  89.12  260.02]<\/code><\/pre>\n<pre><code class=\"python\">importances = sk_random_forest_regressor.feature_importances_ feature_importances = pd.Series(importances, index=X2_train.columns) feature_importances.sort_values(ascending=True).plot(kind='barh')<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/556\/9f6\/6d0\/5569f66d04bf79e34c0ad23233cb5681.png\" alt=\"\u0413\u0440\u0430\u0444\u0438\u043a \u0432\u0430\u0436\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432 \u0432 Random Forest\" title=\"\u0413\u0440\u0430\u0444\u0438\u043a \u0432\u0430\u0436\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432 \u0432 Random Forest\" width=\"551\" height=\"413\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/556\/9f6\/6d0\/5569f66d04bf79e34c0ad23233cb5681.png\"\/><\/p>\n<div><figcaption><strong>\u0413\u0440\u0430\u0444\u0438\u043a \u0432\u0430\u0436\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432 \u0432 Random Forest<\/strong><\/figcaption><\/div>\n<\/figure>\n<p><strong>DecisionTreeClassifier<\/strong>  <\/p>\n<pre><code class=\"python\">sk_tree_clf = DecisionTreeClassifier(random_state=0) sk_tree_clf.fit(X1_train, y1_train) tree_pred_res = sk_tree_clf.predict(X1_test) tree_accuracy = accuracy_score(tree_pred_res, y1_test) print(f'tree accuracy: {tree_accuracy}') print(tree_pred_res)  feature_indexes = [1, 3] title1 = 'DecisionTreeClassifier surface' decision_boundary_plot(X1, y1, X1_train, y1_train, sk_tree_clf, feature_indexes, title1)   tree accuracy: 0.6111111111111112 [5 0 1 1 3 1 0 1 1 1 1 2 1 1 1 5 2 1 0 1 3 0 5 3 0 0 5 0 0 1 0 0 1 2 0 0 0  2 0 5 3 4 1 0 1 1 0 1 0 1 0 4 5 2]<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/d93\/7a2\/f6c\/d937a2f6c78e23667658bd1868fccd7c.png\" width=\"554\" height=\"455\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d93\/7a2\/f6c\/d937a2f6c78e23667658bd1868fccd7c.png\"\/><\/figure>\n<p><strong>VotingClassifier<\/strong>  <\/p>\n<pre><code class=\"python\">estimators = [('lr', LogisticRegression(random_state=0, max_iter=10000)),               ('dt', DecisionTreeClassifier(random_state=0)),               ('svc', SVC(probability=True, random_state=0))]  voting_clf = VotingClassifier(estimators, voting='soft') voting_clf.fit(X1_train, y1_train) voting_clf_pred_res = voting_clf.predict(X1_test) voting_clf_accuracy = accuracy_score(voting_clf_pred_res, y1_test) print(f'voting_clf accuracy: {voting_clf_accuracy}') print(voting_clf_pred_res)  feature_indexes = [1, 3] title2 = 'VotingClassifier surface' decision_boundary_plot(X1, y1, X1_train, y1_train, voting_clf, feature_indexes, title2)   voting_clf accuracy: 0.6111111111111112 [5 0 1 1 3 1 0 1 1 1 1 2 1 1 1 5 2 1 0 1 3 0 5 3 0 0 5 0 0 1 0 0 1 2 0 0 0  2 0 5 3 4 1 0 1 1 0 1 0 1 0 4 5 2]<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/538\/6f5\/f97\/5386f5f9708e49ac840774df202bde52.png\" width=\"554\" height=\"455\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/538\/6f5\/f97\/5386f5f9708e49ac840774df202bde52.png\"\/><\/figure>\n<p><strong>BaggingClassifier<\/strong>  <\/p>\n<pre><code class=\"python\">dt_clf = DecisionTreeClassifier(random_state=0) bagging_clf = BaggingClassifier(estimator=dt_clf, n_estimators=100, random_state=0) bagging_clf.fit(X1_train, y1_train) bagging_pred_res = bagging_clf.predict(X1_test) bagging_clf_accuracy = accuracy_score(bagging_pred_res, y1_test) print(f'bagging_clf accuracy: {bagging_clf_accuracy}') print(bagging_pred_res)  feature_indexes = [1, 3] title3 = 'BaggingClassifier surface' decision_boundary_plot(X1, y1, X1_train, y1_train, bagging_clf, feature_indexes, title3)   bagging_clf accuracy: 0.6851851851851852 [5 0 1 4 3 1 0 1 1 1 1 0 1 1 1 5 2 1 0 1 3 0 5 5 0 0 5 0 1 1 0 0 1 0 1 0 0  0 0 5 5 4 1 0 1 1 0 1 0 1 0 4 5 0]<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/cca\/72b\/ef3\/cca72bef30131b877789c9dfba04953c.png\" width=\"554\" height=\"455\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/cca\/72b\/ef3\/cca72bef30131b877789c9dfba04953c.png\"\/><\/figure>\n<p><strong>RandomForestClassifier<\/strong>  <\/p>\n<pre><code class=\"python\">sk_rf_clf = sk_random_forest_classifier print(sk_rf_clf_accuracy)  feature_indexes = [1, 3] title4 = 'RandomForestClassifier surface' decision_boundary_plot(X1, y1, X1_train, y1_train, sk_rf_clf, feature_indexes, title4)   0.7037037037037037<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/4dc\/3f7\/621\/4dc3f76212d69c65bed77b4a2a8fddb1.png\" width=\"554\" height=\"455\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/4dc\/3f7\/621\/4dc3f76212d69c65bed77b4a2a8fddb1.png\"\/><\/figure>\n<p><strong>ExtraTreesClassifier<\/strong>  <\/p>\n<pre><code class=\"python\">extra_trees_clf = ExtraTreesClassifier(random_state=0) extra_trees_clf.fit(X1_train, y1_train) et_clf_pred_res = extra_trees_clf.predict(X1_test) et_clf_accuracy = accuracy_score(et_clf_pred_res, y1_test) print(f'et_clf accuracy: {et_clf_accuracy}') print(et_clf_pred_res)  feature_indexes = [1, 3] title5 = 'ExtraTreesClassifier surface' decision_boundary_plot(X1, y1, X1_train, y1_train, extra_trees_clf, feature_indexes, title5)   et_clf accuracy: 0.7222222222222222 [5 0 1 4 3 1 0 1 1 1 1 0 1 1 1 5 0 1 2 1 3 0 5 5 0 0 5 0 1 1 0 0 1 0 0 0 0  0 0 5 1 4 1 0 1 1 0 1 0 1 0 1 5 0]<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/4b1\/721\/429\/4b172142945374df1a1940b9906d5b33.png\" width=\"554\" height=\"455\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/4b1\/721\/429\/4b172142945374df1a1940b9906d5b33.png\"\/><\/figure>\n<h4>\u041f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430 \u0438 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u0438 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0433\u043e \u043b\u0435\u0441\u0430<\/h4>\n<p><u>\u041f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430<\/u>:<\/p>\n<ul>\n<li>\n<p>\u0432\u044b\u0441\u043e\u043a\u0430\u044f \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u043e\u0432, \u0447\u0430\u0441\u0442\u043e \u0441\u0440\u0430\u0432\u043d\u0438\u043c\u0430\u044f \u0441 \u0431\u0443\u0441\u0442\u0438\u043d\u0433\u0430\u043c\u0438;<\/p>\n<\/li>\n<li>\n<p>\u0443\u0441\u0442\u043e\u0439\u0447\u0438\u0432\u043e\u0441\u0442\u044c \u043a \u0432\u044b\u0431\u0440\u043e\u0441\u0430\u043c \u0438 \u043d\u0435\u0441\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c \u0434\u0430\u0442\u0430\u0441\u0435\u0442\u0430\u043c;<\/p>\n<\/li>\n<li>\n<p>\u0432\u044b\u0441\u043e\u043a\u0430\u044f \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u044b \u0438 \u0445\u043e\u0440\u043e\u0448\u0430\u044f \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u0443\u0435\u043c\u043e\u0441\u0442\u044c;<\/p>\n<\/li>\n<li>\n<p>\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0438\u0437\u0430\u0446\u0438\u0438;<\/p>\n<\/li>\n<li>\n<p>\u0445\u043e\u0440\u043e\u0448\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0430\u043c\u0438;<\/p>\n<\/li>\n<li>\n<p>\u0447\u0430\u0441\u0442\u043e \u0443\u0441\u0442\u043e\u0439\u0447\u0438\u0432 \u043a \u043f\u0435\u0440\u0435\u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044e.<\/p>\n<\/li>\n<\/ul>\n<p><u>\u041d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u0438<\/u>:<\/p>\n<ul>\n<li>\n<p>\u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u0430\u044f \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0438\u0440\u0443\u0435\u043c\u043e\u0441\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u0432 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0438 \u0441 \u0434\u0435\u0440\u0435\u0432\u043e\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u0439;<\/p>\n<\/li>\n<li>\n<p>\u0441\u043a\u043b\u043e\u043d\u043d\u043e\u0441\u0442\u044c \u043a \u043f\u0435\u0440\u0435\u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044e \u043d\u0430 \u0441\u0438\u043b\u044c\u043d\u043e \u0437\u0430\u0448\u0443\u043c\u043b\u0435\u043d\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445;<\/p>\n<\/li>\n<li>\n<p>\u043f\u0440\u0435\u0434\u0432\u0437\u044f\u0442\u043e\u0441\u0442\u044c \u043a \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0430\u043b\u044c\u043d\u044b\u043c \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0430\u043c \u0441 \u0431\u043e\u043b\u044c\u0448\u0438\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0445 \u043a\u043b\u0430\u0441\u0441\u043e\u0432: \u0434\u0435\u0440\u0435\u0432\u044c\u044f \u0431\u0443\u0434\u0443\u0442 \u0441\u0438\u043b\u044c\u043d\u0435\u0435 \u043f\u043e\u0434\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u043e\u0434 \u044d\u0442\u0438 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0438 \u0438\u0437-\u0437\u0430 \u0431\u043e\u043b\u0435\u0435 \u0432\u044b\u0441\u043e\u043a\u043e\u0433\u043e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u0440\u043e\u0441\u0442\u0430.<\/p>\n<\/li>\n<\/ul>\n<h4>\u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0438<\/h4>\n<p>\u0421\u0442\u0430\u0442\u044c\u044f \u00abRANDOM FORESTS\u00bb, Leo Breiman.<\/p>\n<p>\u0414\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f:  <\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/scikit-learn.org\/stable\/modules\/ensemble.html#\" rel=\"noopener noreferrer nofollow\">\u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0430\u043d\u0441\u0430\u043c\u0431\u043b\u0435\u0439<\/a>;<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/scikit-learn.org\/stable\/modules\/generated\/sklearn.ensemble.VotingClassifier.html\" rel=\"noopener noreferrer nofollow\">VotingClassifier<\/a>;<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/scikit-learn.org\/stable\/modules\/generated\/sklearn.ensemble.VotingRegressor.html\" rel=\"noopener noreferrer nofollow\">VotingRegressor<\/a>;<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/scikit-learn.org\/stable\/modules\/generated\/sklearn.ensemble.BaggingClassifier.html\" rel=\"noopener noreferrer nofollow\">BaggingClassifier<\/a>;<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/scikit-learn.org\/stable\/modules\/generated\/sklearn.ensemble.BaggingRegressor\" rel=\"noopener noreferrer nofollow\">BaggingRegressor<\/a>;<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/scikit-learn.org\/stable\/modules\/generated\/sklearn.ensemble.RandomForestClassifier.html\" rel=\"noopener noreferrer nofollow\">RandomForestClassifier<\/a>;<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/scikit-learn.org\/stable\/modules\/generated\/sklearn.ensemble.RandomForestRegressor.html\" rel=\"noopener noreferrer nofollow\">RandomForestRegressor<\/a>;<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/scikit-learn.org\/stable\/modules\/generated\/sklearn.ensemble.ExtraTreesClassifier.html\" rel=\"noopener noreferrer nofollow\">ExtraTreesClassifier<\/a>;<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/scikit-learn.org\/stable\/modules\/generated\/sklearn.ensemble.ExtraTreesRegressor.html\" rel=\"noopener noreferrer nofollow\">ExtraTreesRegressor<\/a>.<\/p>\n<\/li>\n<\/ul>\n<p>\u041b\u0435\u043a\u0446\u0438\u0438:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/www.youtube.com\/watch?v=AategB38Zqc\" rel=\"noopener noreferrer nofollow\">\u043e\u0434\u0438\u043d<\/a> ;<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/www.youtube.com\/watch?v=YJcv5hWoGSI\" rel=\"noopener noreferrer nofollow\">\u0434\u0432\u0430<\/a>.<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u043e\u0448\u0430\u0433\u043e\u0432\u043e\u0435 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435 Random Forest:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/www.youtube.com\/playlist?list=PLPOTBrypY74y0DviMOagKRUhDdk0JyM_r\" rel=\"noopener noreferrer nofollow\">\u043e\u0434\u0438\u043d<\/a>;<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/www.youtube.com\/watch?v=J4Wdy0Wc_xQ\" rel=\"noopener noreferrer nofollow\">\u0434\u0432\u0430<\/a>;<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/www.youtube.com\/watch?v=sQ870aTKqiM\" rel=\"noopener noreferrer nofollow\">\u0442\u0440\u0438<\/a>.<\/p>\n<\/li>\n<\/ul>\n<hr\/>\n<p><a href=\"https:\/\/habr.com\/ru\/articles\/801515\/\" rel=\"noopener noreferrer nofollow\"><strong>? \u0414\u0435\u0440\u0435\u0432\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0439 (CART)<\/strong><\/a><strong>  |  <\/strong><a href=\"https:\/\/habr.com\/ru\/articles\/800499\/\" rel=\"noopener noreferrer nofollow\"><strong>\u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b AdaBoost ?<\/strong><\/a><\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/801161\/\"> https:\/\/habr.com\/ru\/articles\/801161\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"float full-width\"><\/figure>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043f\u043e\u0439\u0434\u0451\u0442 \u0440\u0435\u0447\u044c \u043f\u0440\u043e \u0431\u044d\u0433\u0433\u0438\u043d\u0433 \u0438 \u043c\u043e\u0439 \u0441\u0430\u043c\u044b\u0439 \u043b\u044e\u0431\u0438\u043c\u044b\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u2014 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0439 \u043b\u0435\u0441. \u041d\u0435 \u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u044d\u0442\u043e \u043e\u0434\u043d\u0438 \u0438\u0437 \u0441\u0430\u043c\u044b\u0445 \u043f\u0435\u0440\u0432\u044b\u0445 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432 \u0441\u0440\u0435\u0434\u0438 \u0441\u0435\u043c\u0435\u0439\u0441\u0442\u0432\u0430 \u0430\u043d\u0441\u0430\u043c\u0431\u043b\u0435\u0439, \u043e\u043d\u0438 \u0434\u043e \u0441\u0438\u0445 \u043f\u043e\u0440 \u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u043e\u0441\u0442\u044c\u044e \u0437\u0430 \u0441\u0447\u0451\u0442 \u0441\u0432\u043e\u0435\u0439 \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u044b \u0438 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438, \u0437\u0430\u0447\u0430\u0441\u0442\u0443\u044e \u043d\u0435 \u0443\u0441\u0442\u0443\u043f\u0430\u044f \u0431\u0443\u0441\u0442\u0438\u043d\u0433\u0430\u043c \u0432 \u043f\u043b\u0430\u043d\u0435 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438. \u041e \u0442\u043e\u043c, \u0447\u0442\u043e \u044d\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u0438 \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u0434\u0430\u043b\u0435\u0435 \u0432 \u0441\u0442\u0430\u0442\u044c\u0435.<\/p>\n<blockquote>\n<p>\u041d\u043e\u0443\u0442\u0431\u0443\u043a \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430\u043c\u0438 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u043d\u0430\u00a0<a href=\"https:\/\/www.kaggle.com\/code\/egazakharenko\/bagging-random-forest-from-scratch-in-python\" rel=\"noopener noreferrer nofollow\"><strong>Kaggle<\/strong><\/a>\u00a0(eng) \u0438\u00a0<a href=\"https:\/\/github.com\/egaoharu-kensei\/ML-algorithms-from-scratch.-Course-for-beginners\/blob\/main\/Notebooks%20%5Brus%5D\/ML-%D0%B0%D0%BB%D0%B3%D0%BE%D1%80%D0%B8%D1%82%D0%BC%D1%8B%20%D1%81%20%D0%BD%D1%83%D0%BB%D1%8F\/08%29%20%D0%91%D1%8D%D0%B3%D0%B3%D0%B8%D0%BD%D0%B3%20%D0%B8%20%D1%81%D0%BB%D1%83%D1%87%D0%B0%D0%B9%D0%BD%D1%8B%D0%B9%20%D0%BB%D0%B5%D1%81.ipynb\" rel=\"noopener noreferrer nofollow\"><strong>GitHub<\/strong><\/a>\u00a0(rus).<\/p>\n<\/blockquote>\n<h4>\u041a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u044b \u0438 \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u043e\u0440\u044b \u0441 \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u0430\u043d\u0438\u0435\u043c<\/h4>\n<p>\u041f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u043c, \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u043e\u0432, \u043e\u0431\u0443\u0447\u0435\u043d\u043d\u044b\u0445 \u043d\u0430\u00a0\u043e\u0434\u043d\u0438\u0445 \u0438 \u0442\u0435\u0445\u00a0\u0436\u0435 \u0434\u0430\u043d\u043d\u044b\u0445. \u041f\u0440\u043e\u0441\u0442\u044b\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0431\u043e\u043b\u0435\u0435 \u0441\u0438\u043b\u044c\u043d\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0430 \u0431\u0443\u0434\u0435\u0442 \u043c\u0430\u0436\u043e\u0440\u0438\u0442\u0430\u0440\u043d\u043e\u0435 \u0430\u0433\u0440\u0435\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u043e\u0432 \u043d\u0430\u00a0\u0438\u0445 \u043e\u0441\u043d\u043e\u0432\u0435, \u0442\u043e \u0435\u0441\u0442\u044c \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u043c \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u043e\u043c \u0431\u0443\u0434\u0435\u0442 \u043a\u043b\u0430\u0441\u0441 \u0441\u00a0\u043d\u0430\u0438\u0431\u043e\u043b\u044c\u0448\u0438\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u0433\u043e\u043b\u043e\u0441\u043e\u0432. \u0422\u0430\u043a\u043e\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f <em>\u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u043e\u043c \u0441\u00a0\u0436\u0451\u0441\u0442\u043a\u0438\u043c \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u0430\u043d\u0438\u0435\u043c (hard voting classifier)<\/em>.<\/p>\n<p>\u0415\u0441\u043b\u0438\u00a0\u0436\u0435 \u0431\u0430\u0437\u043e\u0432\u044b\u0435 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u044b \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u044b \u043e\u0446\u0435\u043d\u0438\u0432\u0430\u0442\u044c \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0438 \u043a\u043b\u0430\u0441\u0441\u043e\u0432, \u0442\u043e \u0435\u0441\u0442\u044c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442 \u043c\u0435\u0442\u043e\u0434 \u00abpredict_proba\u00bb, \u0442\u043e\u0433\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440, \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u0438\u0440\u0443\u044e\u0449\u0438\u0439 \u043a\u043b\u0430\u0441\u0441 \u0441\u00a0\u043d\u0430\u0438\u0431\u043e\u043b\u044c\u0448\u0435\u0439 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c\u044e, \u0443\u0441\u0440\u0435\u0434\u043d\u0451\u043d\u043d\u044b\u0439 \u043f\u043e\u00a0\u0432\u0441\u0435\u043c \u0431\u0430\u0437\u043e\u0432\u044b\u043c \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0430\u043c. \u0422\u0430\u043a\u043e\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f <em>\u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u043e\u043c \u0441\u00a0\u043c\u044f\u0433\u043a\u0438\u043c \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u0430\u043d\u0438\u0435\u043c (soft voting classifier)<\/em> \u0438 \u0438\u043c\u0435\u0435\u0442 \u0431\u043e\u043b\u0435\u0435 \u0432\u044b\u0441\u043e\u043a\u0443\u044e \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u0437\u0430\u00a0\u0441\u0447\u0451\u0442 \u043f\u0440\u0438\u0434\u0430\u043d\u0438\u044f \u0431\u043e\u043b\u044c\u0448\u0435\u0433\u043e \u0432\u0435\u0441\u0430 \u0433\u043e\u043b\u043e\u0441\u0430\u043c \u0441\u00a0\u0432\u044b\u0441\u043e\u043a\u043e\u0439 \u0434\u043e\u0441\u0442\u043e\u0432\u0435\u0440\u043d\u043e\u0441\u0442\u044c\u044e.<\/p>\n<p>\u0412\u00a0\u0441\u043b\u0443\u0447\u0430\u0435 \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u0438 \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u044b \u0431\u0430\u0437\u043e\u0432\u044b\u0445 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432 \u0443\u0441\u0440\u0435\u0434\u043d\u044f\u044e\u0442\u0441\u044f \u0438 \u0442\u0430\u043a\u043e\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f <em>\u0440\u0435\u0433\u0440\u0435\u0441\u0441\u043e\u0440\u043e\u043c \u0441\u00a0\u0433\u043e\u043b\u043e\u0441\u043e\u0432\u0430\u043d\u0438\u0435\u043c<\/em>.<\/p>\n<p>\u0412\u00a0scikit\u2011learn \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u044b \u0438 \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u043e\u0440\u044b \u0441\u00a0\u0433\u043e\u043b\u043e\u0441\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b \u0432\u00a0\u0432\u0438\u0434\u0435 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 <em>VotingClassifier<\/em> \u0438 <em>VotingRegressor<\/em> \u0438, \u0432\u00a0\u0446\u0435\u043b\u043e\u043c, \u043e\u0442\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0442 \u043b\u0443\u0447\u0448\u0435 \u043a\u0430\u0436\u0434\u043e\u0439 \u0431\u0430\u0437\u043e\u0432\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \u043f\u043e\u00a0\u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438, \u043e\u0434\u043d\u0430\u043a\u043e \u043e\u043d\u0438 \u043f\u043e\u2011\u043f\u0440\u0435\u0436\u043d\u0435\u043c\u0443 \u043f\u043b\u043e\u0445\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0441\u00a0\u0432\u044b\u0431\u0440\u043e\u0441\u0430\u043c\u0438 \u0438 \u043f\u043e\u0434\u0432\u0435\u0440\u0436\u0435\u043d\u044b \u043f\u0435\u0440\u0435\u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044e \u0437\u0430\u00a0\u0441\u0447\u0451\u0442 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0432\u0445\u043e\u0434\u044f\u0449\u0435\u0439 \u0432\u00a0\u043d\u0438\u0445 \u043c\u043e\u0434\u0435\u043b\u0438 \u043d\u0430\u00a0\u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e\u043c \u043d\u0430\u0431\u043e\u0440\u0435 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<h4>\u0411\u044d\u0433\u0433\u0438\u043d\u0433 \u0438 \u0432\u0441\u0442\u0430\u0432\u043a\u0430<\/h4>\n<p>\u0411\u043e\u043b\u0435\u0435 \u043f\u0440\u043e\u0434\u0432\u0438\u043d\u0443\u0442\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043f\u0440\u0435\u0434\u0443\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u0442 \u043c\u043d\u043e\u0433\u043e\u043a\u0440\u0430\u0442\u043d\u043e\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043e\u0434\u043d\u043e\u0439 \u0438 \u0442\u043e\u0439 \u0436\u0435 \u0431\u0430\u0437\u043e\u0432\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438, \u043e\u0431\u0443\u0447\u0435\u043d\u043d\u043e\u0439 \u043d\u0430 \u0440\u0430\u0437\u043d\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0445 \u043f\u043e\u0434\u043d\u0430\u0431\u043e\u0440\u0430\u0445 \u0442\u0440\u0435\u043d\u0438\u0440\u043e\u0432\u043e\u0447\u043d\u043e\u0433\u043e \u0434\u0430\u0442\u0430\u0441\u0435\u0442\u0430. \u0415\u0441\u043b\u0438 \u0432\u044b\u0431\u043e\u0440\u043a\u0430 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0435\u043d\u0438\u0435\u043c, \u0442\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f\u00a0<em>\u0431\u044d\u0433\u0433\u0438\u043d\u0433\u043e\u043c (bagging \u2014 \u0441\u043e\u043a\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u043e\u0442 bootstrap aggregating)<\/em>, \u0430 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0432\u044b\u0431\u043e\u0440\u043a\u0438 \u0431\u0435\u0437 \u0437\u0430\u043c\u0435\u043d\u044b \u2014\u00a0<em>\u0432\u0441\u0442\u0430\u0432\u043a\u043e\u0439 (pasting)<\/em>.<\/p>\n<blockquote>\n<p>\u0412 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0435 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0430 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e\u0439 \u0432\u044b\u0431\u043e\u0440\u043a\u0438 \u0441 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0435\u043d\u0438\u0435\u043c \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f\u00a0\u0431\u0443\u0442\u0441\u0442\u0440\u0430\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c (bootstrapping). \u041f\u0440\u0438\u043c\u0435\u0440 \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u043d \u043d\u0438\u0436\u0435.<\/p>\n<\/blockquote>\n<figure class=\"full-width\">\n<div><figcaption><strong>\u0421\u0445\u0435\u043c\u0430 \u0431\u0443\u0442\u0441\u0442\u0440\u0430\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f<\/strong><\/figcaption><\/div>\n<\/figure>\n<p>\u041f\u043e\u0441\u043b\u0435 \u043c\u043d\u043e\u0433\u043e\u043a\u0440\u0430\u0442\u043d\u043e\u0433\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f n \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0445 \u0431\u0430\u0437\u043e\u0432\u044b\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u043d\u0430 \u0431\u0443\u0442\u0441\u0442\u0440\u0430\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0432\u044b\u0431\u043e\u0440\u043a\u0430\u0445, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 \u0430\u043d\u0441\u0430\u043c\u0431\u043b\u044c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442 \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0439 \u043f\u0440\u043e\u0433\u043d\u043e\u0437, \u043f\u0440\u043e\u0441\u0442\u043e \u0430\u0433\u0440\u0435\u0433\u0438\u0440\u0443\u044f \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u044b \u0431\u0430\u0437\u043e\u0432\u044b\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439. \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0430\u0433\u0440\u0435\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u043c\u043e\u0434\u0443, \u0430 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u0438 \u2014 \u0441\u0440\u0435\u0434\u043d\u0435\u0435 \u0430\u0440\u0438\u0444\u043c\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435. \u0422\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0443\u043c\u0435\u043d\u044c\u0448\u0438\u0442\u044c \u043a\u0430\u043a \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435, \u0442\u0430\u043a \u0438 \u0434\u0438\u0441\u043f\u0435\u0440\u0441\u0438\u044e.  <\/p>\n<figure class=\"full-width\">\n<div><figcaption><strong>\u0421\u0445\u0435\u043c\u0430 \u0440\u0430\u0431\u043e\u0442\u044b \u0431\u044d\u0433\u0433\u0438\u043d\u0433\u0430 \u0438 \u0432\u0441\u0442\u0430\u0432\u043a\u0438<\/strong><\/figcaption><\/div>\n<\/figure>\n<p>\u041a\u0430\u043a\u00a0\u043c\u043e\u0436\u043d\u043e\u00a0\u0431\u044b\u043b\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0431\u0430\u0437\u043e\u0432\u044b\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u043c\u043e\u0433\u0443\u0442 \u043e\u0431\u0443\u0447\u0430\u0442\u044c\u0441\u044f \u0438 \u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u044b \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e, \u0447\u0442\u043e\u00a0\u0434\u0435\u043b\u0430\u0435\u0442 \u0431\u044d\u0433\u0433\u0438\u043d\u0433 \u0438 \u0432\u0441\u0442\u0430\u0432\u043a\u0443 \u0445\u043e\u0440\u043e\u0448\u043e \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u0443\u0435\u043c\u044b\u043c\u0438 \u043c\u0435\u0442\u043e\u0434\u0430\u043c\u0438\u00a0\u2014 \u044d\u0442\u043e \u043e\u0434\u043d\u0430 \u0438\u0437\u00a0\u043f\u0440\u0438\u0447\u0438\u043d \u0438\u0445 \u0448\u0438\u0440\u043e\u043a\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f. \u0412\u00a0\u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 scikit\u2011learn \u0434\u043b\u044f\u00a0\u0431\u044d\u0433\u0433\u0438\u043d\u0433\u0430 <em>\u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u0430 \u0441\u00a0\u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 joblib<\/em>, \u0430\u00a0\u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0445 \u044f\u0434\u0435\u0440 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0441\u00a0\u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u00abn_jobs\u00bb (\u043f\u0440\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0438 -1\u00a0\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0432\u0441\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0435 \u044f\u0434\u0440\u0430). \u0412\u00a0\u043d\u0430\u0448\u0435\u0439 \u0440\u0443\u0447\u043d\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043c\u044b \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u043c \u0442\u0430\u043a\u0436\u0435 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e\u0435 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 \u0441\u00a0\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0434\u0430\u043d\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438.<\/p>\n<blockquote>\n<p>\u0412 \u0446\u0435\u043b\u043e\u043c, \u0431\u044d\u0433\u0433\u0438\u043d\u0433 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043b\u0443\u0447\u0448\u0435 \u0432\u0441\u0442\u0430\u0432\u043a\u0438 \u0437\u0430 \u0441\u0447\u0451\u0442 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0431\u0443\u0442\u0441\u0442\u0440\u0430\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u043e\u0437\u0434\u0430\u0451\u0442 \u0431\u043e\u043b\u0435\u0435 \u043e\u0442\u043b\u0438\u0447\u043d\u044b\u0435 \u0434\u0440\u0443\u0433 \u043e\u0442 \u0434\u0440\u0443\u0433\u0430 \u043e\u0431\u0443\u0447\u0430\u044e\u0449\u0438\u0435 \u0432\u044b\u0431\u043e\u0440\u043a\u0438.<\/p>\n<\/blockquote>\n<h4>\u041e\u0446\u0435\u043d\u043a\u0430 \u043d\u0430 \u043d\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0445 \u043e\u0431\u0440\u0430\u0437\u0446\u0430\u0445<\/h4>\n<p>\u0423\u0447\u0438\u0442\u044b\u0432\u0430\u044f, \u0447\u0442\u043e\u00a0\u043f\u0440\u0438\u00a0\u0431\u044d\u0433\u0433\u0438\u043d\u0433\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0432\u044b\u0431\u043e\u0440\u043a\u0430 \u0441\u00a0\u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0435\u043d\u0438\u0435\u043c, \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u0443\u0435\u043c\u0430\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u043c \u00abbooststrap=True\u00bb (\u0432 \u0441\u043b\u0443\u0447\u0430\u0435 False \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0432\u0441\u0442\u0430\u0432\u043a\u0430), \u0442\u043e \u0432\u00a0\u0441\u0440\u0435\u0434\u043d\u0435\u043c \u0438\u0437\u00a0m \u043e\u0431\u0443\u0447\u0430\u044e\u0449\u0438\u0445 \u043e\u0431\u0440\u0430\u0437\u0446\u043e\u0432 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0431\u0438\u0440\u0430\u0442\u044c\u0441\u044f \u043e\u043a\u043e\u043b\u043e 63% \u0434\u043b\u044f\u00a0\u043a\u0430\u0436\u0434\u043e\u0439 \u0431\u0430\u0437\u043e\u0432\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438. \u041e\u0441\u0442\u0430\u0432\u0448\u0438\u0435\u0441\u044f 37% \u043d\u0430\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f <em>\u043d\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u043c\u0438 \u043e\u0431\u0443\u0447\u0430\u044e\u0449\u0438\u043c\u0438 \u043e\u0431\u0440\u0430\u0437\u0446\u0430\u043c\u0438<\/em> (out\u2011of\u2011bag \u0438\u043b\u0438\u00a0oob), \u0447\u0442\u043e\u00a0\u043c\u043e\u0436\u043d\u043e \u043b\u0435\u0433\u043a\u043e \u0434\u043e\u043a\u0430\u0437\u0430\u0442\u044c:<\/p>\n<p>\u0421\u0442\u043e\u0438\u0442 \u0442\u0430\u043a\u0436\u0435 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0442\u0430\u043a\u0438\u0435 37% \u043f\u0440\u043e\u0446\u0435\u043d\u0442\u043e\u0432 \u043e\u0431\u0440\u0430\u0437\u0446\u043e\u0432 \u0431\u0443\u0434\u0443\u0442 \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0431\u0430\u0437\u043e\u0432\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \u0432 \u0430\u043d\u0441\u0430\u043c\u0431\u043b\u0435.<\/p>\n<p>\u0423\u0447\u0438\u0442\u044b\u0432\u0430\u044f, \u0447\u0442\u043e\u00a0\u0431\u0430\u0437\u043e\u0432\u044b\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u043d\u0435\u00a0\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 oob\u2011\u043e\u0431\u0440\u0430\u0437\u0446\u044b \u0432\u043e\u00a0\u0432\u0440\u0435\u043c\u044f \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f, \u0438\u0445 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u00a0\u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u043d\u0430\u0431\u043e\u0440\u0430 \u0438\u043b\u0438\u00a0\u043f\u0440\u0438\u00a0\u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0438 \u043a\u0440\u043e\u0441\u0441\u2011\u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438, \u0430\u00a0\u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043e\u0446\u0435\u043d\u043a\u0443 \u0432\u0441\u0435\u0433\u043e \u0430\u043d\u0441\u0430\u043c\u0431\u043b\u044f \u043c\u043e\u0436\u043d\u043e \u043f\u0443\u0442\u0435\u043c \u0443\u0441\u0440\u0435\u0434\u043d\u0435\u043d\u0438\u044f oob\u2011score \u043a\u0430\u0436\u0434\u043e\u0439 \u0431\u0430\u0437\u043e\u0432\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438, \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0432 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u00aboob_score=True\u00bb.<\/p>\n<h4>\u041c\u0435\u0442\u043e\u0434\u044b \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0445 \u0443\u0447\u0430\u0441\u0442\u043a\u043e\u0432 \u0438 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0445 \u043f\u043e\u0434\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432<\/h4>\n<p>\u0412\u044b\u0431\u043e\u0440 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0441\u0440\u0430\u0437\u0443 \u043e\u0431\u0443\u0447\u0430\u044e\u0449\u0438\u0445 \u043e\u0431\u0440\u0430\u0437\u0446\u043e\u0432 \u0438 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f\u00a0<em>\u043c\u0435\u0442\u043e\u0434\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0445 \u0443\u0447\u0430\u0441\u0442\u043a\u043e\u0432 (random patches method)<\/em>, \u0430 \u0432\u044b\u0431\u043e\u0440\u043a\u0430 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432 (bootstrap_features=True \u0438\/\u0438\u043b\u0438 max_features &lt; 1.0) \u0441 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435\u043c \u0432\u0441\u0435\u0445 \u043e\u0431\u0443\u0447\u0430\u044e\u0449\u0438\u0445 \u043e\u0431\u0440\u0430\u0437\u0446\u043e\u0432 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f\u00a0<em>\u043c\u0435\u0442\u043e\u0434\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0445 \u043f\u043e\u0434\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432 (random subspaces method)<\/em>. \u0414\u0430\u043d\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u044b \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432\u044b\u0441\u043e\u043a\u043e\u0439 \u0440\u0430\u0437\u043c\u0435\u0440\u043d\u043e\u0441\u0442\u0438.<\/p>\n<blockquote>\n<p>\u0421\u0442\u043e\u0438\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0432\u044b\u0431\u043e\u0440\u043a\u0430 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u043e\u0442\u043b\u0438\u0447\u043d\u044b\u0435 \u0434\u0440\u0443\u0433 \u043e\u0442 \u0434\u0440\u0443\u0433\u0430 \u0431\u0430\u0437\u043e\u0432\u044b\u0435 \u043c\u043e\u0434\u0435\u043b\u0438, \u0441\u043b\u0435\u0433\u043a\u0430 \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u044f \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u0438 \u0443\u043c\u0435\u043d\u044c\u0448\u0430\u044f \u0434\u0438\u0441\u043f\u0435\u0440\u0441\u0438\u044e.<\/p>\n<\/blockquote>\n<h4>\u0421\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0439 \u043b\u0435\u0441 \u0438 \u043e\u0441\u043e\u0431\u043e \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0435 \u0434\u0435\u0440\u0435\u0432\u044c\u044f<\/h4>\n<p>\u0421\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0439 \u043b\u0435\u0441 \u2014 \u044d\u0442\u043e \u0447\u0430\u0441\u0442\u043d\u044b\u0439, \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0441\u043b\u0443\u0447\u0430\u0439 \u0431\u044d\u0433\u0433\u0438\u043d\u0433\u0430 \u0438 \u0432\u0441\u0442\u0430\u0432\u043a\u0438 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0440\u0435\u0448\u0430\u044e\u0449\u0438\u0445 \u0434\u0435\u0440\u0435\u0432\u044c\u0435\u0432.<\/p>\n<p>\u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0441\u0442\u0440\u043e\u0438\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<ol>\n<li>\n<p>\u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u0441\u0442\u0440\u043e\u0438\u0442\u0441\u044f n \u0431\u0443\u0442\u0441\u0442\u0440\u0430\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0432\u044b\u0431\u043e\u0440\u043e\u043a, \u043a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u043e, \u043c\u0435\u0442\u043e\u0434\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0445 \u043f\u043e\u0434\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432;<\/p>\n<\/li>\n<li>\n<p>n \u0434\u0435\u0440\u0435\u0432\u044c\u0435\u0432 \u043e\u0431\u0443\u0447\u0430\u044e\u0442\u0441\u044f \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e \u043d\u0430 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0445 \u0432\u044b\u0431\u043e\u0440\u043a\u0430\u0445 \u0438 \u0434\u0435\u043b\u0430\u044e\u0442 \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u044b \u043d\u0430 X_test;<\/p>\n<\/li>\n<li>\n<p>\u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u044b \u0430\u0433\u0440\u0435\u0433\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u043c\u043e\u0434\u043e\u0439 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0438 \u0441\u0440\u0435\u0434\u043d\u0438\u043c \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u0438.<\/p>\n<\/li>\n<\/ol>\n<p><strong>\u0424\u043e\u0440\u043c\u0443\u043b\u044b \u0434\u043b\u044f \u0440\u0430\u0441\u0447\u0451\u0442\u043e\u0432<\/strong><\/p>\n<p>\u041f\u0440\u043e\u0433\u043d\u043e\u0437 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0433\u043e \u043b\u0435\u0441\u0430 \u0434\u043b\u044f \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u0438:<\/p>\n<p>\u041f\u0440\u043e\u0433\u043d\u043e\u0437 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0433\u043e \u043b\u0435\u0441\u0430 \u0434\u043b\u044f \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438:<\/p>\n<p>\u041f\u0440\u043e\u0433\u043d\u043e\u0437 b-\u0433\u043e \u0431\u0443\u0442\u0441\u0442\u0440\u0430\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0434\u0435\u0440\u0435\u0432\u0430 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u0438:  <\/p>\n<p>\u0421\u043f\u0440\u043e\u0433\u043d\u043e\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 b-\u0433\u043e \u0431\u0443\u0442\u0441\u0442\u0440\u0430\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0434\u0435\u0440\u0435\u0432\u0430 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438:  <\/p>\n<p>\u041c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432 \u0434\u043b\u044f \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u0438:  <\/p>\n<p>\u041c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432 \u0434\u043b\u044f \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u0438 \u0432 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 scikit-learn:  <\/p>\n<p>\u041c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432 \u0434\u043b\u044f \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438: <\/p>\n<p>\u0427\u0438\u0441\u043b\u043e \u0432\u0441\u0435\u0445 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432 \u0432 \u0434\u0430\u0442\u0430\u0441\u0435\u0442\u0435:  <\/p>\n<blockquote>\n<p>\u0414\u0435\u0440\u0435\u0432\u044c\u044f \u0432 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u043c \u043b\u0435\u0441\u0435 \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0435\u0449\u0451 \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u043c\u0438 \u0437\u0430 \u0441\u0447\u0451\u0442 \u0432\u044b\u0431\u043e\u0440\u0430 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0445 \u043f\u043e\u0440\u043e\u0433\u043e\u0432\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0430 \u0432\u043c\u0435\u0441\u0442\u043e \u043f\u043e\u0438\u0441\u043a\u0430 \u043d\u0430\u0438\u043b\u0443\u0447\u0448\u0435\u0433\u043e, \u043a\u0430\u043a \u044d\u0442\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043e \u0432 CART. \u041b\u0435\u0441 \u0441 \u0442\u0430\u043a\u0438\u043c\u0438 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u043c\u0438 \u0434\u0435\u0440\u0435\u0432\u044c\u044f\u043c\u0438 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f\u00a0<strong>\u0430\u043d\u0441\u0430\u043c\u0431\u043b\u0435\u043c \u043e\u0441\u043e\u0431\u043e \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0445 \u0434\u0435\u0440\u0435\u0432\u044c\u0435\u0432 (extremely randomized trees ensemble \u0438\u043b\u0438 extra-trees)<\/strong>. \u0412 \u043e\u0441\u043e\u0431\u043e \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0445 \u0434\u0435\u0440\u0435\u0432\u044c\u044f\u0445 \u043a\u0430\u0436\u0434\u043e\u0435 \u0434\u0435\u0440\u0435\u0432\u043e \u0435\u0449\u0451 \u0431\u043e\u043b\u0435\u0435 \u043e\u0442\u043b\u0438\u0447\u043d\u043e \u0434\u0440\u0443\u0433 \u043e\u0442 \u0434\u0440\u0443\u0433\u0430, \u0447\u0435\u043c \u0432 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u043c \u043b\u0435\u0441\u0435, \u0447\u0442\u043e \u0442\u0430\u043a\u0436\u0435 \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0435\u0442 \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u0438 \u0441\u043d\u0438\u0436\u0430\u0435\u0442 \u0434\u0438\u0441\u043f\u0435\u0440\u0441\u0438\u044e. \u041f\u043e\u043c\u0438\u043c\u043e \u044d\u0442\u043e\u0433\u043e, \u0442\u0430\u043a\u0438\u0435 \u0434\u0435\u0440\u0435\u0432\u044c\u044f \u043e\u0431\u0443\u0447\u0430\u044e\u0442\u0441\u044f \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0431\u044b\u0441\u0442\u0440\u0435\u0435.  <\/p>\n<\/blockquote>\n<h4>\u0417\u043d\u0430\u0447\u0438\u043c\u043e\u0441\u0442\u044c \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432<\/h4>\n<p>\u0415\u0449\u0451 \u043e\u0434\u043d\u0438\u043c \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u043c \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0433\u043e \u043b\u0435\u0441\u0430 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u0435 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0437\u043d\u0430\u0447\u0438\u043c\u043e\u0441\u0442\u0438 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0430, \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u043d\u0430 \u0442\u043e\u043c, \u043a\u0430\u043a \u0441\u0438\u043b\u044c\u043d\u043e \u0432 \u0443\u0437\u043b\u0430\u0445 \u0434\u0435\u0440\u0435\u0432\u0430 \u0441\u043d\u0438\u0436\u0430\u0435\u0442\u0441\u044f \u0437\u0430\u0433\u0440\u044f\u0437\u043d\u0451\u043d\u043d\u043e\u0441\u0442\u044c \u0432 \u0441\u0440\u0435\u0434\u043d\u0435\u043c \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0430. \u041f\u0440\u043e\u0449\u0435 \u0433\u043e\u0432\u043e\u0440\u044f, \u0437\u043d\u0430\u0447\u0438\u043c\u043e\u0441\u0442\u044c \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0430 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u0437\u0432\u0435\u0448\u0435\u043d\u043d\u044b\u043c \u0441\u0440\u0435\u0434\u043d\u0438\u043c, \u0433\u0434\u0435 \u0432\u0435\u0441 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0443\u0437\u043b\u0430 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0443 \u0430\u0441\u0441\u043e\u0446\u0438\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0441 \u043d\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u0446\u043e\u0432: \u0447\u0435\u043c \u0431\u043e\u043b\u044c\u0448\u0435 \u0432\u0435\u0441 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0430, \u0442\u0435\u043c \u0431\u043e\u043b\u044c\u0448\u0435 \u0435\u0433\u043e \u0432\u043a\u043b\u0430\u0434 \u0432 \u043e\u0431\u0449\u0443\u044e \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u0438.<\/p>\n<blockquote>\n<p>\u0421\u0442\u043e\u0438\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0432 \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u043c \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0438 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u043e\u0434\u0432\u0438\u043d\u0443\u0442\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0446\u0438\u0438 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u043c\u043e\u0434\u0435\u043b\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440\u00a0<a href=\"https:\/\/medium.com\/@bneeraj026\/shap-feature-importance-deep-dive-1b96a9d43d08\" rel=\"noopener noreferrer nofollow\">SHAP<\/a>\u00a0\u0438\u043b\u0438\u00a0<a href=\"https:\/\/coderzcolumn.com\/tutorials\/machine-learning\/how-to-use-lime-to-understand-sklearn-models-predictions\" rel=\"noopener noreferrer nofollow\">LIME<\/a>.<\/p>\n<\/blockquote>\n<h4>\u0418\u043c\u043f\u043e\u0440\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a<\/h4>\n<pre><code class=\"python\">import numpy as np import pandas as pd import matplotlib.pyplot as plt from sklearn.datasets import load_diabetes from sklearn.preprocessing import LabelEncoder from sklearn.model_selection import train_test_split from sklearn.metrics import accuracy_score, mean_absolute_percentage_error from sklearn.svm import SVC from sklearn.linear_model import LogisticRegression from sklearn.tree import DecisionTreeClassifier, DecisionTreeRegressor from sklearn.ensemble import RandomForestClassifier, RandomForestRegressor from sklearn.ensemble import BaggingClassifier, VotingClassifier, ExtraTreesClassifier from joblib import Parallel, delayed from mlxtend.plotting import plot_decision_regions<\/code><\/pre>\n<h4>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043d\u0430 Python \u0441 \u043d\u0443\u043b\u044f<\/h4>\n<pre><code class=\"python\">class RandomForest:     def __init__(self, regression=False, n_estimators=100, max_depth=None,                  max_features=1.0, n_jobs=-1, random_state=0, ccp_alpha=0.0):         self.regression = regression         self.n_estimators = n_estimators         self.max_depth = max_depth         self.max_features = max_features         self.n_jobs = n_jobs         self.random_state = random_state         self.ccp_alpha = ccp_alpha         self.trained_trees_info = []         self.general_random = np.random.RandomState(self.random_state)      #bootstrapping with random subspaces method     def _rsm_bootstrapping(self, X, y):         n_samples, n_features = X.shape         if self.regression:             max_features = self.max_features * n_features         else:             max_features = np.sqrt(n_features)          sample_indexes = self.general_random.choice(n_samples, n_samples)         features = self.general_random.choice(X.columns, round(max_features))         X_b, y_b = X.iloc[sample_indexes][features], y.iloc[sample_indexes]          return X_b, y_b      def _train_tree(self, X, y):         if self.regression:             tree = DecisionTreeRegressor(max_depth=self.max_depth,                                          random_state=self.random_state,                                          ccp_alpha=self.ccp_alpha)         else:             tree = DecisionTreeClassifier(max_depth=self.max_depth,                                           random_state=self.random_state,                                           ccp_alpha=self.ccp_alpha)          return tree.fit(X, y), X.columns      def fit(self, X, y):         boot_data = (self._rsm_bootstrapping(X, y) for _ in range(self.n_estimators))         train_trees = (delayed(self._train_tree)(X_b, y_b) for X_b, y_b in boot_data)         self.trained_trees_info = Parallel(n_jobs=self.n_jobs)(train_trees)      def predict(self, samples):         prediction = (delayed(tree_i.predict)(samples[tree_i_features])                       for (tree_i, tree_i_features) in self.trained_trees_info)          trees_predictions = pd.DataFrame(Parallel(n_jobs=self.n_jobs)(prediction))          if self.regression:             forest_prediction = trees_predictions.mean(axis=0)         else:             forest_prediction = trees_predictions.mode(axis=0).iloc[0]          return np.array(forest_prediction)<\/code><\/pre>\n<h4>\u041a\u043e\u0434 \u0434\u043b\u044f \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0438 \u0433\u0440\u0430\u0444\u0438\u043a\u0430<\/h4>\n<pre><code class=\"python\">def decision_boundary_plot(X, y, X_train, y_train, clf, feature_indexes, title=None):     feature1_name, feature2_name = X.columns[feature_indexes]     X_feature_columns =<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\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-371175","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/371175","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=371175"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/371175\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=371175"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=371175"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=371175"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}