{"id":370613,"date":"2024-05-21T04:29:17","date_gmt":"2024-05-21T04:29:17","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=370613"},"modified":"-0001-11-30T00:00:00","modified_gmt":"2024-05-21T04:29:17","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=370613","title":{"rendered":"<span>\u0413\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u043d\u044b\u0439 \u0431\u0443\u0441\u0442\u0438\u043d\u0433. \u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0441 \u043d\u0443\u043b\u044f \u043d\u0430 Python \u0438 \u0440\u0430\u0437\u0431\u043e\u0440 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0435\u0439 \u0435\u0433\u043e \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0439 (XGBoost, CatBoost, LightGBM)<\/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\/2fe\/d49\/5f8\/2fed495f81d152dcb60e5b7da722378d.png\" width=\"770\" height=\"441\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/2fe\/d49\/5f8\/2fed495f81d152dcb60e5b7da722378d.png\"\/><\/figure>\n<p>\u041d\u0430 \u0441\u0435\u0433\u043e\u0434\u043d\u044f\u0448\u043d\u0438\u0439 \u0434\u0435\u043d\u044c \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u043d\u044b\u0439 \u0431\u0443\u0441\u0442\u0438\u043d\u0433 (gradient boosting machine) \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0434\u043d\u0438\u043c \u0438\u0437 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 production-\u0440\u0435\u0448\u0435\u043d\u0438\u0439 \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u0442\u0430\u0431\u043b\u0438\u0447\u043d\u044b\u043c\u0438, \u043d\u0435\u043e\u0434\u043d\u043e\u0440\u043e\u0434\u043d\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043e\u0431\u043b\u0430\u0434\u0430\u0435\u0442 \u0432\u044b\u0441\u043e\u043a\u043e\u0439 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c\u044e \u0438 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c\u044e, \u0430 \u0435\u0441\u043b\u0438 \u0431\u044b\u0442\u044c \u0442\u043e\u0447\u043d\u0435\u0435, \u0442\u043e \u0435\u0433\u043e \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438, \u0440\u0435\u0447\u044c \u043e \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043f\u043e\u0439\u0434\u0451\u0442 \u0447\u0443\u0442\u044c \u043f\u043e\u0437\u0436\u0435.<\/p>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0430 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u043d\u043e\u0433\u043e \u0431\u0443\u0441\u0442\u0438\u043d\u0433\u0430 GBM \u0441 \u043d\u0443\u043b\u044f \u043d\u0430 Python, \u043d\u043e \u0430 \u0442\u0430\u043a\u0436\u0435 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u044b \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0435 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0435\u0433\u043e \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0439.<\/p>\n<blockquote>\n<p><em>\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<\/em><a href=\"https:\/\/www.kaggle.com\/code\/egazakharenko\/gradient-boosting-from-scratch-full-tutorial\" rel=\"noopener noreferrer nofollow\"><strong><em>Kaggle<\/em><\/strong><\/a><em>\u00a0(eng) \u0438\u00a0<\/em><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\/10%29%20%D0%93%D1%80%D0%B0%D0%B4%D0%B8%D0%B5%D0%BD%D1%82%D0%BD%D1%8B%D0%B9%20%D0%B1%D1%83%D1%81%D1%82%D0%B8%D0%BD%D0%B3%20%28GBM%2C%20XGBoost%2C%20CatBoost%2C%20LightGBM%29.ipynb\" rel=\"noopener noreferrer nofollow\"><strong><em>GitHub<\/em><\/strong><\/a><em>\u00a0(rus).<\/em>  <\/p>\n<\/blockquote>\n<h3>\u0421\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435<\/h3>\n<p><a href=\"#gradient_boosting_machine\" rel=\"noopener noreferrer nofollow\">Gradient Boosting Machine<\/a><\/p>\n<p><a href=\"#xgboost\" rel=\"noopener noreferrer nofollow\">\u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 XGBoost<\/a><\/p>\n<p><a href=\"#catboost\" rel=\"noopener noreferrer nofollow\">\u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 CatBoost<\/a><\/p>\n<p><a href=\"#lightgbm\" rel=\"noopener noreferrer nofollow\">\u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 LightGBM<\/a><\/p>\n<p><a href=\"#best_boosting\" rel=\"noopener noreferrer nofollow\">\u041a\u0430\u043a\u043e\u0439 \u0431\u0443\u0441\u0442\u0438\u043d\u0433 \u043b\u0443\u0447\u0448\u0435<\/a><\/p>\n<p><a class=\"anchor\" name=\"gradient_boosting_machine\" id=\"gradient_boosting_machine\"><\/a><\/p>\n<h3>Gradient Boosting Machine<\/h3>\n<p>\u041a\u0430\u043a \u0438 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441 Adaboost, \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u043d\u044b\u0439 \u0431\u0443\u0441\u0442\u0438\u043d\u0433 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u0431\u0430\u0437\u043e\u0432\u044b\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u0432 \u0430\u043d\u0441\u0430\u043c\u0431\u043b\u044c \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u043e\u0434\u043d\u0430\u043a\u043e \u0432\u043c\u0435\u0441\u0442\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0441 \u0443\u0447\u0451\u0442\u043e\u043c \u0432\u0435\u0441\u043e\u0432 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043e\u0448\u0438\u0431\u043e\u043a \u043f\u0440\u0435\u0434\u0448\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u0438\u043a\u043e\u0432, \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u043e\u0431\u0443\u0447\u0430\u044e\u0442\u0441\u044f \u043d\u0430 \u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u044b\u0445 \u043e\u0448\u0438\u0431\u043a\u0430\u0445 (residual errors), \u0434\u043e\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0445 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u043c\u0438 \u043c\u043e\u0434\u0435\u043b\u044f\u043c\u0438.<\/p>\n<h4>\u041f\u0440\u0438\u043d\u0446\u0438\u043f \u0440\u0430\u0431\u043e\u0442\u044b \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u043d\u043e\u0433\u043e \u0431\u0443\u0441\u0442\u0438\u043d\u0433\u0430 \u0434\u043b\u044f \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u0438<\/h4>\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<ul>\n<li>\n<p>1) \u043f\u0435\u0440\u0432\u043e\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u043c\u0443 \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u0443 \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0441\u0440\u0435\u0434\u043d\u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 y_train \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u043e\u0431\u0440\u0430\u0437\u0446\u043e\u0432;<\/p>\n<\/li>\n<li>\n<p>2) \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043e\u0441\u0442\u0430\u0442\u043a\u0438 \u043c\u043e\u0434\u0435\u043b\u0438 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0430\u043d\u0442\u0438\u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043f\u043e\u0442\u0435\u0440\u044c;<\/p>\n<\/li>\n<li>\n<p>3) \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u043e\u043d\u043d\u043e\u0435 \u0434\u0435\u0440\u0435\u0432\u043e \u043e\u0431\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u043d\u0430 X_train \u0438 \u043e\u0441\u0442\u0430\u0442\u043a\u0430\u0445, \u0434\u0430\u043b\u0435\u0435 \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0433\u043d\u043e\u0437 \u043d\u0430 X_train;<\/p>\n<\/li>\n<li>\n<p>4) \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 \u043f\u0440\u043e\u0433\u043d\u043e\u0437 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043a \u043f\u0435\u0440\u0432\u043e\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u043c\u0443 \u0438 \u0448\u0430\u0433\u0438 2-4 \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u044e\u0442\u0441\u044f \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0434\u0435\u0440\u0435\u0432\u0430;<\/p>\n<\/li>\n<li>\n<p>5) \u043f\u043e\u0441\u043b\u0435 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u0432\u0441\u0435\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0441\u043d\u043e\u0432\u0430 \u0441\u043e\u0437\u0434\u0430\u0451\u0442\u0441\u044f \u043f\u0435\u0440\u0432\u043e\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u0440\u043e\u0433\u043d\u043e\u0437 \u0438\u0437 \u0448\u0430\u0433\u0430 1;<\/p>\n<\/li>\n<li>\n<p>6) \u0434\u0430\u043b\u0435\u0435 \u0434\u0435\u043b\u0430\u044e\u0442\u0441\u044f \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u044b \u0434\u043b\u044f X_test \u043d\u0430 \u043e\u0431\u0443\u0447\u0435\u043d\u043d\u044b\u0445 \u0434\u0435\u0440\u0435\u0432\u044c\u044f\u0445 \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043a \u043f\u0435\u0440\u0432\u043e\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u043c\u0443;<\/p>\n<\/li>\n<li>\n<p>7) \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u0430\u044f \u0441\u0443\u043c\u043c\u0430 \u0438 \u0431\u0443\u0434\u0435\u0442 \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u043c \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u043e\u043c.<\/p>\n<\/li>\n<\/ul>\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>\u0424\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u043e\u0442\u0435\u0440\u044c: <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"L(y_i, F(x_i)) = \\frac{1}{2} (y_i - F(x_i))^2\" alt=\"L(y_i, F(x_i)) = \\frac{1}{2} (y_i - F(x_i))^2\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/541\/9b3\/34f\/5419b334f8ff3ea48f5f4ef1daea9977.svg\" width=\"253\" height=\"42\"\/> <\/p>\n<p>\u041e\u0441\u0442\u0430\u0442\u043a\u0438: <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"r_{ik} = -\\left[\\frac{\\partial L(y_i, F(x_i))}{\\partial F(x_i)}\\right]_ {F(x) = F_{m-1}(x)} = y_{i} - F_{m-1}(x_i)\" alt=\"r_{ik} = -\\left[\\frac{\\partial L(y_i, F(x_i))}{\\partial F(x_i)}\\right]_ {F(x) = F_{m-1}(x)} = y_{i} - F_{m-1}(x_i)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/6da\/42b\/9da\/6da42b9daa6caf2c03f3070035ee2ff2.svg\" width=\"434\" height=\"54\"\/> <\/p>\n<h4>\u041f\u0440\u0438\u043d\u0446\u0438\u043f \u0440\u0430\u0431\u043e\u0442\u044b \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u043d\u043e\u0433\u043e \u0431\u0443\u0441\u0442\u0438\u043d\u0433\u0430 \u0434\u043b\u044f \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438<\/h4>\n<p>\u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0434\u0435\u043b\u0430 \u043e\u0431\u0441\u0442\u043e\u044f\u0442 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0441\u043b\u043e\u0436\u043d\u0435\u0435: \u043a \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u043e\u043c\u0443 \u043a\u043b\u0430\u0441\u0441\u0443 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c one-hot encoding \u0438 \u043f\u0435\u0440\u0435\u0432\u0435\u0441\u0442\u0438 \u0432 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e softmax-\u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0430 \u043a \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u0430\u043c \u0434\u0435\u0440\u0435\u0432\u044c\u0435\u0432 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"\\gamma\" alt=\"\\gamma\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/83d\/298\/f22\/83d298f22988ea7202cbb61c01b54cc6.svg\" width=\"10\" height=\"16\"\/>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0440\u0435\u0433\u0443\u043b\u0438\u0440\u0443\u0435\u0442 \u0441\u0442\u0435\u043f\u0435\u043d\u044c \u0432\u043a\u043b\u0430\u0434\u0430 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043d\u043e\u0432\u043e\u0433\u043e \u0434\u0435\u0440\u0435\u0432\u0430 \u0432 \u043e\u0431\u0449\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c \u0434\u043b\u044f \u0441\u043d\u0438\u0436\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f. \u0422\u0430\u043a\u0436\u0435 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u043e\u0432 \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u043d\u043e\u0433\u043e \u0431\u0443\u0441\u0442\u0438\u043d\u0433\u0430 \u043c\u043e\u0436\u043d\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0443\u043b\u0443\u0447\u0448\u0438\u0442\u044c, \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0432 \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u044e K-class LogitBoost: \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0434\u0435\u0440\u0435\u0432\u0430 \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0432\u0435\u0441\u0430, \u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0442\u043e\u043c \u043d\u0430 \u0438\u0445 \u043e\u0441\u043d\u043e\u0432\u0435 \u043e\u0441\u0442\u0430\u0442\u043a\u0438.<\/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<ul>\n<li>\n<p>1) \u0434\u043b\u044f y_train \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f one-hot encoding \u0438 \u043f\u0435\u0440\u0432\u043e\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u043c\u0443 \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u0443 \u043f\u0440\u0438c\u0432\u0430\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f 0 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430;<\/p>\n<\/li>\n<li>\n<p>2) \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u044b \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u044e\u0442\u0441\u044f \u0432 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e softmax-\u0444\u0443\u043d\u043a\u0446\u0438\u0438;<\/p>\n<\/li>\n<li>\n<p>3) \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043e\u0441\u0442\u0430\u0442\u043a\u0438 \u043c\u043e\u0434\u0435\u043b\u0438 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0430\u043d\u0442\u0438\u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043f\u043e\u0442\u0435\u0440\u044c \u0438 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0435\u0439 (\u0430 \u0442\u0430\u043a\u0436\u0435 \u0432\u0435\u0441\u0430 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 LogitBoost);<\/p>\n<\/li>\n<li>\n<p>4) \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u043e\u043d\u043d\u043e\u0435 \u0434\u0435\u0440\u0435\u0432\u043e \u043e\u0431\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u043d\u0430 X_train \u0438 \u043e\u0441\u0442\u0430\u0442\u043a\u0430\u0445 (\u0430 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 LogitBoost \u0435\u0449\u0451 \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0432\u0435\u0441\u0430), \u0434\u0430\u043b\u0435\u0435 \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0433\u043d\u043e\u0437 \u043d\u0430 X_train;<\/p>\n<\/li>\n<li>\n<p>5) \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043b\u0438\u0441\u0442\u0430 \u0432 \u0434\u0435\u0440\u0435\u0432\u0435 \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u044b\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"\\gamma\" alt=\"\\gamma\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/2e7\/e4a\/e03\/2e7e4ae03e95f7f64ccccf423f1d194a.svg\" width=\"10\" height=\"16\"\/> \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043e\u0441\u0442\u0430\u0442\u043a\u043e\u0432, \u0432\u0437\u044f\u0442\u044b\u0445 \u043f\u043e \u043f\u043e\u0437\u0438\u0446\u0438\u044f\u043c \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u0439, \u043f\u043e\u043f\u0430\u0432\u0448\u0438\u0445 \u0432 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u0439 \u0432 \u043b\u0438\u0441\u0442\u043e\u0432\u043e\u0439 \u0443\u0437\u0435\u043b;<\/p>\n<\/li>\n<li>\n<p>6) \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u044b \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 \u0438 \u0441\u0443\u043c\u043c\u0430 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u043e\u0432\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"\\gamma\" alt=\"\\gamma\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/68a\/0a1\/755\/68a0a17557167dba08cc3273cfc27aac.svg\" width=\"10\" height=\"16\"\/>\u00a0\u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043a \u043f\u0435\u0440\u0432\u043e\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u043c;<\/p>\n<\/li>\n<li>\n<p>7) \u0448\u0430\u0433\u0438 2-6 \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u044e\u0442\u0441\u044f \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0434\u0435\u0440\u0435\u0432\u0430 \u0432 \u043a\u0430\u0436\u0434\u043e\u043c \u043a\u043b\u0430\u0441\u0441\u0435;<\/p>\n<\/li>\n<li>\n<p>8) \u043f\u043e\u0441\u043b\u0435 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u0432\u0441\u0435\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0441\u043e\u0437\u0434\u0430\u0451\u0442\u0441\u044f \u043f\u0435\u0440\u0432\u043e\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u0440\u043e\u0433\u043d\u043e\u0437 \u0438\u0437 \u0448\u0430\u0433\u0430 1;<\/p>\n<\/li>\n<li>\n<p>9) \u0434\u0430\u043b\u0435\u0435 \u0434\u0435\u043b\u0430\u044e\u0442\u0441\u044f \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u044b \u0434\u043b\u044f X_test \u043d\u0430 \u043e\u0431\u0443\u0447\u0435\u043d\u043d\u044b\u0445 \u0434\u0435\u0440\u0435\u0432\u044c\u044f\u0445 \u043f\u043e \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u043a\u043b\u0430\u0441\u0441\u0443 \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043a \u043f\u0435\u0440\u0432\u043e\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u043c;<\/p>\n<\/li>\n<li>\n<p>10) \u043a\u043b\u0430\u0441\u0441\u044b \u0441 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0443\u043c\u043c\u043e\u0439 \u0438 \u0431\u0443\u0434\u0443\u0442 \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u043c \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u043e\u043c.<\/p>\n<\/li>\n<\/ul>\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>\u0424\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u043e\u0442\u0435\u0440\u044c:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"L(\\{y_k, F_k(x)\\}_{1}^{K}) = -\\sum\\limits_{k=1}^{K} y_k \\ log \\ p_k(x)\" alt=\"L(\\{y_k, F_k(x)\\}_{1}^{K}) = -\\sum\\limits_{k=1}^{K} y_k \\ log \\ p_k(x)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/a45\/466\/2cb\/a454662cbabbf3832ec48de4e337ed24.svg\" width=\"308\" height=\"60\"\/><\/p>\n<p>\u0412\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"p_k(x) = softmax(F_k(x)) = \\frac{e^{F_k(x)}}{\\sum\\limits_{l=1}^{K} e^{F_l(x)}}\" alt=\"p_k(x) = softmax(F_k(x)) = \\frac{e^{F_k(x)}}{\\sum\\limits_{l=1}^{K} e^{F_l(x)}}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/e7c\/d99\/a19\/e7cd99a19832a35f5488fa56a55c1efe.svg\" width=\"308\" height=\"82\"\/><\/p>\n<p>\u041e\u0441\u0442\u0430\u0442\u043a\u0438:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"r_{ik} = -\\left[\\frac{\\partial L(\\{y_{il}, F_l(x_i)\\}_{l=1}^{K})}{\\partial F_k(x_i)}\\right]_ {\\{F_l(x) = F_{l,m-1}(x)\\}_{1}^{K}} = y_{ik} - p_{k,m-1}(x_i)\" alt=\"r_{ik} = -\\left[\\frac{\\partial L(\\{y_{il}, F_l(x_i)\\}_{l=1}^{K})}{\\partial F_k(x_i)}\\right]_ {\\{F_l(x) = F_{l,m-1}(x)\\}_{1}^{K}} = y_{ik} - p_{k,m-1}(x_i)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/7f6\/a60\/114\/7f6a601145c769365e7604bd4c74b9a7.svg\" width=\"534\" height=\"65\"\/><\/p>\n<p>\u041a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"\\gamma\" alt=\"\\gamma\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d22\/255\/660\/d2225566011230c55eef3876d6cf5ed4.svg\" width=\"10\" height=\"16\"\/> :<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"\\gamma_{jkm} = \\frac{K-1}{K} \\frac{\\sum_{x_i \\in R_{jkm}} r_{ik}} {\\sum_{x_i \\in R_{jkm}} |r_{ik}| (1 - |r_{ik}|)}\" alt=\"\\gamma_{jkm} = \\frac{K-1}{K} \\frac{\\sum_{x_i \\in R_{jkm}} r_{ik}} {\\sum_{x_i \\in R_{jkm}} |r_{ik}| (1 - |r_{ik}|)}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/5c5\/cfb\/b16\/5c5cfbb1622ff912f9b10c24b8543146.svg\" width=\"317\" height=\"60\"\/><\/p>\n<p>\u0412\u0435\u0441\u0430 \u0434\u043b\u044f K-class LogitBoost:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"w_k(x_i) = p_k(x_i) (1 - p_k(x_i))\" alt=\"w_k(x_i) = p_k(x_i) (1 - p_k(x_i))\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/c3b\/d25\/6a4\/c3bd256a4069f99a339616a7d33d4966.svg\" width=\"232\" height=\"22\"\/><\/p>\n<p>\u041e\u0441\u0442\u0430\u0442\u043a\u0438 \u0434\u043b\u044f K-class LogitBoost:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"r_{ik} = \\frac{K-1}{K} \\frac{y_{ik} - p_k(x_i)}{w_k(x_i)}\" alt=\"r_{ik} = \\frac{K-1}{K} \\frac{y_{ik} - p_k(x_i)}{w_k(x_i)}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b9e\/772\/2fb\/b9e7722fb8ee1cafe402ca7df5d0aaed.svg\" width=\"211\" height=\"50\"\/><\/p>\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.tree import DecisionTreeRegressor from sklearn.ensemble import GradientBoostingClassifier, GradientBoostingRegressor from sklearn.ensemble import HistGradientBoostingClassifier, HistGradientBoostingRegressor 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 GBMClassifier:     def __init__(self, logitboost=False, learning_rate=0.1, n_estimators=100,                  max_depth=3, random_state=0):         self.logitboost = logitboost         self.learning_rate = learning_rate         self.n_estimators = n_estimators         self.max_depth = max_depth         self.random_state = random_state      def _softmax(self, predictions):         exp = np.exp(predictions)          return exp \/ np.sum(exp, axis=1, keepdims=True)      def _compute_gammas(self, residuals, leaf_indexes, eps=1e-4):         gammas = []          for j in np.unique(leaf_indexes):             x_i = np.where(leaf_indexes == j)             numerator = np.sum(residuals[x_i])             norm_residuals_xi = np.linalg.norm(residuals[x_i]) + eps             denominator = np.sum(norm_residuals_xi * (1 - norm_residuals_xi))             gamma = (self.K - 1) \/ self.K * numerator \/ denominator             gammas.append(gamma)          return gammas      def fit(self, X, y):         self.K = len(np.unique(y))         self.trees = {k: [] for k in range(self.K)}         one_hot_y = pd.get_dummies(y).to_numpy()   # one-hot encoding         predictions = np.zeros(one_hot_y.shape)          for _ in range(self.n_estimators):             probabilities = self._softmax(predictions)              for k in range(self.K):                 if self.logitboost:   # based on K-class LogitBoost                     numerator = (one_hot_y.T[k] - probabilities.T[k])                     denominator = probabilities.T[k] * (1 - probabilities.T[k])                     residuals = (self.K - 1) \/ self.K * numerator \/ denominator                     weights = denominator                 else:                     residuals = one_hot_y.T[k] - probabilities.T[k]                     weights = None                  tree = DecisionTreeRegressor(criterion='friedman_mse', max_depth=self.max_depth,                                              random_state=self.random_state)                 tree.fit(X, residuals, sample_weight=weights)                 self.trees[k].append(tree)                  leaf_indexes = tree.apply(X)                 gammas = [] if self.logitboost else self._compute_gammas(residuals, leaf_indexes)                 predictions.T[k] += self.learning_rate * tree.predict(X) + np.sum(gammas)      def predict(self, samples):         predictions = np.zeros((len(samples), self.K))          for i in range(self.n_estimators):             for k in range(self.K):                 predictions.T[k] += self.learning_rate * self.trees[k][i].predict(samples)          return np.argmax(predictions, axis=1)<\/code><\/pre>\n<pre><code class=\"python\">class GBMRegressor:     def __init__(self, learning_rate=0.1, n_estimators=100, max_depth=3, random_state=0):         self.learning_rate = learning_rate         self.n_estimators = n_estimators         self.max_depth = max_depth         self.random_state = random_state         self.trees = []      def fit(self, X, y):         self.initial_leaf = y.mean()         predictions = np.zeros(len(y)) + self.initial_leaf          for _ in range(self.n_estimators):             residuals = y - predictions             tree = DecisionTreeRegressor(criterion='friedman_mse', max_depth=self.max_depth,                                          random_state=self.random_state)             tree.fit(X, residuals)             predictions += self.learning_rate * tree.predict(X)             self.trees.append(tree)      def predict(self, samples):         predictions = np.zeros(len(samples)) + self.initial_leaf          for i in range(self.n_estimators):             predictions += self.learning_rate * self.trees[i].predict(samples)          return predictions<\/code><\/pre>\n<h4>\u041a\u043e\u0434 \u0434\u043b\u044f \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0438 \u0440\u0435\u0448\u0430\u044e\u0449\u0438\u0445 \u0433\u0440\u0430\u043d\u0438\u0446<\/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<blockquote>\n<p><em>\u0414\u0430\u043d\u043d\u044b\u0435 \u043d\u0438\u0436\u0435 \u0431\u0443\u0434\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445 \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0439 \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u043d\u043e\u0433\u043e \u0431\u0443\u0441\u0442\u0438\u043d\u0433\u0430.<\/em><\/p>\n<\/blockquote>\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>\u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0440\u0443\u0447\u043d\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u043f\u043b\u0430\u043d\u0435 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438 \u043e\u0442 scikit-learn \u2014 \u044d\u0442\u043e \u0441\u0432\u044f\u0437\u0430\u043d\u043e \u0441 \u0442\u0435\u043c, \u0447\u0442\u043e \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0431\u043e\u043b\u0435\u0435 \u0443\u0441\u043b\u043e\u0436\u043d\u0451\u043d\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u0434\u043b\u044f \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u0440\u0430\u0441\u0447\u0451\u0442\u0430 \u043e\u0441\u0442\u0430\u0442\u043a\u043e\u0432, \u043d\u043e \u0441\u0443\u0442\u044c \u043e\u0441\u0442\u0430\u0451\u0442\u0441\u044f \u043f\u0440\u0435\u0436\u043d\u0435\u0439, \u0438 \u0432 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0435 \u0441\u043b\u0443\u0447\u0430\u0435\u0432 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a\u0436\u0435 \u043a\u0430\u043a \u0438 \u0440\u0443\u0447\u043d\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0432 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0438 \u0441 LogitBoost \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0435\u0439.<\/p>\n<p>\u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u0438, \u043e\u0448\u0438\u0431\u043a\u0430 \u0432 \u0440\u0443\u0447\u043d\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u0430\u0436\u0435 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043d\u0438\u0436\u0435, \u0447\u0435\u043c \u0432 scikit-learn \u2014 \u0440\u0430\u0437\u043b\u0438\u0447\u0438\u044f \u043d\u0435\u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u044b.<\/p>\n<blockquote>\n<p><em>\u0422\u0430\u043a\u0436\u0435 \u0441\u0442\u043e\u0438\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0432 scikit-learn \u0435\u0441\u0442\u044c \u043e\u0441\u043e\u0431\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u043d\u043e\u0433\u043e \u0431\u0443\u0441\u0442\u0438\u043d\u0433\u0430 \u2014 HistGradientBoosting \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 LightGBM, \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u043d\u0430\u044f \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0431\u043e\u043b\u044c\u0448\u0438\u043c\u0438 \u043d\u0430\u0431\u043e\u0440\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0445, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u0442\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0431\u044b\u0441\u0442\u0440\u0435\u0435 \u0438 \u0447\u0430\u0449\u0435 \u043b\u0443\u0447\u0448\u0435, \u0447\u0435\u043c \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u043d\u044b\u0439 \u0431\u0443\u0441\u0442\u0438\u043d\u0433.<\/em><\/p>\n<\/blockquote>\n<p>\u041f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u044b \u043d\u0438\u0436\u0435.<\/p>\n<p><strong>GBMClassifier<\/strong>  <\/p>\n<pre><code class=\"python\">gbc = GBMClassifier(random_state=0) gbc.fit(X1_train, y1_train) gbc_pred_res = gbc.predict(X1_test) gbc_accuracy = accuracy_score(gbc_pred_res, y1_test) print(f'gbc accuracy: {gbc_accuracy}') print(gbc_pred_res)   gbc accuracy: 0.6111111111111112 [5 0 1 4 1 1 0 1 1 1 1 0 1 1 1 5 0 1 1 1 5 0 5 5 1 0 5 0 1 0 0 4 1 0 0 0 0  0 0 5 1 4 1 0 0 1 0 1 0 1 0 3 5 0]<\/code><\/pre>\n<p><strong>GBMClassifier \u0441 \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u0435\u0439 LogitBoost<\/strong>  <\/p>\n<pre><code class=\"python\">logit_bc = GBMClassifier(logitboost=True, random_state=0) logit_bc.fit(X1_train, y1_train) logit_bc_pred_res = logit_bc.predict(X1_test) logit_bc_accuracy = accuracy_score(logit_bc_pred_res, y1_test) print(f'logit_gbc accuracy: {logit_bc_accuracy}') print(logit_bc_pred_res)   logit_gbc accuracy: 0.6666666666666666 [5 0 1 4 1 1 0 1 1 1 1 0 0 1 1 5 2 1 1 0 3 0 5 1 2 0 5 0 0 1 0 0 1 0 0 0 0  2 0 5 1 4 1 0 1 1 0 1 0 1 0 1 5 0]<\/code><\/pre>\n<p><strong>GradientBoostingClassifier (scikit-learn)<\/strong>  <\/p>\n<pre><code class=\"python\">sk_gbc = GradientBoostingClassifier(random_state=0) sk_gbc.fit(X1_train, y1_train) sk_gbc_pred_res = sk_gbc.predict(X1_test) sk_gbc_accuracy = accuracy_score(sk_gbc_pred_res, y1_test) print(f'sk_gbc accuracy: {sk_gbc_accuracy}') print(sk_gbc_pred_res)  feature_indexes = [1, 3] title1 = 'GradientBoostingClassifier surface' decision_boundary_plot(X1, y1, X1_train, y1_train, sk_gbc, feature_indexes, title1)   sk_gbc accuracy: 0.6666666666666666 [5 0 1 4 1 1 0 1 1 1 1 0 1 1 1 5 2 1 2 0 1 0 5 5 0 0 5 0 0 1 0 0 1 0 1 0 0  0 0 5 1 1 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\/4fc\/6e4\/5f8\/4fc6e45f8c882225bdbe012b4a633af8.png\" width=\"554\" height=\"455\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/4fc\/6e4\/5f8\/4fc6e45f8c882225bdbe012b4a633af8.png\"\/><\/figure>\n<p><strong>HistGradientBoostingClassifier (scikit-learn)<\/strong><\/p>\n<pre><code class=\"python\">sk_hist_gbc = HistGradientBoostingClassifier(random_state=0) sk_hist_gbc.fit(X1_train, y1_train) sk_hist_gbc_pred_res = sk_hist_gbc.predict(X1_test) sk_hist_gbc_accuracy = accuracy_score(sk_hist_gbc_pred_res, y1_test) print(f'sk_hist_gbc accuracy: {sk_hist_gbc_accuracy}') print(sk_hist_gbc_pred_res)  feature_indexes = [1, 3] title2 = 'HistGradientBoostingClassifier surface' decision_boundary_plot(X1, y1, X1_train, y1_train, sk_hist_gbc, feature_indexes, title2)   sk_hist_gbc accuracy: 0.7407407407407407 [5 0 1 4 1 1 0 1 1 1 0 1 0 1 1 5 2 1 0 2 3 0 5 5 0 0 5 0 1 1 0 0 1 0 0 0 0  2 0 5 1 4 1 0 0 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\/c94\/6e0\/f2d\/c946e0f2d049bbdfd324c984052e2fca.png\" width=\"554\" height=\"455\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/c94\/6e0\/f2d\/c946e0f2d049bbdfd324c984052e2fca.png\"\/><\/figure>\n<p><strong>GBMRegressor<\/strong><\/p>\n<pre><code class=\"python\">gbr = GBMRegressor(random_state=0) gbr.fit(X2_train, y2_train) gbr_pred_res = gbr.predict(X2_test) mape = mean_absolute_percentage_error(gbr_pred_res, y2_test) print(f'gbr mape: {mape}') print(gbr_pred_res)   gbr mape: 0.3422881238725283 [255.26058697 236.87383554 189.22369747 111.4291292  195.31958776  249.2293251   97.46956406 205.91110801 133.47952304 240.88679883  187.19018483 171.09963906 132.63933991  86.28964353 286.56077589  105.78347251 161.94686043  72.58069452 105.92470096 236.52718059  178.31146418 127.93036968 164.16563703 147.68681371 229.72747212  194.16656023 142.44300193  68.79177464 237.21638657 163.36730299  228.0338107   85.82843049 122.42781509 153.99332065 133.44848601  159.00754731 151.98981608 147.1238119   88.56372077 200.84785209  111.32129613 157.60108633 137.94395538 173.39402287 176.29284757   62.85019316 109.646804   124.14982054  83.45697583 266.40618239  141.2307366   42.05033124 163.57898214 149.92213387 230.37326368  226.98842404 176.95426024 128.73302071  94.7641018  180.13853236  242.31821245 147.52903035 130.45931832  97.32617479 246.70709949  155.26338705  88.36785447 243.39330218 215.93042351  57.89243255   87.76236479 138.21222825 101.23449416 140.80521012 128.63575744  180.15062966 126.14000544 220.28212417 272.05642136 203.4384734  135.96206295 180.87259854  55.62066017 241.84218009 137.19320157   85.57441147 154.16763601 198.15465153 107.34659467 158.72672412  102.17554103 114.4602227   70.44016611 165.66282053 108.02991765   87.88855231 218.47152891 250.1208086  131.93276827 164.8880371  174.16393905 119.21512394 150.9405975   93.44225978 234.7444088  139.46581273 248.28728947 276.8291188  121.36081625  77.12248695  252.1021757 ]<\/code><\/pre>\n<p><strong>GradientBoostingRegressor (scikit-learn)<\/strong><\/p>\n<pre><code class=\"python\">sk_gbr = GradientBoostingRegressor(random_state=0) sk_gbr.fit(X2_train, y2_train) sk_gbr_pred_res = sk_gbr.predict(X2_test) sk_mape = mean_absolute_percentage_error(sk_gbr_pred_res, y2_test) print(f'sk_gbr mape: {sk_mape}') print(sk_gbr_pred_res)   sk_gbr mape: 0.34315075601365186 [255.26058697 236.87383554 189.22369747 111.4291292  195.31958776  249.2293251   97.46956406 205.91110801 133.47952304 240.88679883  187.19018483 171.09963906 132.63933991  86.28964353 286.56077589  105.78347251 161.94686043  72.58069452 105.92470096 236.52718059  182.08417504 127.93036968 164.16563703 147.68681371 229.72747212  194.16656023 142.44300193  68.79177464 237.21638657 163.36730299  223.14955275  85.82843049 122.42781509 153.99332065 133.44848601  159.00754731 151.98981608 147.1238119   88.56372077 200.84785209  117.71059889 157.60108633 137.94395538 173.39402287 176.29284757   62.85019316 109.646804   124.14982054  83.45697583 266.40618239  141.2307366   42.05033124 163.57898214 149.92213387 230.37326368  226.98842404 176.95426024 128.73302071  94.7641018  180.13853236  242.31821245 147.52903035 131.71442058  97.32617479 246.70709949  155.26338705  88.36785447 243.39330218 215.93042351  54.04270734   87.76236479 138.21222825 101.23449416 140.80521012 128.63575744  180.15062966 126.14000544 220.28212417 272.05642136 203.4384734  135.96206295 180.87259854  55.62066017 241.84218009 137.19320157   85.57441147 154.16763601 198.15465153 107.34659467 158.72672412  102.17554103 114.4602227   70.44016611 165.66282053 108.02991765   87.88855231 218.47152891 247.93843617 131.93276827 164.8880371  174.16393905 119.21512394 150.9405975   93.44225978 234.7444088  139.46581273 248.28728947 286.90898175 121.36081625  77.12248695  252.1021757 ]<\/code><\/pre>\n<p><strong>HistGradientBoostingRegressor (scikit-learn)<\/strong><\/p>\n<pre><code class=\"python\">sk_hist_gbr = HistGradientBoostingRegressor(random_state=0) sk_hist_gbr.fit(X2_train, y2_train) sk_hist_gbr_pred_res = sk_hist_gbr.predict(X2_test) sk_hist_mape = mean_absolute_percentage_error(sk_hist_gbr_pred_res, y2_test) print(f'sk_hist_gbr mape: {sk_hist_mape}') print(sk_hist_gbr_pred_res)   sk_hist_gbr mape: 0.3625770694795175 [264.59007545 243.59190524 180.62442773 108.53165744 195.17695513  258.1710931  112.67894454 239.18006052 144.50027011 244.02461776  180.19087697 171.2628973  142.6966707   94.26236013 301.44493762   90.25622203 154.82566511  75.43291346  96.36987316 230.14565012  196.50928346 134.41863815 167.28719774 118.51218378 209.75431111  176.46248808 113.40188129  68.47515467 248.57638999 116.15751993  195.54397416  59.94733366 153.03012884 165.84819847 135.95402508  133.54279177 190.26058998 153.08963938  86.65214731 185.07312005  110.00197459 142.99434304 111.32566034 205.63519803 163.76035901   68.26003406 118.15074567 101.01137587  57.54356002 247.29839792  140.32714196  41.87878548 149.89720974 189.08931404 251.48016218  175.76119949 160.38118455 110.76716142 107.00114228 154.75409577  256.3194536  148.8935956  119.32752592  78.65118163 252.18315433  122.833807    92.10033912 219.56310647 199.35553751  87.27114699   78.83529151 114.14943246  86.07433503 110.44443265 126.1152782  193.58960355 125.06171193 207.62012728 297.41734601 206.57210109  121.92170504 194.37322797  69.66978916 260.97214455  99.77944002  104.34927662 131.51094535 200.0857846  114.70076625 144.92225838  107.08233694  84.70304021  65.20782844 156.77203859  93.87016441  117.10361355 213.79169982 258.68468943 129.45477593 140.06443861  176.72311312 107.95798342 172.45179867 115.75603211 240.83612061  102.2339954  249.6969811  293.80624063 110.47825419  73.86099524  238.42985813]<\/code><\/pre>\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 \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u043d\u043e\u0433\u043e \u0431\u0443\u0441\u0442\u0438\u043d\u0433\u0430 (GBM)<\/h4>\n<p><em><u>\u041f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430<\/u><\/em>:<\/p>\n<ul>\n<li>\n<p>\u0432\u044b\u0441\u043e\u043a\u0430\u044f \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c;<\/p>\n<\/li>\n<li>\n<p>\u0445\u043e\u0440\u043e\u0448\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 \u043d\u0435\u043e\u0434\u043d\u043e\u0440\u043e\u0434\u043d\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438;<\/p>\n<\/li>\n<li>\n<p>\u043b\u0435\u0436\u0438\u0442 \u0432 \u043e\u0441\u043d\u043e\u0432\u0435 \u0434\u0440\u0443\u0433\u0438\u0445 \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0439 \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u043d\u043e\u0433\u043e \u0431\u0443\u0441\u0442\u0438\u043d\u0433\u0430.<\/p>\n<\/li>\n<\/ul>\n<p><em><u>\u041d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u0438<\/u><\/em>:<\/p>\n<ul>\n<li>\n<p>\u043d\u0438\u0437\u043a\u0430\u044f \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u0431\u043e\u043b\u044c\u0448\u0438\u043c\u0438 \u0434\u0430\u0442\u0430\u0441\u0435\u0442\u0430\u043c\u0438;<\/p>\n<\/li>\n<li>\n<p>\u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0430\u043c\u0438;<\/p>\n<\/li>\n<li>\n<p>\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u0435\u0440\u0435\u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u0438\u0437-\u0437\u0430 \u043f\u043b\u043e\u0445\u043e\u0439 \u043f\u0440\u0435\u0434\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<\/li>\n<\/ul>\n<blockquote>\n<p><em>\u0421\u0442\u043e\u0438\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0432\u044b\u0448\u0435\u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u0435 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u0438 \u0431\u044b\u043b\u0438 \u0443\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u044b \u0447\u0430\u0441\u0442\u0438\u0447\u043d\u043e \u043b\u0438\u0431\u043e \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0432 \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f\u0445 \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u043d\u043e\u0433\u043e \u0431\u0443\u0441\u0442\u0438\u043d\u0433\u0430, \u043f\u0440\u043e \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u0435\u0439\u0447\u0430\u0441 \u0438 \u043f\u043e\u0439\u0434\u0451\u0442 \u0440\u0435\u0447\u044c.<\/em><\/p>\n<\/blockquote>\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 \u00abGreedy Function Approximation: A Gradient Boosting Machine\u00bb, Jerome H. Friedman.<\/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#gradient-boosted-trees\" rel=\"noopener noreferrer nofollow\">\u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u043d\u043e\u0433\u043e \u0431\u0443\u0441\u0442\u0438\u043d\u0433\u0430<\/a>;<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/scikit-learn.org\/stable\/modules\/generated\/sklearn.ensemble.GradientBoostingClassifier.html\" rel=\"noopener noreferrer nofollow\">GradientBoostingClassifier<\/a>;<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/scikit-learn.org\/stable\/modules\/generated\/sklearn.ensemble.GradientBoostingRegressor.html\" rel=\"noopener noreferrer nofollow\">GradientBoostingRegressor<\/a>;<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/scikit-learn.org\/stable\/modules\/generated\/sklearn.ensemble.HistGradientBoostingClassifier.html\" rel=\"noopener noreferrer nofollow\">HistGradientBoostingClassifier<\/a>;<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/scikit-learn.org\/stable\/modules\/generated\/sklearn.ensemble.HistGradientBoostingRegressor.html\" rel=\"noopener noreferrer nofollow\">HistGradientBoostingRegressor<\/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=-b6Y1DDxvL4&amp;t=3271s&amp;ab_channel=ComputerScienceCenter\" rel=\"noopener noreferrer nofollow\">\u043e\u0434\u0438\u043d<\/a>;<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/www.youtube.com\/watch?v=V_-BSY7hLC0&amp;list=PLgaemU2xZlTgJhfBHnolmS-8WwsFifnFn&amp;index=11&amp;ab_channel=meanxai\" rel=\"noopener noreferrer nofollow\">\u0434\u0432\u0430<\/a>;<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/www.youtube.com\/watch?v=wPqtzj5VZus&amp;ab_channel=H2O.ai\" rel=\"noopener noreferrer nofollow\">\u0442\u0440\u0438<\/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 Gradient Boosting:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/www.youtube.com\/watch?v=3CC4N4z3GJc&amp;ab_channel=StatQuestwithJoshStarmer\" rel=\"noopener noreferrer nofollow\">\u043e\u0434\u0438\u043d<\/a>;<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/www.youtube.com\/watch?v=2xudPOBz-vs&amp;t=981s&amp;ab_channel=StatQuestwithJoshStarmer\" rel=\"noopener noreferrer nofollow\">\u0434\u0432\u0430<\/a>;<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/www.youtube.com\/watch?v=jxuNLH5dXCs&amp;t=2s&amp;ab_channel=StatQuestwithJoshStarmer\" rel=\"noopener noreferrer nofollow\">\u0442\u0440\u0438<\/a>;<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/www.youtube.com\/watch?v=StWY5QWMXCw&amp;t=1942s&amp;ab_channel=StatQuestwithJoshStarmer\" rel=\"noopener noreferrer nofollow\">\u0447\u0435\u0442\u044b\u0440\u0435<\/a>.<\/p>\n<\/li>\n<\/ul>\n<hr\/>\n<p><a class=\"anchor\" name=\"xgboost\" id=\"xgboost\"><\/a><\/p>\n<h3>\u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 XGBoost<\/h3>\n<p>XGBoost (Extreme Gradient Boosting) \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f, \u043f\u043e\u0436\u0430\u043b\u0443\u0439, \u0441\u0430\u043c\u043e\u0439 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u043e\u0439 \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0435\u0439 \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u043d\u043e\u0433\u043e \u0431\u0443\u0441\u0442\u0438\u043d\u0433\u0430 \u043d\u0430 \u0441\u0435\u0433\u043e\u0434\u043d\u044f\u0448\u043d\u0438\u0439 \u0434\u0435\u043d\u044c, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0431\u044b\u043b\u043e \u0432\u044b\u0438\u0433\u0440\u0430\u043d\u043e \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0441\u043e\u0440\u0435\u0432\u043d\u043e\u0432\u0430\u043d\u0438\u0439 \u043d\u0430 Kaggle. \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u0440\u0438\u0447\u0438\u043d\u044b \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0442\u0430\u043a \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u043e.<\/p>\n<p>\u0412 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 GBM \u0432 XGboost \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u0440\u043e\u0433\u043d\u043e\u0437 \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u0434\u0435\u0440\u0435\u0432\u0430 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"f_0 (x) = 0.5\" alt=\"f_0 (x) = 0.5\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d19\/506\/eee\/d19506eeee59760c92a9efa5e87b9eaa.svg\" width=\"95\" height=\"22\"\/>\u00a0\u0438 \u0432\u043c\u0435\u0441\u0442\u043e \u043f\u043d\u0435\u0439 \u0441 \u0433\u043b\u0443\u0431\u0438\u043d\u043e\u0439 3 \u0431\u0435\u0440\u0443\u0442\u0441\u044f \u0431\u043e\u043b\u0435\u0435 \u0433\u043b\u0443\u0431\u043e\u043a\u0438\u0435 \u0434\u0435\u0440\u0435\u0432\u044c\u044f \u0441 \u043b\u0438\u0441\u0442\u044c\u044f\u043c\u0438 \u0432 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0435 \u043e\u0442 8 \u0434\u043e 32 \u043a\u0430\u043a \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u0438, \u0442\u0430\u043a \u0438 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438, \u0430 \u043a \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043f\u043e\u0442\u0435\u0440\u044c \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u0438\u0437\u0430\u0446\u0438\u044f (L1 \u0438\u043b\u0438 L2 \u043d\u0430 \u0432\u044b\u0431\u043e\u0440), \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0448\u0442\u0440\u0430\u0444\u0443\u0435\u0442 \u0434\u0435\u0440\u0435\u0432\u043e \u0441 \u0432\u044b\u0441\u043e\u043a\u043e\u0439 \u0441\u0443\u043c\u043c\u043e\u0439 \u043d\u043e\u0440\u043c\u044b \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0432 \u043b\u0438\u0441\u0442\u044c\u044f\u0445. \u0414\u0430\u043d\u043d\u0430\u044f \u0441\u0443\u043c\u043c\u0430 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0430 \u0432 \u0432\u0438\u0434\u0435 \u0446\u0435\u043b\u0435\u0432\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0440\u0430\u0441\u0447\u0451\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0440\u0430\u0437\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c \u0432 \u0440\u044f\u0434 \u0422\u0435\u0439\u043b\u043e\u0440\u0430 2-\u0433\u043e \u043f\u043e\u0440\u044f\u0434\u043a\u0430.<\/p>\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>\u0426\u0435\u043b\u0435\u0432\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"Obj^{\\ t} = \\sum\\limits_{i=1}^{N} L(y_i, \\hat{y_i}^{(t-1)} + f_t(x_i)) + \\Omega(f_t)\" alt=\"Obj^{\\ t} = \\sum\\limits_{i=1}^{N} L(y_i, \\hat{y_i}^{(t-1)} + f_t(x_i)) + \\Omega(f_t)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/96e\/1b3\/602\/96e1b36022bfd16e15517e108336a940.svg\" width=\"345\" height=\"60\"\/><\/p>\n<p>L2-\u0440\u0435\u0433\u0443\u043b\u044f\u0440\u0438\u0437\u0430\u0446\u0438\u044f:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"\\Omega(f_t) = \\gamma \\ T + \\frac{1}{2} \\lambda||w||^2\" alt=\"\\Omega(f_t) = \\gamma \\ T + \\frac{1}{2} \\lambda||w||^2\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/2ae\/7b1\/a39\/2ae7b1a39639e7b3fe5364afb3e050e5.svg\" width=\"195\" height=\"42\"\/><\/p>\n<p>\u0410\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u044f \u0446\u0435\u043b\u0435\u0432\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0440\u0430\u0437\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c \u0432 \u0440\u044f\u0434 \u0422\u0435\u0439\u043b\u043e\u0440\u0430 2-\u0433\u043e \u043f\u043e\u0440\u044f\u0434\u043a\u0430:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"Obj^{\\ t} \\approx \\sum\\limits_{i=1}^{N} [L(y_i, \\hat{y_i}^{(t-1)}) + g_i f_t(x_i) + \\frac{1}{2} h_i f_t^2(x_i) ] + \\gamma \\ T + \\frac{1}{2} \\lambda \\sum\\limits_{j=1}^{T} w_j^2 = \\\\ = \\sum\\limits_{j=1}^{T} [(\\sum\\limits_{i \\in I_j}g_i) w_j + \\frac{1}{2} (\\sum\\limits_{i \\in I_j}h_i + \\lambda) w_j^2 ] + \\gamma \\ T\" alt=\"Obj^{\\ t} \\approx \\sum\\limits_{i=1}^{N} [L(y_i, \\hat{y_i}^{(t-1)}) + g_i f_t(x_i) + \\frac{1}{2} h_i f_t^2(x_i) ] + \\gamma \\ T + \\frac{1}{2} \\lambda \\sum\\limits_{j=1}^{T} w_j^2 = \\\\ = \\sum\\limits_{j=1}^{T} [(\\sum\\limits_{i \\in I_j}g_i) w_j + \\frac{1}{2} (\\sum\\limits_{i \\in I_j}h_i + \\lambda) w_j^2 ] + \\gamma \\ T\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f56\/7f2\/50e\/f567f250e7f037c29906a07341935778.svg\" width=\"697\" height=\"131\"\/><\/p>\n<p>\u0413\u0434\u0435:<\/p>\n<ul>\n<li>\n<p>\u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u043f\u043e\u0440\u044f\u0434\u043a\u0430: <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"g_i\" alt=\"g_i\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/2a3\/558\/8f1\/2a35588f19d94e38e7a0e6733554f334.svg\" width=\"16\" height=\"15\"\/>;<\/p>\n<\/li>\n<li>\n<p>\u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442 \u0432\u0442\u043e\u0440\u043e\u0433\u043e \u043f\u043e\u0440\u044f\u0434\u043a\u0430 (\u0433\u0435\u0441\u0441\u0438\u0430\u043d): <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"h_i\" alt=\"h_i\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/de1\/d4c\/044\/de1d4c044f37112fab70966223b0c17d.svg\" width=\"18\" height=\"20\"\/>;<\/p>\n<\/li>\n<li>\n<p>\u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u0438\u0437\u0430\u0446\u0438\u0438: <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"\\gamma, \\lambda\" alt=\"\\gamma, \\lambda\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/9b1\/e1c\/fa0\/9b1e1cfa0bef49b401c3721018201677.svg\" width=\"30\" height=\"21\"\/>.<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u0440\u0438\u0431\u043b\u0438\u0436\u0435\u043d\u0438\u0435 \u0432\u0442\u043e\u0440\u043e\u0433\u043e \u043f\u043e\u0440\u044f\u0434\u043a\u0430 \u0443\u0434\u043e\u0431\u043d\u043e \u0441 \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u0447\u043b\u0435\u043d\u043e\u0432 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u0439 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0439 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0438 \u0438 \u0431\u043e\u043b\u044c\u0448\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0430 \u043e\u0434\u0438\u043d \u0440\u0430\u0437 \u0438 \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0430 \u043a\u0430\u043a \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0430 \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u0440\u0430\u0437\u0431\u0438\u0435\u043d\u0438\u0439, \u0438 \u0432 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435, \u0447\u0442\u043e \u043e\u0441\u0442\u0430\u0451\u0442\u0441\u044f \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u044c \u2014 \u044d\u0442\u043e  <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"f_t(x_i) \" alt=\"f_t(x_i) \" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b86\/5b6\/678\/b865b6678b5f875f416184349659304b.svg\" width=\"49\" height=\"22\"\/>\u0438 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"\\Omega(f_t)\" alt=\"\\Omega(f_t)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/617\/fe6\/b21\/617fe6b219ba1bd550ba6bdc07fb3f40.svg\" width=\"45\" height=\"22\"\/>.<\/p>\n<p>\u041e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432\u0435\u0441\u0430 j-\u0433\u043e \u043b\u0438\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u0443\u0437\u043b\u0430 \u0432 \u0434\u0435\u0440\u0435\u0432\u0435 \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"w^*_j = -\\frac{\\sum_{i \\in I_j} g_i}{\\sum_{i \\in I_j} h_i + \\lambda}\" alt=\"w^*_j = -\\frac{\\sum_{i \\in I_j} g_i}{\\sum_{i \\in I_j} h_i + \\lambda}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/aed\/796\/f24\/aed796f24e7da823202c893d26a5d3d0.svg\" width=\"173\" height=\"60\"\/><\/p>\n<p>\u041c\u0435\u0440\u0430 \u0437\u0430\u0433\u0440\u044f\u0437\u043d\u0451\u043d\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0438\u0437 \u0441\u0435\u0431\u044f \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0434\u0435\u0440\u0435\u0432\u0430 q \u0438 \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"Obj^{\\ t} = -\\frac{1}{2} \\sum\\limits_{j=1}^{T} \\frac{(\\sum_{i \\in I_j} g_i)^2}{\\sum_{i \\in I_j} h_i + \\lambda} + \\gamma \\ T\" alt=\"Obj^{\\ t} = -\\frac{1}{2} \\sum\\limits_{j=1}^{T} \\frac{(\\sum_{i \\in I_j} g_i)^2}{\\sum_{i \\in I_j} h_i + \\lambda} + \\gamma \\ T\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/9b5\/cbd\/fbd\/9b5cbdfbdace22d797bdc5625c07b800.svg\" width=\"297\" height=\"63\"\/><\/p>\n<p>\u0427\u0435\u043c \u043c\u0435\u043d\u044c\u0448\u0435 \u044d\u0442\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u0442\u0435\u043c \u043b\u0443\u0447\u0448\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0434\u0435\u0440\u0435\u0432\u0430.<\/p>\n<p>\u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 \u0432\u0441\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u0434\u0440\u0435\u0432\u043e\u0432\u0438\u0434\u043d\u044b\u0445 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440 \u0438 \u0432\u044b\u0431\u043e\u0440 \u043d\u0430\u0438\u043b\u0443\u0447\u0448\u0435\u0439 \u0432\u0435\u0441\u044c\u043c\u0430 \u043e\u0441\u043b\u043e\u0436\u043d\u0451\u043d, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u0443\u044e \u0437\u0430\u0434\u0430\u0447\u0443, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044f \u043f\u043e \u043e\u0434\u043d\u043e\u043c\u0443 \u0440\u0430\u0437\u0431\u0438\u0435\u043d\u0438\u044e \u0443\u0437\u043b\u0430 \u0434\u0435\u0440\u0435\u0432\u0430 \u0437\u0430 \u0440\u0430\u0437. \u0412 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438, \u043c\u044b \u0438\u0442\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0432\u0435\u0442\u0432\u0438 \u043a \u0434\u0435\u0440\u0435\u0432\u0443, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0436\u0430\u0434\u043d\u044b\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c, \u0430 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u043f\u0440\u0438\u0440\u043e\u0441\u0442 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"gain = \\frac{1}{2} \\left[\\frac{(\\sum_{i \\in I_L} g_i)^2}{\\sum_{i \\in I_L} h_i + \\lambda} + \\frac{(\\sum_{i \\in I_R} g_i)^2}{\\sum_{i \\in I_R} h_i + \\lambda} - \\frac{(\\sum_{i \\in I} g_i)^2}{\\sum_{i \\in I} h_i + \\lambda} \\right] - \\gamma\" alt=\"gain = \\frac{1}{2} \\left[\\frac{(\\sum_{i \\in I_L} g_i)^2}{\\sum_{i \\in I_L} h_i + \\lambda} + \\frac{(\\sum_{i \\in I_R} g_i)^2}{\\sum_{i \\in I_R} h_i + \\lambda} - \\frac{(\\sum_{i \\in I} g_i)^2}{\\sum_{i \\in I} h_i + \\lambda} \\right] - \\gamma\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f5b\/12a\/6bb\/f5b12a6bb413ed6b0d9b408f0a64e740.svg\" width=\"516\" height=\"61\"\/><\/p>\n<p>\u0418\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u043f\u0440\u0438\u0440\u043e\u0441\u0442 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0447\u0438\u0441\u0442\u043e\u0442\u044b \u0443\u0437\u043b\u0430 \u043f\u043e\u0441\u043b\u0435 \u0435\u0433\u043e \u0440\u0430\u0437\u0431\u0438\u0435\u043d\u0438\u044f. \u0415\u0433\u043e \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u0438\u043b\u0443\u0447\u0448\u0435\u043c\u0443 \u043f\u043e\u0440\u043e\u0433\u043e\u0432\u043e\u043c\u0443 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e (\u043a\u0440\u0438\u0442\u0435\u0440\u0438\u044e \u0440\u0430\u0437\u0431\u0438\u0435\u043d\u0438\u044f) \u0443\u0437\u043b\u0430 \u0432 \u0434\u0435\u0440\u0435\u0432\u0435.<\/p>\n<blockquote>\n<p><em>\u0421\u0442\u043e\u0438\u0442 \u0442\u0430\u043a\u0436\u0435 \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u044c, \u0447\u0442\u043e \u0432 XGBoost \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0432\u044b\u0431\u043e\u0440 \u043b\u0438\u043d\u0435\u0439\u043d\u044b\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0431\u0430\u0437\u043e\u0432\u044b\u0445, \u043d\u043e, \u0432 \u0446\u0435\u043b\u043e\u043c, \u043e\u043d\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0445\u0443\u0436\u0435 \u0434\u0435\u0440\u0435\u0432\u044c\u0435\u0432.<\/em><\/p>\n<\/blockquote>\n<h4>\u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u0432 XGBoost<\/h4>\n<p><strong>Weighted quantile sketch<\/strong><\/p>\n<p>\u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0431\u043e\u043b\u044c\u0448\u0438\u043c\u0438 \u043d\u0430\u0431\u043e\u0440\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 XGBoost \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u0438\u0431\u043b\u0438\u0436\u0451\u043d\u043d\u044b\u0439 \u0436\u0430\u0434\u043d\u044b\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c. \u042d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u0432\u043c\u0435\u0441\u0442\u043e \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0432\u0441\u0435\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u043f\u043e\u0440\u043e\u0433\u043e\u0432\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043c\u044b \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u0432\u0430\u043d\u0442\u0438\u043b\u0438. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0440\u0430\u0441\u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u0438\u0432\u0430\u043d\u0438\u0435 \u0434\u043b\u044f \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043d\u0430\u0431\u043e\u0440\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0432\u0435\u0442\u0432\u0435\u0439 \u0432 \u043a\u0430\u0436\u0434\u043e\u043c \u0434\u0435\u0440\u0435\u0432\u0435 \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e \u0434\u0440\u0443\u0433 \u043e\u0442 \u0434\u0440\u0443\u0433\u0430 \u0447\u0442\u043e\u0431\u044b \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044f\u0434\u0435\u0440 \u043c\u043e\u0433\u043b\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u043d\u0438\u043c\u0438 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e, \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0432\u0437\u0432\u0435\u0448\u0435\u043d\u043d\u044b\u0445 \u043a\u0432\u0430\u043d\u0442\u0438\u043b\u0435\u0439 (weighted quantile sketch) \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u043f\u0440\u0438\u0431\u043b\u0438\u0436\u0451\u043d\u043d\u0443\u044e \u0433\u0438\u0441\u0442\u043e\u0433\u0440\u0430\u043c\u043c\u0443, \u0440\u0430\u0437\u0434\u0435\u043b\u0451\u043d\u043d\u0443\u044e \u043d\u0430 \u0432\u0437\u0432\u0435\u0448\u0435\u043d\u043d\u044b\u0435 \u043a\u0432\u0430\u043d\u0442\u0438\u043b\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u043c\u0435\u0449\u0430\u044e\u0442 \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u044f \u0441 \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u0430\u043c\u0438 \u043d\u0438\u0437\u043a\u043e\u0439 \u0434\u043e\u0441\u0442\u043e\u0432\u0435\u0440\u043d\u043e\u0441\u0442\u0438 \u0432 \u043a\u0432\u0430\u043d\u0442\u0438\u043b\u0438 \u0441 \u043c\u0435\u043d\u044c\u0448\u0438\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u0439.<\/p>\n<p><strong>Cache-aware access &amp; out-of-core computing<\/strong><\/p>\n<p>\u0414\u043b\u044f \u0431\u043e\u043b\u0435\u0435 \u0431\u044b\u0441\u0442\u0440\u043e\u0433\u043e \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u043e\u0432 \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u044b \u0438 \u0433\u0435\u0441\u0441\u0438\u0430\u043d\u044b \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u0432 \u043a\u044d\u0448-\u043f\u0430\u043c\u044f\u0442\u0438 (cache-aware access), \u0430 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441 \u0434\u0430\u0442\u0430\u0441\u0435\u0442\u0430\u043c\u0438 \u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0430, \u043a\u043e\u0433\u0434\u0430 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043a\u044d\u0448 \u0438 \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438, \u0437\u0430\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u0435\u0442\u0441\u044f \u043f\u0430\u043c\u044f\u0442\u044c \u0438\u0437 \u0436\u0451\u0441\u0442\u043a\u043e\u0433\u043e \u0434\u0438\u0441\u043a\u0430. \u0423\u0447\u0438\u0442\u044b\u0432\u0430\u044f, \u0447\u0442\u043e \u0447\u0442\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 \u0436\u0451\u0441\u0442\u043a\u043e\u043c \u0434\u0438\u0441\u043a\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u0435\u0435 \u0447\u0435\u043c \u0432 \u043a\u044d\u0448-\u043f\u0430\u043c\u044f\u0442\u0438, \u0434\u043b\u044f \u0443\u0441\u043a\u043e\u0440\u0435\u043d\u043d\u043e\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0438\u0445 \u043a\u043e\u043c\u043f\u0440\u0435\u0441\u0441\u0438\u044f. \u0414\u0430\u043d\u043d\u044b\u0435 \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u0432 \u0435\u0434\u0438\u043d\u0438\u0446\u0430\u0445 \u043f\u0430\u043c\u044f\u0442\u0438, \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0445 \u0431\u043b\u043e\u043a\u0430\u043c\u0438, \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 \u0441\u0436\u0430\u0442\u044b\u0445 \u0441\u0442\u043e\u043b\u0431\u0446\u043e\u0432, \u043e\u0442\u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043f\u043e \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0432\u0441\u0435\u0445 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 \u044f\u0434\u0435\u0440 \u0426\u041f, \u0430 \u0440\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u043a\u0430 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0431\u043b\u043e\u043a\u0430 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432 \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u043c \u043f\u043e\u0442\u043e\u043a\u0435 \u043f\u0440\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0435 \u0432 \u043f\u0430\u043c\u044f\u0442\u044c. \u0414\u0430\u043d\u043d\u0430\u044f \u0442\u0435\u0445\u043d\u0438\u043a\u0430 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f &#171;\u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 \u0432\u043d\u0435 \u044f\u0434\u0440\u0430&#187; (out-of-core computing). \u041f\u0440\u0438 \u043d\u0430\u043b\u0438\u0447\u0438\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0436\u0451\u0441\u0442\u043a\u0438\u0445 \u0434\u0438\u0441\u043a\u043e\u0432, \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e\u0435 \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0431\u043b\u043e\u043a\u043e\u0432 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0436\u0451\u0441\u0442\u043a\u043e\u0433\u043e \u0434\u0438\u0441\u043a\u0430 (sharding).<\/p>\n<p>\u041f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0441\u0436\u0430\u0442\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c, \u0447\u0442\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0441\u0436\u0430\u0442\u0438\u044f \u0438 \u0440\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u043a\u0438 \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u044b\u0431\u043e\u0440 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u0441\u0436\u0430\u0442\u0438\u044f (\u0441 \u043f\u043e\u0442\u0435\u0440\u044f\u043c\u0438 \u0438 \u0431\u0435\u0437) \u0438 \u0435\u0433\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0432\u043b\u0438\u044f\u0442\u044c \u043d\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0432 \u0446\u0435\u043b\u043e\u043c, \u043e\u0434\u043d\u0430\u043a\u043e \u044d\u0442\u043e \u0432\u0441\u0451 \u0440\u0430\u0432\u043d\u043e \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u0435\u0435 \u0447\u0442\u0435\u043d\u0438\u044f \u0431\u0435\u0437 \u0441\u0436\u0430\u0442\u0438\u044f.<\/p>\n<p><strong>Sparsity-aware split finding<\/strong><\/p>\n<p>\u0412 XGboost \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0430\u043c\u0438. \u0421\u0443\u0442\u044c \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c: \u0438\u0437 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u0434\u0430\u0442\u0430\u0441\u0435\u0442\u0430 \u0443\u0431\u0438\u0440\u0430\u044e\u0442\u0441\u044f \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u044f \u0441 \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0430\u043c\u0438 \u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043a\u0430\u043a \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0434\u0430\u0442\u0430\u0441\u0435\u0442. \u041f\u043e\u0441\u043b\u0435 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u0434\u0435\u0440\u0435\u0432\u0430 \u0434\u043b\u044f \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u0439 \u0431\u0435\u0437 \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u043e\u0432 \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0438\u0445 \u043e\u0441\u0442\u0430\u0442\u043a\u0438, \u0434\u0430\u043b\u0435\u0435 \u2014 \u043e\u0441\u0442\u0430\u0442\u043a\u0438 \u0434\u043b\u044f \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u0439 \u0441 \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0430\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0438\u0441\u043e\u0435\u0434\u0438\u043d\u044f\u044e\u0442\u0441\u044f \u043a \u043e\u0441\u0442\u0430\u0442\u043a\u0430\u043c \u0434\u0435\u0440\u0435\u0432\u0430 \u043a\u0430\u043a \u0434\u043b\u044f \u043b\u0435\u0432\u043e\u0433\u043e, \u0442\u0430\u043a \u0438 \u0434\u043b\u044f \u043f\u0440\u0430\u0432\u043e\u0433\u043e \u0443\u0437\u043b\u0430. \u0412 \u043a\u043e\u043d\u0446\u0435 \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u043f\u0440\u0438\u0440\u043e\u0441\u0442 (gain) \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0443\u0437\u043b\u0430 \u0432 \u0434\u0435\u0440\u0435\u0432\u0435: \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u0440\u043e\u0433 \u0434\u043b\u044f \u0440\u0430\u0437\u0431\u0438\u0435\u043d\u0438\u044f \u0441 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c \u043f\u0440\u0438\u0440\u043e\u0441\u0442\u043e\u043c. \u0414\u0430\u043d\u043d\u0430\u044f \u0442\u0435\u0445\u043d\u0438\u043a\u0430 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f &#171;\u043f\u043e\u0438\u0441\u043a \u0440\u0430\u0437\u0431\u0438\u0435\u043d\u0438\u044f \u0441 \u0443\u0447\u0451\u0442\u043e\u043c \u0440\u0430\u0437\u0440\u044f\u0436\u0435\u043d\u043d\u043e\u0441\u0442\u0438&#187; (sparsity-aware split finding).<\/p>\n<p><strong>\u041e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 \u043d\u0430 GPU<\/strong><\/p>\n<p>\u0414\u043b\u044f \u0443\u0441\u043a\u043e\u0440\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u0432 XGBoost \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u0430 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 GPU \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 device=&#187;cuda&#187; \u0438 tree_method=&#187;gpu_hist&#187;. \u0422\u0430\u043a\u0436\u0435 \u0441\u0442\u043e\u0438\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u0435 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 \u043d\u0430 GPU \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c Dask, Spark \u0438 PySpark.<\/p>\n<h4>\u041f\u0430\u043a\u0435\u0442\u043d\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f XGBoost \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>\u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0432\u044b\u0448\u0435\u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u043c \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f\u043c \u0438 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044f\u043c XGBoost \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043b\u0443\u0447\u0448\u0435 \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438, \u0447\u0442\u043e \u0432\u0438\u0434\u043d\u043e \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438, \u043e\u0434\u043d\u0430\u043a\u043e \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u0438 \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043e\u043a\u0430\u0437\u0430\u043b\u0441\u044f \u0445\u0443\u0436\u0435. \u0415\u0441\u043b\u0438 \u0445\u043e\u0440\u043e\u0448\u043e \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0438 \u043f\u043e\u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u043e\u0439 \u0433\u0438\u043f\u0435\u0440\u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432, XGBoost \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u043b\u0443\u0447\u0448\u0435 \u043a\u0430\u043a \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u0438, \u0442\u0430\u043a \u0438 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438.<\/p>\n<p><strong>XGBClassifier<\/strong> <\/p>\n<pre><code class=\"python\">from xgboost import XGBClassifier, XGBRegressor  xgbc = XGBClassifier(seed=0) xgbc.fit(X1_train, y1_train) xgbc_pred_res = xgbc.predict(X1_test) xgbc_accuracy = accuracy_score(xgbc_pred_res, y1_test) print(f'xgbc accuracy: {xgbc_accuracy}') print(xgbc_pred_res)  feature_indexes = [1, 3] title2 = 'XGBClassifier surface' decision_boundary_plot(X1, y1, X1_train, y1_train, xgbc, feature_indexes, title2)   xgbc accuracy: 0.6851851851851852 [5 0 1 4 1 1 0 1 1 1 3 0 1 1 1 5 2 1 1 2 3 0 5 5 0 0 5 0 0 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\/4d1\/261\/be6\/4d1261be6858e0f1effb85a1ca6b73e5.png\" width=\"554\" height=\"455\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/4d1\/261\/be6\/4d1261be6858e0f1effb85a1ca6b73e5.png\"\/><\/figure>\n<p><strong>XGBRegressor<\/strong> <\/p>\n<pre><code class=\"python\">xgbr = XGBRegressor(seed=0) xgbr.fit(X2_train, y2_train) xgbr_pred_res = xgbr.predict(X2_test) xgbr_mape = mean_absolute_percentage_error(xgbr_pred_res, y2_test) print(f'xgbr mape: {xgbr_mape}') print(xgbr_pred_res)   xgbr mape: 0.3781388070785457 [281.3304   241.21165  212.13124  136.89372  144.54208  261.7871  125.257454 236.16089  199.79964  250.18103  188.50882  126.724464  161.2112    73.98386  302.50272   97.35103  160.85774   67.10394   96.0406   284.72873  181.48717  117.764626 182.91393  127.76686  229.30229  173.58592  170.03932   76.73085  240.7698   117.70699  224.36049   63.628925 124.27327  142.07358  173.09418  139.11557  163.61208   92.8561    95.91142  217.65016  112.03522  122.800545  110.06953  181.34201  159.39062   61.97588  114.534805 145.20259   84.905815 284.77567  195.29976   45.550606  92.54941  180.4689  279.12097  241.1343   177.77785  130.43887  159.53189  158.2313  253.25339  181.86093  120.71679   90.604706 274.5059   140.21674   92.80314  211.71936  233.20622  110.791824  67.89235  133.62137  123.05923  102.70884  167.2115   159.32262  131.7305   243.41493  254.97531  210.0554   130.00981  222.21094   52.864147 251.23187  118.602684  87.89112  121.147095 218.15724   90.9274    91.69777  101.95428   85.79966   79.59963  155.879    118.25745   99.5975  231.70824  189.6652   121.97507  147.51166  152.10051  102.239395  177.74615  107.55845  271.80927  121.41044  232.97308  292.89096  129.39447   60.501278 259.46295 ]<\/code><\/pre>\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 XGBoost<\/h4>\n<p><em><u>\u041f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430<\/u><\/em>:<\/p>\n<ul>\n<li>\n<p>\u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0432\u044b\u0441\u043e\u043a\u0430\u044f \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u0438 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u043e\u0432;<\/p>\n<\/li>\n<li>\n<p>\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0430\u043c\u0438;<\/p>\n<\/li>\n<li>\n<p>\u0433\u0438\u0431\u043a\u043e\u0441\u0442\u044c \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0438\u0437-\u0437\u0430 \u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0433\u0438\u043f\u0435\u0440\u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432.<\/p>\n<\/li>\n<\/ul>\n<p><em><u>\u041d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u0438<\/u><\/em>:<\/p>\n<ul>\n<li>\n<p>\u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0438\u0437-\u0437\u0430 \u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0433\u0438\u043f\u0435\u0440\u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432;<\/p>\n<\/li>\n<li>\n<p>\u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u0430\u044f (\u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430\u043b\u044c\u043d\u0430\u044f) \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0430\u043c\u0438, \u0447\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0441\u0438\u043b\u044c\u043d\u043e \u0441\u043d\u0438\u0437\u0438\u0442\u044c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u0438 \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u043e\u0431\u044a\u0451\u043c\u043e\u0432 \u0434\u0430\u043d\u043d\u044b\u0445.<\/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 \u00abXGBoost: A Scalable Tree Boosting System\u00bb, Tianqi Chen, Carlos Guestrin.<\/p>\n<p><a href=\"https:\/\/xgboost.readthedocs.io\/en\/stable\/index.html\" rel=\"noopener noreferrer nofollow\">\u0414\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f<\/a>.<\/p>\n<p>\u041b\u0435\u043a\u0446\u0438\u0438:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/www.youtube.com\/watch?v=CCDIbNGGBwY&amp;t=638s&amp;ab_channel=ComputerScienceCenter\" rel=\"noopener noreferrer nofollow\">\u043e\u0434\u0438\u043d<\/a>;<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/www.youtube.com\/watch?v=Vly8xGnNiWs&amp;t=4168s&amp;ab_channel=RealDataScienceUSA%28formerlyDataScience.LA%29\" 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 XGBoost:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/www.youtube.com\/watch?v=OtD8wVaFm6E&amp;list=PLZ5DHV9_5h9vQwAImmNi1RfoTtSuOUjwM&amp;index=17&amp;ab_channel=StatQuestwithJoshStarmer\" rel=\"noopener noreferrer nofollow\">\u043e\u0434\u0438\u043d<\/a>;<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/www.youtube.com\/watch?v=8b1JEDvenQU&amp;list=PLZ5DHV9_5h9vQwAImmNi1RfoTtSuOUjwM&amp;index=17&amp;ab_channel=StatQuestwithJoshStarmer\" rel=\"noopener noreferrer nofollow\">\u0434\u0432\u0430<\/a>;<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/www.youtube.com\/watch?v=ZVFeW798-2I&amp;list=PLZ5DHV9_5h9vQwAImmNi1RfoTtSuOUjwM&amp;index=18&amp;ab_channel=StatQuestwithJoshStarmer\" rel=\"noopener noreferrer nofollow\">\u0442\u0440\u0438<\/a>;<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/www.youtube.com\/watch?v=oRrKeUCEbq8&amp;list=PLZ5DHV9_5h9vQwAImmNi1RfoTtSuOUjwM&amp;index=19&amp;ab_channel=StatQuestwithJoshStarmer\" rel=\"noopener noreferrer nofollow\">\u0447\u0435\u0442\u044b\u0440\u0435<\/a>.<\/p>\n<\/li>\n<\/ul>\n<hr\/>\n<p><a class=\"anchor\" name=\"catboost\" id=\"catboost\"><\/a><\/p>\n<h3>\u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 CatBoost<\/h3>\n<p>CatBoost (Categorical Boosting) \u2014 \u0431\u043e\u043b\u0435\u0435 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u043d\u043e\u0433\u043e \u0431\u0443\u0441\u0442\u0438\u043d\u0433\u0430 \u043e\u0442 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 \u042f\u043d\u0434\u0435\u043a\u0441, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c\u044e \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0430\u043c\u0438 \u0431\u0435\u0437 \u0438\u0445 \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438. \u0420\u0430\u0437\u0431\u0435\u0440\u0451\u043c\u0441\u044f \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043a\u0430\u043a \u044d\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442.<\/p>\n<h4>Ordered target (CatBoost) encoding<\/h4>\n<p>\u041f\u0440\u0438 \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432 \u043a \u0431\u0443\u0441\u0442\u0438\u043d\u0433\u0430\u043c \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043e\u0434\u0438\u043d \u0438\u0437 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043f\u043e\u0434\u0445\u043e\u0434\u043e\u0432:<\/p>\n<ul>\n<li>\n<p>target encoding;<\/p>\n<\/li>\n<li>\n<p>one-hot encoding (\u0445\u043e\u0440\u043e\u0448\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043b\u0438\u0448\u044c \u0432 \u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u043a\u043e\u0433\u0434\u0430 \u0432 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0430\u0445 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442\u0441\u044f \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439);<\/p>\n<\/li>\n<li>\n<p>feature hashing \u0432 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043a\u043e\u0440\u0437\u0438\u043d (\u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u044e\u0442\u0441\u044f \u0432 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u0443\u044e \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 (\u0445\u044d\u0448-\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f), \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0440\u0430\u0437\u0431\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u043d\u0430 \u0433\u0440\u0443\u043f\u043f\u044b (\u043a\u043e\u0440\u0437\u0438\u043d\u044b) \u0438 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e \u0441 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435\u043c target \u0438\u043b\u0438 one-hot encoding);<\/p>\n<\/li>\n<li>\n<p>mean target encoding (\u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u043e\u0432\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0430 \u043a\u0430\u043a \u0441\u0440\u0435\u0434\u043d\u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0446\u0435\u043b\u0435\u0432\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043f\u043e \u0434\u0430\u0442\u0430\u0441\u0435\u0442\u0443);<\/p>\n<\/li>\n<li>\n<p>leave-one-out (\u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0441\u0440\u0435\u0434\u043d\u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0446\u0435\u043b\u0435\u0432\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043f\u043e \u0432\u0441\u0435\u043c \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u043c \u043a\u0440\u043e\u043c\u0435 \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e);<\/p>\n<\/li>\n<li>\n<p>leave-bucket-out (\u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0441\u0440\u0435\u0434\u043d\u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0446\u0435\u043b\u0435\u0432\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043d\u0430 \u043e\u0434\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u043e\u0441\u0442\u0430\u0432\u0448\u0438\u0445\u0441\u044f \u0434\u0440\u0443\u0433\u0438\u0445);<\/p>\n<\/li>\n<\/ul>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e \u0432\u0441\u0435 \u0432\u044b\u0448\u0435\u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u0442\u0430\u043a \u0438\u043b\u0438 \u0438\u043d\u0430\u0447\u0435 \u043f\u0440\u0438\u0432\u043e\u0434\u044f\u0442 \u043a \u0443\u0442\u0435\u0447\u043a\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u043f\u0435\u0440\u0435\u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044e, \u0438 \u0434\u0430\u043d\u043d\u0443\u044e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u043c\u043e\u0436\u043d\u043e \u0447\u0430\u0441\u0442\u0438\u0447\u043d\u043e \u0440\u0435\u0448\u0438\u0442\u044c \u0441 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435\u043c\u00a0<em>mean target encoding<\/em>\u00a0\u043d\u0430 \u043e\u0442\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0439 \u0432\u044b\u0431\u043e\u0440\u043a\u0435, \u0447\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0437\u0430\u043c\u0435\u0442\u043d\u043e \u043b\u0443\u0447\u0448\u0435, \u043d\u043e \u0442\u0430\u043a\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043d\u0435 \u0438\u0434\u0435\u0430\u043b\u0435\u043d \u0442\u0430\u043a \u043a\u0430\u043a \u043e\u0441\u0442\u0430\u0451\u0442\u0441\u044f \u043c\u0435\u043d\u044c\u0448\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043b\u044f \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u0438 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a \u043f\u043e \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0430\u043b\u044c\u043d\u044b\u043c \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0430\u043c.<\/p>\n<p>\u0412 CatBoost \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043c\u043e\u0434\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043a mean target encoding, \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0439\u00a0<em>Ordered target (CatBoost) encoding<\/em>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 3-\u0445 \u043d\u0438\u0436\u0435\u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u0445 \u044d\u0442\u0430\u043f\u043e\u0432.<\/p>\n<p><strong>\u0421\u043b\u0443\u0447\u0430\u0439\u043d\u0430\u044f \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430<\/strong><\/p>\n<p>\u041e\u0431\u0440\u0430\u0437\u0446\u044b \u0432 \u043d\u0430\u0431\u043e\u0440\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u0448\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0447\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u0441\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u0441\u043d\u0438\u0437\u0438\u0442\u044c \u043f\u0435\u0440\u0435\u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435.<\/p>\n<p><strong>\u0421\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0438 \u00ab\u043f\u043e \u043f\u0440\u043e\u0448\u043b\u043e\u043c\u0443\u00bb<\/strong><\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u043e\u0432\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"CTR = \\frac{TargetSum + Prior}{TotalCount + 1}\" alt=\"CTR = \\frac{TargetSum + Prior}{TotalCount + 1}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/c34\/142\/d0c\/c34142d0cf9f25d3086c478b4e889e10.svg\" width=\"245\" height=\"44\"\/><\/p>\n<p><em>Prior<\/em>\u00a0\u2014 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0430, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c\u0430\u044f \u043a\u0430\u043a \u0441\u0440\u0435\u0434\u043d\u0435\u0435 \u0430\u0440\u0438\u0444\u043c\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0446\u0435\u043b\u0435\u0432\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439.<\/p>\n<p><em>TargetSum<\/em>\u00a0\u2014 \u0441\u0443\u043c\u043c\u0430 \u0446\u0435\u043b\u0435\u0432\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0434\u043b\u044f \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0430 \u0434\u043e \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u043c\u043e\u043c\u0435\u043d\u0442\u0430.<\/p>\n<p><em>TotalCount<\/em>\u00a0\u2014 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0432\u0441\u0435\u0445 \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u0439 \u0434\u043b\u044f \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0430 \u0434\u043e \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u043c\u043e\u043c\u0435\u043d\u0442\u0430.<\/p>\n<blockquote>\n<p><em>\u0414\u0430\u043d\u043d\u0430\u044f \u0444\u043e\u0440\u043c\u0443\u043b\u0430 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u043c\u0430 \u043a\u0430\u043a \u0434\u043b\u044f \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u0438, \u0442\u0430\u043a \u0438 \u0434\u043b\u044f \u043c\u0443\u043b\u044c\u0442\u0438\u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438.<\/em><\/p>\n<\/blockquote>\n<p><strong>\u041f\u043e\u0448\u0430\u0433\u043e\u0432\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u0441 \u043d\u0443\u043b\u044f \u0434\u043b\u044f \u043c\u0443\u043b\u044c\u0442\u0438\u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438<\/strong> <\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/fe6\/d07\/0c4\/fe6d070c4335b3853752f4f5a4bc384c.png\" width=\"805\" height=\"1013\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/fe6\/d07\/0c4\/fe6d070c4335b3853752f4f5a4bc384c.png\"\/><\/figure>\n<pre><code class=\"python\">!pip install category_encoders<\/code><\/pre>\n<pre><code class=\"python\">from category_encoders.cat_boost import CatBoostEncoder  train = pd.DataFrame({\"color\": [\"red\", \"blue\", \"black\", \"black\", \"blue\", \"blue\", \"red\", \"blue\"]}) target = pd.Series([2, 1, 2, 1, 0, 3, 0, 1])  cbe_encoder = CatBoostEncoder() train_cbe = cbe_encoder.fit_transform(train, target) prior = target.mean()  print(f'prior: {prior}', '', sep='\\n') print(train_cbe)   prior: 1.25      color 0  1.2500 1  1.2500 2  1.2500 3  1.6250 4  1.1250 5  0.7500 6  1.6250 7  1.3125<\/code><\/pre>\n<p>\u0412 \u0441\u043b\u0443\u0447\u0430\u0435 c \u0447\u0438\u0441\u043b\u043e\u0432\u044b\u043c\u0438 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0430\u043c\u0438 \u0441\u043e\u0437\u0434\u0430\u0451\u0442\u0441\u044f \u043d\u0430\u0431\u043e\u0440 \u043c\u0435\u0442\u043e\u043a \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u0432\u0430\u043d\u0442\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0438\u0445 \u0431\u0438\u043d\u0430\u0440\u0438\u0437\u0430\u0446\u0438\u044f \u043d\u0430 k \u043a\u043b\u0430\u0441\u0441\u043e\u0432: \u0432\u0441\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0434\u043e \u0433\u0440\u0430\u043d\u0438\u0446\u044b (\u043c\u0435\u0442\u043a\u0438) \u043e\u0442\u043d\u043e\u0441\u044f\u0442\u0441\u044f \u043a \u043a\u043b\u0430\u0441\u0441\u0443 0, \u0430 \u043f\u043e\u0441\u043b\u0435 \u043a \u043a\u043b\u0430\u0441\u0441\u0443 1. \u0414\u0430\u043b\u0435\u0435 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0430 \u0441\u0445\u043e\u0436\u0430 \u0441\u043e \u0441\u043b\u0443\u0447\u0430\u0435\u043c \u0432\u044b\u0448\u0435.<\/p>\n<p>\u0412 CatBoost \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0432\u0438\u0434\u044b \u043a\u0432\u0430\u043d\u0442\u043e\u0432\u0430\u043d\u0438\u044f:<\/p>\n<ul>\n<li>\n<p>\u043c\u043e\u0434\u0430;<\/p>\n<\/li>\n<li>\n<p>\u043c\u0435\u0434\u0438\u0430\u043d\u043d\u0430\u044f \u0441\u0435\u0442\u043a\u0430;<\/p>\n<\/li>\n<li>\n<p>\u0440\u0430\u0432\u043d\u043e\u043c\u0435\u0440\u043d\u0430\u044f \u0441\u0435\u0442\u043a\u0430 + \u043a\u0432\u0430\u043d\u0442\u0438\u043b\u0438 (\u0440\u0430\u0437\u043c\u0435\u0440 \u043a\u0432\u0430\u043d\u0442\u043e\u0432\u0430\u043d\u0438\u044f \u0443\u043c\u0435\u043d\u044c\u0448\u0430\u0435\u0442\u0441\u044f \u0432\u0434\u0432\u043e\u0435 \u0438 \u0440\u0430\u0437\u0431\u0438\u0435\u043d\u0438\u044f (\u043f\u043e\u0440\u043e\u0433\u043e\u0432\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f) \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u044e\u0442\u0441\u044f \u043f\u043e \u043e\u0434\u043d\u043e\u043c\u0443 \u0438\u0437 \u0434\u0432\u0443\u0445 \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432: \u043c\u0435\u0434\u0438\u0430\u043d\u0430 \u0438\u043b\u0438 \u0440\u0430\u0432\u043d\u043e\u043c\u0435\u0440\u043d\u0430\u044f \u0441\u0435\u0442\u043a\u0430);<\/p>\n<\/li>\n<li>\n<p>MaxLogSum \u2014 \u043c\u0430\u043a\u0441\u0438\u043c\u0438\u0437\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u0430:\u00a0<\/p>\n<\/li>\n<\/ul>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"\\sum\\limits_{i=1}^{n} log \\ w_i\" alt=\"\\sum\\limits_{i=1}^{n} log \\ w_i\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/12b\/ea3\/13d\/12bea313d22c02b306beb4dc9f9463f2.svg\" width=\"81\" height=\"57\"\/><\/p>\n<ul>\n<li>\n<p>MinEntropy \u2014 \u043c\u0438\u043d\u0438\u043c\u0438\u0437\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u0430:<\/p>\n<\/li>\n<\/ul>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"\\sum\\limits_{i=1}^{n} w_i \\ log \\ w_i\" alt=\"\\sum\\limits_{i=1}^{n} w_i \\ log \\ w_i\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/639\/474\/dfe\/639474dfe47933cd996c29db8372da3d.svg\" width=\"106\" height=\"57\"\/><\/p>\n<ul>\n<li>\n<p>GreedyLogSum \u2014 \u043c\u0430\u043a\u0441\u0438\u043c\u0438\u0437\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u044f \u0436\u0430\u0434\u043d\u044b\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u0430:<\/p>\n<\/li>\n<\/ul>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"\\sum\\limits_{i=1}^{n} log \\ w_i\" alt=\"\\sum\\limits_{i=1}^{n} log \\ w_i\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/5f5\/0f3\/d42\/5f50f3d42d1b6dd3a0ba0e6ae260a59f.svg\" width=\"81\" height=\"57\"\/><\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u0433\u0434\u0435 n \u2014 \u0447\u0438\u0441\u043b\u043e \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0432 \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u0435, w (weight) \u2014 \u0447\u0438\u0441\u043b\u043e \u043f\u043e\u0432\u0442\u043e\u0440\u0435\u043d\u0438\u0439 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0432 \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u0435.<\/p>\n<p><strong>\u041a\u043e\u043c\u0431\u0438\u043d\u0430\u0446\u0438\u044f \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432<\/strong><\/p>\n<p>\u0412 CatBoost \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043a\u043e\u043c\u0431\u0438\u043d\u0430\u0446\u0438\u044f \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043a\u0440\u0430\u0441\u043d\u044b\u0439 \u0434\u0438\u0432\u0430\u043d, \u0441\u0438\u043d\u0438\u0439 \u0434\u0438\u0432\u0430\u043d, \u0441\u0438\u043d\u0438\u0439 \u0441\u0442\u0443\u043b \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435), \u0447\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043c\u043e\u0434\u0435\u043b\u0438 \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u043d\u0435\u043e\u0447\u0435\u0432\u0438\u0434\u043d\u044b\u0435 \u0432\u0437\u0430\u0438\u043c\u043e\u0441\u0432\u044f\u0437\u0438 \u043c\u0435\u0436\u0434\u0443 \u043d\u0438\u043c\u0438 \u0438 \u0443\u043b\u0443\u0447\u0448\u0438\u0442\u044c \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e \u0438\u0442\u043e\u0433\u043e\u0432\u044b\u0445 \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u043e\u0432 \u0432 \u0446\u0435\u043b\u043e\u043c. \u0414\u043b\u044f \u0438\u0437\u0431\u0435\u0433\u0430\u043d\u0438\u044f \u044d\u043a\u0441\u043f\u043e\u043d\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0440\u043e\u0441\u0442\u0430 \u043a\u043e\u043c\u0431\u0438\u043d\u0430\u0446\u0438\u0439 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432, \u0438\u0445 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043d\u0435 \u043f\u0435\u0440\u0435\u0434 \u043d\u0430\u0447\u0430\u043b\u043e\u043c \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f, \u0430 \u0432 \u043c\u043e\u043c\u0435\u043d\u0442 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0434\u0435\u0440\u0435\u0432\u0430 \u0436\u0430\u0434\u043d\u044b\u043c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u043c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e.<\/p>\n<h4>\u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0440\u0435\u0448\u0430\u044e\u0449\u0438\u0445 \u0434\u0435\u0440\u0435\u0432\u044c\u0435\u0432 \u0438 \u0443\u043f\u043e\u0440\u044f\u0434\u043e\u0447\u0435\u043d\u043d\u044b\u0439 \u0431\u0443\u0441\u0442\u0438\u043d\u0433<\/h4>\n<p>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0431\u0430\u0437\u043e\u0432\u044b\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0432 CatBoost \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0441\u0438\u043c\u043c\u0435\u0442\u0440\u0438\u0447\u043d\u044b\u0435 \u043e\u0434\u043d\u043e\u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0435 \u0434\u0435\u0440\u0435\u0432\u044c\u044f, \u0438\u043c\u0435\u044e\u0449\u0438\u0435 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u0443\u044e \u0433\u043b\u0443\u0431\u0438\u043d\u0443 \u0438 \u0448\u0438\u0440\u0438\u043d\u0443. \u0421\u043e\u0437\u0434\u0430\u0442\u0435\u043b\u0438 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u0441\u0447\u0438\u0442\u0430\u044e\u0442, \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0443\u0441\u043a\u043e\u0440\u0438\u0442\u044c \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 \u0438 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0434\u0435\u0440\u0435\u0432\u044c\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u0435\u043d\u0435\u0435 \u043f\u043e\u0434\u0432\u0435\u0440\u0436\u0435\u043d\u044b \u043f\u0435\u0440\u0435\u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044e.<\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u043d\u0430\u0438\u043b\u0443\u0447\u0448\u0435\u0433\u043e \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u044f \u0440\u0430\u0437\u0431\u0438\u0435\u043d\u0438\u044f \u0432 \u0443\u0437\u043b\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043a\u043e\u0441\u0438\u043d\u0443\u0441\u043d\u043e\u0435 \u0441\u0445\u043e\u0434\u0441\u0442\u0432\u043e \u2014 \u0435\u0433\u043e \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u043b\u0443\u0447\u0448\u0435\u043c\u0443 \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u044e:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"Cosine \\ Similarity = \\frac{ \\sum\\limits_{i=1}^{n} A_i B_i}{\\sqrt{\\sum\\limits_{i=1}^{n} A_i^2} \\sqrt{\\sum\\limits_{i=1}^{n} B_i^2}}\" alt=\"Cosine \\ Similarity = \\frac{ \\sum\\limits_{i=1}^{n} A_i B_i}{\\sqrt{\\sum\\limits_{i=1}^{n} A_i^2} \\sqrt{\\sum\\limits_{i=1}^{n} B_i^2}}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/3e3\/0c0\/09e\/3e30c009eb995fd5ede8758ee242c50b.svg\" width=\"324\" height=\"116\"\/><\/p>\n<p>\u0433\u0434\u0435 A \u2014 \u0432\u0435\u043a\u0442\u043e\u0440 \u0441 \u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u044b\u043c\u0438 \u043e\u0448\u0438\u0431\u043a\u0430\u043c\u0438, B \u2014 \u0432\u0435\u043a\u0442\u043e\u0440 \u0441 \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u0430\u043c\u0438 \u0432 \u043b\u0438\u0441\u0442\u043e\u0432\u044b\u0445 \u0443\u0437\u043b\u0430\u0445.<\/p>\n<p>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0431\u0443\u0441\u0442\u0438\u043d\u0433\u0430 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u044b \u0431\u0430\u0437\u043e\u0432\u044b\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u043c\u043e\u0433\u0443\u0442 \u0438\u043c\u0435\u0442\u044c \u0432\u044b\u0441\u043e\u043a\u043e\u0435 \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435, \u0447\u0442\u043e \u0432 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u043c \u0441\u0447\u0451\u0442\u0435 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u043f\u0435\u0440\u0435\u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044e \u043c\u043e\u0434\u0435\u043b\u0438 \u0432 \u0446\u0435\u043b\u043e\u043c \u2014 \u044d\u0442\u043e \u043e\u0431\u0443\u0441\u043b\u043e\u0432\u043b\u0435\u043d\u043e \u0442\u0435\u043c, \u0447\u0442\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 \u0438 \u043e\u0446\u0435\u043d\u043a\u0430 \u0434\u0435\u0440\u0435\u0432\u044c\u0435\u0432 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043d\u0430 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e\u043c \u043d\u0430\u0431\u043e\u0440\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 (X_train). \u0414\u0430\u043d\u043d\u0430\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0440\u0435\u0448\u0430\u0435\u0442\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0435\u0442\u043e\u0434\u0430 \u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0439 \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u0438 \u0443\u043f\u043e\u0440\u044f\u0434\u043e\u0447\u0435\u043d\u043d\u043e\u0433\u043e \u0431\u0443\u0441\u0442\u0438\u043d\u0433\u0430 (Ordered Boosting), \u0441\u0443\u0442\u044c \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c: \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u0448\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0438 \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u0442\u0435\u043a\u0443\u0449\u0435\u0435 \u0434\u0435\u0440\u0435\u0432\u043e \u043e\u0431\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u043d\u0430 m-1 \u043e\u0431\u0440\u0430\u0437\u0446\u0430\u0445 \u0441 \u0443\u0447\u0451\u0442\u043e\u043c \u043e\u0441\u0442\u0430\u0442\u043a\u043e\u0432 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0433\u043e, \u0447\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u0445\u043e\u0436\u0435 \u043d\u0430 \u043f\u0440\u0438\u043d\u0446\u0438\u043f \u0432 ordered target encoding, \u0442\u043e \u0435\u0441\u0442\u044c \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u0431\u0435\u0440\u0451\u0442\u0441\u044f \u043e\u0434\u0438\u043d \u043e\u0431\u0440\u0430\u0437\u0435\u0446 \u0438\u0437 \u043d\u0430\u0431\u043e\u0440\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u043c\u043e\u0434\u0435\u043b\u044c \u0443\u0447\u0438\u0442\u0441\u044f \u043d\u0430 \u0432\u0441\u0435\u0445 \u043e\u0431\u0440\u0430\u0437\u0446\u0430\u0445 \u0434\u043e \u043d\u0435\u0433\u043e, \u0442\u043e \u0435\u0441\u0442\u044c \u043d\u0430 \u043d\u0443\u043b\u044f\u0445, \u0434\u0430\u043b\u0435\u0435 \u0431\u0435\u0440\u0451\u0442\u0441\u044f \u0434\u0432\u0430 \u043e\u0431\u0440\u0430\u0437\u0446\u0430 \u0438 \u043c\u043e\u0434\u0435\u043b\u044c \u0443\u0447\u0438\u0442\u0441\u044f \u043d\u0430 \u043e\u0434\u043d\u043e\u043c, \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043e\u0441\u0442\u0430\u0442\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u044b \u0434\u043b\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435. \u0422\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0441\u0442\u0438 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 \u0434\u0435\u0440\u0435\u0432\u0430 \u0441\u043e \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c\u044e <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"O(log(m))\" alt=\"O(log(m))\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f39\/dde\/0a2\/f39dde0a243f7e1b1331900fb723d8cc.svg\" width=\"86\" height=\"22\"\/> \u0432\u043c\u0435\u0441\u0442\u043e <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"O(m^2)\" alt=\"O(m^2)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/1f6\/79a\/642\/1f679a64277ca47d7d437b1786c5fb01.svg\" width=\"55\" height=\"25\"\/>.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/1c2\/582\/64e\/1c258264e30fe97b8fc7476ff625f8cc.png\" alt=\"\u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0441\u0438\u043c\u043c\u0435\u0442\u0440\u0438\u0447\u043d\u043e\u0433\u043e \u043e\u0434\u043d\u043e\u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0435\u0433\u043e \u0434\u0435\u0440\u0435\u0432\u0430\" title=\"\u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0441\u0438\u043c\u043c\u0435\u0442\u0440\u0438\u0447\u043d\u043e\u0433\u043e \u043e\u0434\u043d\u043e\u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0435\u0433\u043e \u0434\u0435\u0440\u0435\u0432\u0430\" width=\"980\" height=\"579\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/1c2\/582\/64e\/1c258264e30fe97b8fc7476ff625f8cc.png\"\/><\/p>\n<div><figcaption><strong>\u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0441\u0438\u043c\u043c\u0435\u0442\u0440\u0438\u0447\u043d\u043e\u0433\u043e \u043e\u0434\u043d\u043e\u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0435\u0433\u043e \u0434\u0435\u0440\u0435\u0432\u0430<\/strong><\/figcaption><\/div>\n<\/figure>\n<h4>\u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 CatBoost<\/h4>\n<p><strong>\u0420\u0430\u0431\u043e\u0442\u0430 \u0441 \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0430\u043c\u0438<\/strong><\/p>\n<p>\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0440\u0435\u0436\u0438\u043c\u044b \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u043e\u0432:<\/p>\n<ul>\n<li>\n<p>&#171;Forbidden&#187; \u2014 \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0438 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u043a\u0430\u043a \u043e\u0448\u0438\u0431\u043a\u0438.<\/p>\n<\/li>\n<li>\n<p>&#171;Min&#187; \u2014 \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0438 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043a\u0430\u043a \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 (\u043c\u0435\u043d\u044c\u0448\u0435\u0435, \u0447\u0435\u043c \u0432\u0441\u0435 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f) \u0434\u043b\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u0430.<\/p>\n<\/li>\n<li>\n<p>&#171;Max&#187; \u2014 \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0438 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043a\u0430\u043a \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 (\u043f\u0440\u0435\u0432\u044b\u0448\u0430\u044e\u0449\u0435\u0435 \u0432\u0441\u0435 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f) \u0434\u043b\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u0430.<\/p>\n<\/li>\n<\/ul>\n<p>\u0420\u0435\u0436\u0438\u043c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u2014 Min. \u0422\u0430\u043a\u0436\u0435 \u043f\u0440\u0438 \u0432\u044b\u0431\u043e\u0440\u0435 \u0434\u0435\u0440\u0435\u0432\u044c\u0435\u0432 \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0440\u0430\u0437\u0431\u0438\u0435\u043d\u0438\u0435, \u043e\u0442\u0434\u0435\u043b\u044f\u044e\u0449\u0435\u0435 \u043f\u0440\u043e\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043e\u0442 \u0432\u0441\u0435\u0445 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0445.<\/p>\n<p><strong>Snapshots<\/strong><\/p>\n<p>\u0414\u0430\u043d\u043d\u044b\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 (save_snapshot=True) \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0440\u0435\u0437\u0435\u0440\u0432\u043d\u044b\u0435 \u043a\u043e\u043f\u0438\u0438 \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u044b\u0445 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432. \u0415\u0441\u043b\u0438 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043d\u0435\u043e\u0436\u0438\u0434\u0430\u043d\u043d\u043e\u0435 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0435 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0435 \u0432\u044b\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0430), \u0442\u043e \u043e\u043d\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0435\u043d\u043e \u0438\u0437 \u0441\u043e\u0445\u0440\u0430\u043d\u0451\u043d\u043d\u043e\u0433\u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u0438 \u0432 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0442\u044c \u0437\u0430\u0432\u0435\u0440\u0448\u0451\u043d\u043d\u044b\u0435 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0438 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u0434\u0435\u0440\u0435\u0432\u044c\u0435\u0432.<\/p>\n<p><strong>\u041e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 \u043d\u0430 GPU<\/strong><\/p>\n<p>\u0412 CatBoost \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 GPU, \u043d\u043e \u0438 \u0441\u0440\u0430\u0437\u0443 \u043d\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0441\u0435\u0440\u0432\u0435\u0440\u0430\u0445 \u0441 GPU, \u0447\u0442\u043e \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u0435 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u0442\u0430\u0441\u0435\u0442\u044b \u043b\u044e\u0431\u043e\u0433\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0430. \u0414\u0430\u043d\u043d\u0430\u044f \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0430 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0443\u0441\u043a\u043e\u0440\u0438\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430: \u0447\u0435\u043c \u0431\u043e\u043b\u044c\u0448\u0435 \u0434\u0430\u0442\u0430\u0441\u0435\u0442, \u0442\u0435\u043c \u0431\u043e\u043b\u044c\u0448\u0435 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0438\u0440\u043e\u0441\u0442 \u0432 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0432 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0438 \u0441 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435\u043c \u043d\u0430 CPU. \u0414\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u044d\u0442\u0438\u043c \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c task_type=&#187;GPU&#187;.<\/p>\n<h4>\u041f\u0430\u043a\u0435\u0442\u043d\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f CatBoost \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 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c \u0438\u0437 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438, \u043d\u0435 \u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u0439, CatBoost \u0434\u0430\u043b\u0435\u043a\u043e \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0432\u044b\u0441\u043e\u043a\u0438\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0432 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0438 \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f\u043c\u0438 \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u043d\u043e\u0433\u043e \u0431\u0443\u0441\u0442\u0438\u043d\u0433\u0430, \u043a\u0430\u043a \u044d\u0442\u043e \u0437\u0430\u044f\u0432\u043b\u044f\u044e\u0442 \u0435\u0433\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u043d\u0430 \u0440\u0430\u0437\u043d\u0438\u0446\u0430 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441 \u043d\u0435\u0441\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438 \u043d\u0430\u0431\u043e\u0440\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0445. \u041e\u0434\u043d\u0430\u043a\u043e, \u0441\u0442\u043e\u0438\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0445\u043e\u0440\u043e\u0448\u0435\u0439 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445, \u043f\u0440\u0438 \u043f\u0440\u043e\u0447\u0438\u0445 \u0440\u0430\u0432\u043d\u044b\u0445, \u0432 \u0440\u044f\u0434\u0435 \u0441\u043b\u0443\u0447\u0430\u0435\u0432 CatBoost \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u043b\u0438\u0447\u0430\u0442\u044c\u0441\u044f \u043e\u0442 \u0434\u0440\u0443\u0433\u0438\u0445 \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0439 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0431\u043e\u043b\u0435\u0435 \u0432\u044b\u0441\u043e\u043a\u043e\u0439 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c\u044e.<\/p>\n<p>\u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u0438, \u043a\u043e\u0433\u0434\u0430 \u043d\u0435\u0442 \u044f\u0432\u043d\u043e \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u043d\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u043a\u0430\u043a \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0432\u044b\u0448\u0435, CatBoost \u0441\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0445\u043e\u0440\u043e\u0448\u043e.<\/p>\n<p>\u041f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u044b \u043d\u0438\u0436\u0435.<\/p>\n<pre><code class=\"python\">!pip install catboost<\/code><\/pre>\n<p><strong>CatBoostClassifier<\/strong><\/p>\n<pre><code class=\"python\">from catboost import CatBoostClassifier, CatBoostRegressor  cb_clf = CatBoostClassifier(random_seed=0, logging_level='Silent') cb_clf.fit(X1_train, y1_train) cb_clf_pred_res = cb_clf.predict(X1_test).squeeze()   # remove all single-dimensional entries cb_clf_accuracy = accuracy_score(cb_clf_pred_res, y1_test) print(f'cb_clf accuracy: {cb_clf_accuracy}') print(cb_clf_pred_res)  feature_indexes = [1, 3] title3 = 'CatBoostClassifier surface' decision_boundary_plot(X1, y1, X1_train, y1_train, cb_clf, feature_indexes, title3)   cb_clf accuracy: 0.6851851851851852 [5 0 1 4 1 1 0 1 1 1 0 0 1 1 1 5 2 1 2 2 1 0 5 1 0 0 5 0 1 1 0 0 1 0 0 0 0  0 0 5 1 5 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\/db7\/d67\/adb\/db7d67adb14f7f5c087d5b15325efbfe.png\" width=\"554\" height=\"455\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/db7\/d67\/adb\/db7d67adb14f7f5c087d5b15325efbfe.png\"\/><\/figure>\n<p><strong>CatBoostRegressor<\/strong><\/p>\n<pre><code class=\"python\">cb_reg = CatBoostRegressor(random_seed=0, logging_level='Silent') cb_reg.fit(X2_train, y2_train) cb_reg_pred_res = cb_reg.predict(X2_test) cb_reg_mape = mean_absolute_percentage_error(cb_reg_pred_res, y2_test) print(f'cb_reg mape: {cb_reg_mape}') print(cb_reg_pred_res)   cb_reg mape: 0.3260573594870776 [268.21698587 226.61112865 152.56164473 105.39534082 185.56084388  231.13386917 112.94031582 246.11217136 121.83631454 238.66069067  193.92810529 171.53207065 120.95427566  98.87431921 301.0159263   97.989809   170.68360243  70.03044356 104.9534818  235.1624283  174.7895105  131.39173163 178.28683674 128.13631321 230.60611298  186.37090017 131.52230822  61.453026   231.95028492 148.67901568  186.2317954   80.45908918 137.68617262 171.24445717 128.77648933  178.31364898 179.17236177 149.82094832 102.25676058 209.48231728  116.01443961 169.06621701 110.9047463  210.24240477 158.28102362   72.4532758  135.86931928 121.14865532  76.8103627  278.66222581  127.85077736  55.25704176 144.51194393 170.06468442 271.51905928  187.61879537 159.56680649 118.65520621 121.92004997 183.56316238  248.87847858 137.77180529 117.98743897  82.53109543 255.59388802  151.23062005  94.00606836 257.15481144 227.21705762  96.77322241   78.34198817 118.09701594  91.2069645   91.70192792 125.65538331  155.68222799 129.63411563 230.46496307 292.38275237 213.68057983  131.76653094 217.93105223  50.37188156 256.16334997  94.4107044   90.95547399 139.58356594 187.26517    127.97009716 171.85831366   89.65051176  95.93129442  60.14437246 178.27466698 101.36657382  106.15753799 206.11327567 217.74079838 130.83283251 138.63144499  154.18156801 123.38315127 197.65233246 125.95249034 239.25024631  139.69849648 245.02582928 288.17892899 122.76437963  70.023686  233.36946028]<\/code><\/pre>\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 CatBoost<\/h4>\n<p><em><u>\u041f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430<\/u><\/em>:<\/p>\n<ul>\n<li>\n<p>\u0432\u044b\u0441\u043e\u043a\u0430\u044f \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u0438 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u0432 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0435 \u0441\u043b\u0443\u0447\u0430\u0435\u0432;<\/p>\n<\/li>\n<li>\n<p>\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0430\u043c\u0438;<\/p>\n<\/li>\n<li>\n<p>\u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0433\u0438\u043f\u0435\u0440\u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0434\u043b\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430;<\/p>\n<\/li>\n<li>\n<p>\u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u043c\u043d\u043e\u0433\u0438\u0445 \u0437\u0430\u0434\u0430\u0447.<\/p>\n<\/li>\n<\/ul>\n<p><em><u>\u041d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u0438<\/u><\/em>:<\/p>\n<ul>\n<li>\n<p>\u043d\u0435\u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u0430\u044f \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u043d\u0435\u0441\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438;<\/p>\n<\/li>\n<li>\n<p>\u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0438\u0437-\u0437\u0430 \u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0433\u0438\u043f\u0435\u0440\u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432;<\/p>\n<\/li>\n<li>\n<p>\u043f\u043b\u043e\u0445\u0430\u044f \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f (\u043b\u0438\u0447\u043d\u043e\u0435 \u043c\u043d\u0435\u043d\u0438\u0435).<\/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 \u00abCatBoost: unbiased boosting with categorical features\u00bb, Liudmila Prokhorenkova, Gleb Gusev, Aleksandr Vorobev, Anna Veronika Dorogush, Andrey Gulin.<\/p>\n<p><a href=\"https:\/\/catboost.ai\/en\/docs\/\" rel=\"noopener noreferrer nofollow\">\u0414\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f<\/a>.<\/p>\n<p><a href=\"https:\/\/www.youtube.com\/watch?v=UYDwhuyWYSo&amp;t=1281s&amp;ab_channel=ComputerScienceCenter\" rel=\"noopener noreferrer nofollow\">\u041b\u0435\u043a\u0446\u0438\u044f<\/a>.<\/p>\n<p>\u041f\u043e\u0448\u0430\u0433\u043e\u0432\u043e\u0435 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435 CatBoost (\u0432 ordered target encoding \u0435\u0441\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0438):<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/www.youtube.com\/watch?v=KXOTSkPL2X4&amp;t=447s&amp;ab_channel=StatQuestwithJoshStarmer\" rel=\"noopener noreferrer nofollow\">\u043e\u0434\u0438\u043d<\/a>;<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/www.youtube.com\/watch?v=3Bg2XRFOTzg&amp;ab_channel=StatQuestwithJoshStarmer\" rel=\"noopener noreferrer nofollow\">\u0434\u0432\u0430<\/a>.<\/p>\n<\/li>\n<\/ul>\n<hr\/>\n<p><a class=\"anchor\" name=\"lightgbm\" id=\"lightgbm\"><\/a><\/p>\n<h2>\u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 LightGBM<\/h2>\n<p>LightGBM (Light Gradient Boosting Machine) \u2014 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u043d\u043e\u0433\u043e \u0431\u0443\u0441\u0442\u0438\u043d\u0433\u0430 \u043e\u0442 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 Microsoft, \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u0430\u044f \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u043d\u0430\u0431\u043e\u0440\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0442\u044c \u0432\u044b\u0441\u043e\u043a\u0443\u044e \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c. \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0435 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430 \u044d\u0442\u043e \u043f\u043e\u0432\u043b\u0438\u044f\u043b\u0438.<\/p>\n<h4>Gradient-based One-Side Sampling (GOSS)<\/h4>\n<p>\u0412 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u043d\u043e\u0433\u043e \u0431\u0443\u0441\u0442\u0438\u043d\u0433\u0430, \u0433\u0434\u0435 \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u043e\u043d\u043d\u044b\u0435 \u0434\u0435\u0440\u0435\u0432\u044c\u044f \u043e\u0431\u0443\u0447\u0430\u044e\u0442\u0441\u044f \u043d\u0430 \u0432\u0441\u0451\u043c \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0435 X_train, \u0432 LightGBM \u0434\u0435\u0440\u0435\u0432\u044c\u044f \u043e\u0431\u0443\u0447\u0430\u044e\u0442\u0441\u044f \u043d\u0430 \u043f\u043e\u0434\u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0435 \u0434\u0430\u043d\u043d\u044b\u0445, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u043c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043e\u0434\u043d\u043e\u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0435\u0433\u043e \u043e\u0442\u0431\u043e\u0440\u0430 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u0430 (GOSS), \u0441\u0443\u0442\u044c \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0435 \u0438 \u0432\u044b\u0431\u043e\u0440\u0435 \u043e\u0431\u0440\u0430\u0437\u0446\u043e\u0432 top N \u0441 \u043d\u0430\u0438\u0431\u043e\u043b\u044c\u0448\u0438\u043c \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u043e\u043c \u2014 \u044d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u044d\u0442\u0438\u043c \u0434\u0430\u043d\u043d\u044b\u043c \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0443\u0434\u0435\u043b\u0438\u0442\u044c \u043e\u0441\u043e\u0431\u043e\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043d\u0430 \u043d\u0438\u0445 \u0434\u0435\u0440\u0435\u0432\u043e \u0431\u0443\u0434\u0435\u0442 \u043e\u0448\u0438\u0431\u0430\u0442\u044c\u0441\u044f \u0431\u043e\u043b\u044c\u0448\u0435 \u0432\u0441\u0435\u0433\u043e. \u041f\u043e\u043c\u0438\u043c\u043e \u044d\u0442\u043e\u0433\u043e, \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043e\u0442\u0431\u043e\u0440 \u0447\u0430\u0441\u0442\u0438 \u043e\u0431\u0440\u0430\u0437\u0446\u043e\u0432 \u0441 \u043d\u0438\u0437\u043a\u0438\u043c \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u043e\u043c \u0441 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043f\u0440\u0438\u0441\u0432\u043e\u0435\u043d\u0438\u0435\u043c \u0438\u043c \u0432\u0435\u0441\u043e\u0432\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"\\frac{1-a}{b}\" alt=\"\\frac{1-a}{b}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/845\/857\/22e\/84585722e3e57719d060cfd590f85d7a.svg\" width=\"50\" height=\"42\"\/> , \u0447\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u0432 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445. \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"a\" alt=\"a\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d2d\/204\/92a\/d2d20492a6025bdab5a0e7bdf5f9c52c.svg\" width=\"10\" height=\"12\"\/> \u2014 \u0434\u043e\u043b\u044f \u043e\u0431\u0440\u0430\u0437\u0446\u043e\u0432 top N \u0432 \u043f\u0440\u043e\u0446\u0435\u043d\u0442\u0430\u0445 \u0441 \u043d\u0430\u0438\u0431\u043e\u043b\u044c\u0448\u0438\u043c \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u043e\u043c, <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"b\" alt=\"b\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/775\/ddf\/81c\/775ddf81c67b8209acd4aa241f749b6e.svg\" width=\"8\" height=\"17\"\/>\u00a0\u2014 \u0434\u043e\u043b\u044f \u043e\u0431\u0440\u0430\u0437\u0446\u043e\u0432 \u0432 \u043f\u0440\u043e\u0446\u0435\u043d\u0442\u0430\u0445 \u0441 \u043d\u0438\u0437\u043a\u0438\u043c \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u043e\u043c.<\/p>\n<p>\u041f\u0440\u043e\u0449\u0435 \u0433\u043e\u0432\u043e\u0440\u044f, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 GOSS \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0443\u0441\u043a\u043e\u0440\u0438\u0442\u044c \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0434\u0435\u0440\u0435\u0432\u0430 \u0432 \u0430\u043d\u0441\u0430\u043c\u0431\u043b\u0435 \u043f\u0443\u0442\u0451\u043c \u0443\u043c\u0435\u043d\u044c\u0448\u0435\u043d\u0438\u044f \u043e\u0431\u0443\u0447\u0430\u044e\u0449\u0435\u0433\u043e \u043d\u0430\u0431\u043e\u0440\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0431\u0435\u0437 \u043e\u0441\u043e\u0431\u043e\u0439 \u043f\u043e\u0442\u0435\u0440\u0438 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u043e\u0432 \u0432 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0435 \u0441\u043b\u0443\u0447\u0430\u0435\u0432.<\/p>\n<h4>Histogram-based tree node splitting<\/h4>\n<p>\u041f\u0440\u0438 \u043f\u043e\u0438\u0441\u043a\u0435 \u043d\u0430\u0438\u043b\u0443\u0447\u0448\u0435\u0433\u043e \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u044f \u0440\u0430\u0437\u0431\u0438\u0435\u043d\u0438\u044f \u0443\u0437\u043b\u0430 \u0432 LightGBM \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0433\u0438\u0441\u0442\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432: \u043f\u0435\u0440\u0435\u0431\u0438\u0440\u0430\u044e\u0442\u0441\u044f \u0432\u0441\u0435 \u043f\u043e\u0440\u043e\u0433\u043e\u0432\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0433\u0438\u0441\u0442\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0432\u043c\u0435\u0441\u0442\u043e \u0432\u0441\u0435\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432, \u0447\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0443\u0441\u043a\u043e\u0440\u0438\u0442\u044c \u043f\u043e\u0438\u0441\u043a \u043d\u0430\u0438\u043b\u0443\u0447\u0448\u0435\u0433\u043e \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u044f. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u043b\u044f \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0430 &#171;\u0440\u043e\u0441\u0442&#187; \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u043e\u043f\u0440\u043e\u0441\u044b &#171;\u0440\u043e\u0441\u0442&#187; \u2a7d 160, &#171;\u0440\u043e\u0441\u0442&#187; \u2a7d 170 \u0432\u043c\u0435\u0441\u0442\u043e &#171;\u0440\u043e\u0441\u0442&#187; \u2a7d 163, &#171;\u0440\u043e\u0441\u0442&#187; \u2a7d 167 \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435. \u041a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0433\u0438\u0441\u0442\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f \u0432 \u0442\u043e\u043c \u0438\u043b\u0438 \u0438\u043d\u043e\u043c \u0432\u0438\u0434\u0435 \u0432\u043e \u0432\u0441\u0435\u0445 \u0442\u0440\u0451\u0445 \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f\u0445 \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u043d\u043e\u0433\u043e \u0431\u0443\u0441\u0442\u0438\u043d\u0433\u0430.<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/d63\/3b2\/2d4\/d633b22d40038dd62a1a8e1aa6139fba.png\" width=\"499\" height=\"555\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d63\/3b2\/2d4\/d633b22d40038dd62a1a8e1aa6139fba.png\"\/><\/figure>\n<h4>Exclusive Feature Bundling (EFB)<\/h4>\n<p>\u041f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u043c, \u0447\u0442\u043e \u0442\u0435\u043c \u0438\u043b\u0438 \u0438\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0432 \u0434\u0430\u0442\u0430\u0441\u0435\u0442\u0435 \u0438\u043c\u0435\u044e\u0442\u0441\u044f \u0437\u0430\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0438, \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0432\u0437\u0430\u0438\u043c\u043e\u0438\u0441\u043a\u043b\u044e\u0447\u0430\u044e\u0449\u0438\u043c\u0438 (\u0442\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u043d\u0435 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0442 \u043d\u0435\u043d\u0443\u043b\u0435\u0432\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f). \u041f\u0440\u0438 \u0431\u043e\u043b\u044c\u0448\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0442\u0430\u043a\u0438\u0445 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u043c\u043e\u0436\u0435\u0442 \u0437\u0430\u043d\u044f\u0442\u044c \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u043c\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0438 \u0434\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0432 LightGBM \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u043d\u0438\u0436\u0435\u043d\u0438\u0435 \u0440\u0430\u0437\u043c\u0435\u0440\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432 \u043f\u0443\u0442\u0451\u043c \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u0432\u0437\u0430\u0438\u043c\u043e\u0438\u0441\u043a\u043b\u044e\u0447\u0430\u044e\u0449\u0438\u0445 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432 (EFB).<\/p>\n<p>\u0421\u0442\u043e\u0438\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0432 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0441\u0442\u0440\u043e\u0433\u043e \u0432\u0437\u0430\u0438\u043c\u043e\u0438\u0441\u043a\u043b\u044e\u0447\u0430\u044e\u0449\u0438\u0435 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0438 \u0432 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u044e\u0442\u0441\u044f \u043a\u0440\u0430\u0439\u043d\u0435 \u0440\u0435\u0434\u043a\u043e. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0442\u0430\u043a\u043e\u0435 \u043f\u043e\u043d\u044f\u0442\u0438\u0435 \u043a\u0430\u043a \u0434\u043e\u043b\u044f \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442\u043e\u0432 \u043c\u0435\u0436\u0434\u0443 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0430\u043c\u0438 \u2014 \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u0435 \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u0439 \u043e\u0442 \u043e\u0431\u0449\u0435\u0433\u043e \u0447\u0438\u0441\u043b\u0430, \u0433\u0434\u0435 \u0434\u0432\u0430 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0430 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0442 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u043d\u0435\u043d\u0443\u043b\u0435\u0432\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f.<\/p>\n<p>\u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u0434\u0430\u0442\u0430\u0441\u0435\u0442 \u0441 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0430\u043c\u0438\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"F0\u2212F4\" alt=\"F0\u2212F4\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/e69\/16a\/40a\/e6916a40a33710f3cfdb686ddeb32836.svg\" width=\"72\" height=\"18\"\/>. \u0412 \u043f\u0435\u0440\u0432\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u0441\u0442\u043e\u0438\u0442 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u0443\u044e \u0434\u043e\u043b\u044e \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442\u043e\u0432, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, 25%. \u0422\u043e\u0433\u0434\u0430 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0438\u0437 8 \u043e\u0431\u0440\u0430\u0437\u0446\u043e\u0432 \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442\u043e\u0432 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c 2. \u0414\u0430\u043b\u0435\u0435 \u0441\u0442\u0440\u043e\u0438\u0442\u0441\u044f \u043c\u0430\u0442\u0440\u0438\u0446\u0430 \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442\u043e\u0432 \u043c\u0435\u0436\u0434\u0443 \u0432\u0441\u0435\u043c\u0438 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0430\u043c\u0438 \u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u043e\u0434\u0441\u0447\u0451\u0442 \u043e\u0431\u0449\u0435\u0439 \u0441\u0443\u043c\u043c\u044b \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442\u043e\u0432 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0430, \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0438\u0445 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430 \u0432 \u043f\u043e\u0440\u044f\u0434\u043a\u0435 \u0443\u0431\u044b\u0432\u0430\u043d\u0438\u044f.<\/p>\n<p>\u041d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043c\u0430\u0442\u0440\u0438\u0446\u044b \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442\u043e\u0432 \u0441\u0442\u0440\u043e\u0438\u0442\u0441\u044f \u0432\u0437\u0432\u0435\u0448\u0435\u043d\u043d\u044b\u0439 \u0433\u0440\u0430\u0444, \u0443 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0432 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u0435 \u043e\u0442\u0441\u0435\u043a\u0430\u044e\u0442\u0441\u044f \u0432\u0441\u0435 \u0440\u0451\u0431\u0440\u0430 \u0441 \u0447\u0438\u0441\u043b\u043e\u043c \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442\u043e\u0432, \u043f\u0440\u0435\u0432\u044b\u0448\u0430\u044e\u0449\u0438\u043c \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435.<\/p>\n<p><strong>\u0420\u0430\u0431\u043e\u0442\u0430 Exclusive Feature Bundling \u0441 \u043d\u0443\u043b\u044f \u043d\u0430 \u043f\u0440\u043e\u0441\u0442\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435<\/strong>  <\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/83f\/597\/550\/83f597550ca2bc91f530fbc91e6244c9.png\" width=\"1243\" height=\"921\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/83f\/597\/550\/83f597550ca2bc91f530fbc91e6244c9.png\"\/><\/figure>\n<p>\u041f\u0435\u0440\u0432\u043e\u0439 \u0441\u0432\u044f\u0437\u043a\u043e\u0439 \u0431\u0443\u0434\u0435\u0442\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"F_0\u2212F_1\" alt=\"F_0\u2212F_1\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/9b0\/6ae\/119\/9b06ae1199b40a101def5b0b25b21162.svg\" width=\"66\" height=\"20\"\/>. \u041d\u0435 \u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0442\u043e \u0447\u0442\u043e\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"F_1\u2212F_2\" alt=\"F_1\u2212F_2\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/cf2\/92b\/4d1\/cf292b4d153231102447d4619b0bedc8.svg\" width=\"66\" height=\"19\"\/>\u00a0\u0438\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"F_1\u2212F_3\" alt=\"F_1\u2212F_3\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/234\/06f\/f9b\/23406ff9b3f16492908df4cfca919a5f.svg\" width=\"66\" height=\"20\"\/>\u00a0\u043d\u0435 \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442\u0443\u044e\u0442, \u0438\u0445 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0438\u0437-\u0437\u0430 \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442\u043e\u0432\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"F_0\u2212F_2\u00a0\" alt=\"F_0\u2212F_2\u00a0\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/97b\/189\/48f\/97b18948fe8f1438cdeb02970082784f.svg\" width=\"66\" height=\"20\"\/> \u0438\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"F_0\u2212F_3\" alt=\"F_0\u2212F_3\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/cc4\/61d\/8b8\/cc461d8b87cf8457308d659bf9aab821.svg\" width=\"66\" height=\"20\"\/>. \u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0441\u0432\u044f\u0437\u043a\u043e\u0439 \u0431\u0443\u0434\u0435\u0442\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"F_2\u2212F_4\" alt=\"F_2\u2212F_4\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/972\/b45\/045\/972b45045ca68b977fa39afddeb52019.svg\" width=\"66\" height=\"19\"\/> . \u041d\u0435 \u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"F_4\" alt=\"F_4\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/132\/b56\/3fe\/132b563fecea4d56d302b28d7de1d94f.svg\" width=\"21\" height=\"19\"\/> \u0438\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"F_3\" alt=\"F_3\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/3ed\/8f6\/615\/3ed8f6615a4702751c9435e62c561ee7.svg\" width=\"21\" height=\"20\"\/>\u00a0\u043d\u0435 \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442\u0443\u044e\u0442, \u0438\u0445 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0438\u0437-\u0437\u0430 \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442\u0430\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"F_2\u2212F_3\" alt=\"F_2\u2212F_3\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/7a3\/69d\/c2a\/7a369dc2a84a02341c3f4116da72e357.svg\" width=\"66\" height=\"20\"\/>. \u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u043c \u043e\u0441\u0442\u0430\u0451\u0442\u0441\u044f \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"F_3\" alt=\"F_3\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/db0\/358\/22a\/db035822a73c424f2d1e930ab39ab936.svg\" width=\"21\" height=\"20\"\/>.<\/p>\n<p>\u041d\u043e\u0432\u0430\u044f \u0441\u0432\u044f\u0437\u043a\u0430 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0441\u0442\u043e\u044f\u0442\u044c \u0438\u0437 \u043d\u0435\u043d\u0443\u043b\u0435\u0432\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0430 \u0438 \u043d\u0435\u043d\u0443\u043b\u0435\u0432\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0432\u0442\u043e\u0440\u043e\u0433\u043e \u043f\u043b\u044e\u0441 \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435, \u0440\u0430\u0432\u043d\u043e\u0435 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u043c\u0443 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0430: \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0430 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0432\u043d\u043e \u0441\u0443\u043c\u043c\u0435 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0445. \u0412 \u0441\u043b\u0443\u0447\u0430\u044f\u0445, \u043a\u043e\u0433\u0434\u0430 \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0435\u0442\u0441\u044f \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442, \u0431\u0435\u0440\u0451\u0442\u0441\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0430 \u0441\u043e \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435\u043c.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/52f\/19d\/559\/52f19d559f1a2b16cb34a1a37483e959.png\" width=\"1161\" height=\"935\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/52f\/19d\/559\/52f19d559f1a2b16cb34a1a37483e959.png\"\/><\/figure>\n<p>\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u044b\u0435 \u0440\u0430\u0441\u0447\u0451\u0442\u044b \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u044b \u043d\u0438\u0436\u0435.  <\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/fce\/032\/60f\/fce03260ff6874a82eb4714d2f3cd252.png\" width=\"1311\" height=\"807\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/fce\/032\/60f\/fce03260ff6874a82eb4714d2f3cd252.png\"\/><\/figure>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/38e\/86d\/e3d\/38e86de3d141f28e3220b2d5a3c01b08.png\" width=\"1297\" height=\"779\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/38e\/86d\/e3d\/38e86de3d141f28e3220b2d5a3c01b08.png\"\/><\/figure>\n<blockquote>\n<p><em>\u041d\u0435\u0442\u0440\u0443\u0434\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c EFB \u043c\u043e\u0436\u043d\u043e \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u0443\u044f \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u043d\u0443\u043b\u0435\u0432\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0432 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0430\u0445. \u0422\u0430\u043a\u0436\u0435 \u0434\u0430\u043d\u043d\u0443\u044e \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044e \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u043a\u00a0histogram-based tree node splitting, \u0447\u0442\u043e \u0432 \u0446\u0435\u043b\u043e\u043c \u0441\u043d\u0438\u0437\u0438\u0442 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u0433\u0438\u0441\u0442\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0441 O(data) \u0434\u043e O(non-zero data).<\/em>  <\/p>\n<\/blockquote>\n<h4>Leaf-wise tree growth<\/h4>\n<figure class=\"float full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/d51\/6c4\/0e4\/d516c40e4dd187bf05a36dd2566fe455.png\" width=\"1603\" height=\"879\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d51\/6c4\/0e4\/d516c40e4dd187bf05a36dd2566fe455.png\"\/><\/figure>\n<p>\u0412\u043c\u0435\u0441\u0442\u043e \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u0434\u0435\u0440\u0435\u0432\u044c\u0435\u0432 \u0441\u043b\u043e\u0439 \u0437\u0430 \u0441\u043b\u043e\u0435\u043c, \u0432 LightGBM \u0434\u0435\u0440\u0435\u0432\u044c\u044f \u0441\u0442\u0440\u043e\u044f\u0442\u0441\u044f \u0432 \u0433\u043b\u0443\u0431\u0438\u043d\u0443: \u0440\u043e\u0441\u0442 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u0442\u0441\u044f \u0432 \u043b\u0438\u0441\u0442\u043e\u0432\u043e\u043c \u0443\u0437\u043b\u0435 \u0441 \u043d\u0430\u0438\u0431\u043e\u043b\u044c\u0448\u0438\u043c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u043c \u043f\u0440\u0438\u0440\u043e\u0441\u0442\u043e\u043c, \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0447\u0435\u0433\u043e \u0434\u0435\u0440\u0435\u0432\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0433\u043b\u0443\u0431\u043e\u043a\u0438\u043c \u0438 \u043d\u0435\u0441\u0438\u043c\u043c\u0435\u0442\u0440\u0438\u0447\u043d\u044b\u043c. \u0427\u0430\u0449\u0435 \u0432\u0441\u0435\u0433\u043e \u0442\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043f\u0440\u0435\u0432\u043e\u0441\u0445\u043e\u0434\u0438\u0442 \u0441\u0438\u043c\u043c\u0435\u0442\u0440\u0438\u0447\u043d\u044b\u0435 \u0434\u0435\u0440\u0435\u0432\u044c\u044f \u0432 \u043f\u043b\u0430\u043d\u0435 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438.<\/p>\n<h4>\u041e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 \u043d\u0430 GPU<\/h4>\n<p>\u041f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u0431\u043e\u043b\u044c\u0448\u0438\u043c\u0438 \u0434\u0430\u0442\u0430\u0441\u0435\u0442\u0430\u043c\u0438 \u0432 LightGBM \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 GPU, \u043d\u043e \u0438 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u0435 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 \u0441\u0440\u0430\u0437\u0443 \u043d\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u043c\u0430\u0448\u0438\u043d\u0430\u0445.<\/p>\n<p>\u041d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u044b:<\/p>\n<ul>\n<li>\n<p>Data parallel (\u043e\u0431\u0440\u0430\u0437\u0446\u044b \u0434\u0430\u0442\u0430\u0441\u0435\u0442\u0430 \u0440\u0430\u0437\u0431\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u043d\u0430 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0435 \u0433\u0438\u0441\u0442\u043e\u0433\u0440\u0430\u043c\u043c\u044b, \u043a\u0430\u0436\u0434\u0430\u044f \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e);<\/p>\n<\/li>\n<li>\n<p>Feature parallel (\u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0438 \u0434\u0430\u0442\u0430\u0441\u0435\u0442\u0430 \u0440\u0430\u0437\u0431\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u043d\u0430 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0435 \u0433\u0438\u0441\u0442\u043e\u0433\u0440\u0430\u043c\u043c\u044b, \u043a\u0430\u0436\u0434\u0430\u044f \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e);<\/p>\n<\/li>\n<li>\n<p>Voting parallel (\u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f K \u043b\u0443\u0447\u0448\u0438\u0445 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432 \u0434\u043b\u044f \u0440\u0430\u0437\u0431\u0438\u0435\u043d\u0438\u044f, \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u043d\u0430\u0438\u043b\u0443\u0447\u0448\u0438\u0439 \u0438\u0437 \u043d\u0438\u0445 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e).<\/p>\n<\/li>\n<\/ul>\n<h4>\u041f\u0430\u043a\u0435\u0442\u043d\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f LightGBM \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 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 LightGBM \u043f\u043e\u043a\u0430\u0437\u0430\u043b \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438 \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043b\u0443\u0447\u0448\u0435, \u0447\u0435\u043c \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0435 \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0431\u0443\u0441\u0442\u0438\u043d\u0433\u0430. \u0422\u0430\u043a\u0436\u0435 \u0441\u0442\u043e\u0438\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0438\u0437 \u0432\u0441\u0435\u0445 \u0442\u0440\u0451\u0445 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u043d\u044b\u0445 \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0435\u0439 \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u043d\u043e\u0433\u043e \u0431\u0443\u0441\u0442\u0438\u043d\u0433\u0430 LightGBM \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u0430\u043c\u043e\u0439 \u0431\u044b\u0441\u0442\u0440\u043e\u0439: \u0447\u0435\u043c \u0431\u043e\u043b\u044c\u0448\u0435 \u0434\u0430\u0442\u0430\u0441\u0435\u0442, \u0442\u0435\u043c \u0441\u0438\u043b\u044c\u043d\u0435\u0435 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043c\u0435\u0442\u043d\u0430 \u0440\u0430\u0437\u043d\u0438\u0446\u0430 \u0432 \u043f\u043b\u0430\u043d\u0435 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438.<\/p>\n<p>\u041f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u044b \u043d\u0438\u0436\u0435.<\/p>\n<p><strong>LGBMClassifier<\/strong>  <\/p>\n<pre><code class=\"python\">from lightgbm import LGBMClassifier, LGBMRegressor  lgb_clf = LGBMClassifier(random_state=0, verbose=-1) lgb_clf.fit(X1_train, y1_train) lgb_clf_pred_res = lgb_clf.predict(X1_test) lgb_clf_accuracy = accuracy_score(lgb_clf_pred_res, y1_test) print(f'lgb_clf accuracy: {lgb_clf_accuracy}') print(lgb_clf_pred_res)  feature_indexes = [1, 3] title4 = 'LGBMClassifier surface' decision_boundary_plot(X1, y1, X1_train, y1_train, lgb_clf, feature_indexes, title4)   lgb_clf accuracy: 0.7407407407407407 [5 0 1 4 1 1 0 1 1 1 0 0 0 1 1 5 2 1 2 2 3 1 5 5 0 0 5 0 1 1 0 0 1 0 0 0 0  0 0 5 1 4 1 0 0 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\/dc0\/589\/450\/dc05894505f5895e1658a3b3f51c8409.png\" width=\"554\" height=\"455\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/dc0\/589\/450\/dc05894505f5895e1658a3b3f51c8409.png\"\/><\/figure>\n<p><strong>LGBMRegressor<\/strong>  <\/p>\n<pre><code class=\"python\">lgb_reg = LGBMRegressor(random_state=0, verbose=-1) lgb_reg.fit(X2_train, y2_train) lgb_reg_pred_res = lgb_reg.predict(X2_test) lgb_reg_mape = mean_absolute_percentage_error(lgb_reg_pred_res, y2_test) print(f'lgb_reg_mape: {lgb_reg_mape}') print(lgb_reg_pred_res)   lgb_reg_mape: 0.349719771087187 [261.46864967 223.24674049 179.60231224 104.76984808 197.67529058  264.26116883 111.11355079 243.72059654 144.18045853 239.08131542  199.90841705 170.37417433 151.67933516  89.30779664 297.93561211   96.58862229 162.53285879  70.06113305 108.36436227 234.16276627  207.7552967  136.83913826 172.38724529 110.26981866 228.1574526  163.56817258 108.94516511  73.93303203 233.31869769 116.00042252  195.39846082  72.54403358 164.38943926 194.42418913 130.42154381  183.04435501 173.56352142 147.00774306  89.07365731 175.25759644  108.72749406 144.48000593  99.60713604 196.86889512 160.47835096   60.17798032 133.4909559  115.46543242  64.48286456 251.20520649  135.52608509  45.16396653 161.70420785 187.28406745 274.21158331  179.30355071 150.1563969  111.1275583  100.5067047  133.7868607  269.98464504 159.03980859 118.01578638  75.41625416 249.0569831  133.99026562 111.43954756 221.81954307 206.02676942  81.56098377   72.5920367  101.31664062  93.31261471 111.24487763 149.40048547  177.37205369 130.08118649 212.0573     294.138509   232.24330644  109.5457663  181.3487432   63.20386576 261.47508264  88.43007908   99.59568927 127.97978786 211.77672798 121.44351586 138.27282283  121.01455597  91.26965383  68.92870597 156.03234199 101.80734511  108.60244399 214.13968395 218.58499151 131.09438025 114.99269899  187.63688894 117.5399017  165.85959666 110.74981366 238.97897095  114.01806217 240.07138204 283.0195311  108.08395213  67.44250127  238.97271264]<\/code><\/pre>\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 LightGBM<\/h4>\n<p><em><u>\u041f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430<\/u><\/em>:<\/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 \u0438 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f;<\/p>\n<\/li>\n<li>\n<p>\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0430\u043c\u0438;<\/p>\n<\/li>\n<li>\n<p>\u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0433\u0438\u043f\u0435\u0440\u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0434\u043b\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430;<\/p>\n<\/li>\n<li>\n<p>\u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u043c\u043d\u043e\u0433\u0438\u0445 \u0437\u0430\u0434\u0430\u0447.<\/p>\n<\/li>\n<\/ul>\n<p><em><u>\u041d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u0438<\/u><\/em>:<\/p>\n<ul>\n<li>\n<p>\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u0430 \u043d\u0435\u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u0430\u044f \u0440\u0430\u0431\u043e\u0442\u0430 \u043d\u0430 \u0434\u0430\u0442\u0430\u0441\u0435\u0442\u0430\u0445 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0430;<\/p>\n<\/li>\n<li>\n<p>\u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0438\u0437-\u0437\u0430 \u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0433\u0438\u043f\u0435\u0440\u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432.<\/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 \u00abLightGBM: A Highly Efficient Gradient Boosting Decision Tree\u00bb, Guolin Ke, Qi Meng, Thomas Finley, Taifeng Wang, Wei Chen, Weidong Ma, Qiwei Ye, Tie-Yan Liu.<\/p>\n<p><a href=\"https:\/\/lightgbm.readthedocs.io\/en\/latest\/index.html\" rel=\"noopener noreferrer nofollow\">\u0414\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f<\/a>.<\/p>\n<p>\u041b\u0435\u043a\u0446\u0438\u0438:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/www.youtube.com\/watch?v=NH0ozgXjrzk&amp;t=304s&amp;ab_channel=%D0%A6%D0%B5%D0%BD%D1%82%D1%80digital%D0%BF%D1%80%D0%BE%D1%84%D0%B5%D1%81%D1%81%D0%B8%D0%B9ITtensive\" rel=\"noopener noreferrer nofollow\">\u043e\u0434\u0438\u043d<\/a>;<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/www.youtube.com\/watch?v=qGsHlvE8KZM&amp;ab_channel=PyData\" rel=\"noopener noreferrer nofollow\">\u0434\u0432\u0430<\/a>;<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/www.youtube.com\/watch?v=E1-FFzKuDgY&amp;list=PLgaemU2xZlTgJhfBHnolmS-8WwsFifnFn&amp;index=2&amp;ab_channel=meanxai\" rel=\"noopener noreferrer nofollow\">\u0442\u0440\u0438<\/a>;<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/www.youtube.com\/watch?v=fU_X_c1W3r4&amp;list=PLgaemU2xZlTgJhfBHnolmS-8WwsFifnFn&amp;index=1&amp;ab_channel=meanxai\" rel=\"noopener noreferrer nofollow\">\u0447\u0435\u0442\u044b\u0440\u0435<\/a>.<\/p>\n<\/li>\n<\/ul>\n<hr\/>\n<p><a class=\"anchor\" name=\"best_boosting\" id=\"best_boosting\"><\/a><\/p>\n<h3>\u041a\u0430\u043a\u043e\u0439 \u0431\u0443\u0441\u0442\u0438\u043d\u0433 \u043b\u0443\u0447\u0448\u0435<\/h3>\n<p>\u041e\u0434\u043d\u043e\u0437\u043d\u0430\u0447\u043d\u043e\u0433\u043e \u043e\u0442\u0432\u0435\u0442\u0430 \u043d\u0430 \u0432\u043e\u043f\u0440\u043e\u0441 \u043a\u0430\u043a\u043e\u0439 \u0431\u0443\u0441\u0442\u0438\u043d\u0433 \u043b\u0443\u0447\u0448\u0435 \u043d\u0435\u0442. \u0415\u0441\u043b\u0438 \u0440\u0430\u043d\u044c\u0448\u0435 \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0430\u043c\u0438 \u043b\u0443\u0447\u0448\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c CatBoost, \u043a\u043e\u0433\u0434\u0430 \u0432\u0430\u0436\u043d\u0430 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u2014 LightGBM, \u043d\u0443 \u0438\u043b\u0438 XGBoost, \u0435\u0441\u043b\u0438 \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0438 \u043d\u0435\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043d\u0430 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u044b, \u0442\u043e \u0441\u0435\u0439\u0447\u0430\u0441 \u0442\u0430\u043a\u043e\u0435 \u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u0435 \u0431\u0443\u0434\u0435\u0442 \u043d\u0435\u0432\u0435\u0440\u043d\u044b\u043c: \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0432\u0441\u0435 \u0442\u0440\u0438 \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0443\u0441\u043f\u0435\u043b\u0438 \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0440\u0443\u0433 \u0443 \u0434\u0440\u0443\u0433\u0430 \u043c\u043d\u043e\u0433\u043e \u0445\u043e\u0440\u043e\u0448\u0438\u0445 \u0438\u0434\u0435\u0439, \u043d\u043e \u0438\u0441\u0442\u043e\u0440\u0438\u0447\u0435\u0441\u043a\u0438 \u043e\u043d\u0438 \u043e\u0442\u043b\u0438\u0447\u0430\u043b\u0438\u0441\u044c \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0441\u0438\u043b\u044c\u043d\u043e.<\/p>\n<p>\u0411\u043e\u043b\u0435\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u043c \u0431\u0443\u0434\u0435\u0442 \u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u0435, \u0447\u0442\u043e \u0432\u044b\u0431\u043e\u0440 \u043d\u0430\u0438\u043b\u0443\u0447\u0448\u0435\u0433\u043e \u0431\u0443\u0441\u0442\u0438\u043d\u0433\u0430 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u0432\u0438\u0441\u0435\u0442\u044c \u043e\u0442 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 \u0438 \u0434\u0430\u043d\u043d\u044b\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f \u0434\u043b\u044f \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u043c\u043e\u0434\u0435\u043b\u0438: \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u044f\u0445 \u043e\u0434\u043d\u0438 \u0438 \u0442\u0435 \u0436\u0435 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b \u043c\u043e\u0433\u0443\u0442 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043a\u0430\u043a \u043b\u0443\u0447\u0448\u0438\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0432 \u043f\u043b\u0430\u043d\u0435 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0438 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438, \u0442\u0430\u043a \u0438 \u043d\u0430\u043e\u0431\u043e\u0440\u043e\u0442 \u2014 \u0445\u0443\u0434\u0448\u0438\u0435. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0432\u044b\u0431\u043e\u0440 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0431\u0443\u0441\u0442\u0438\u043d\u0433\u0430 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0442\u044c\u0441\u044f \u0432 \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0438 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u043e\u0432 \u0441 \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f\u043c\u0438 \u0438 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0445 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432.<\/p>\n<p>\u041d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0445 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u0432 \u0441\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435\u043c \u0431\u0443\u0441\u0442\u0438\u043d\u0433\u043e\u0432: <a href=\"https:\/\/neptune.ai\/blog\/when-to-choose-catboost-over-xgboost-or-lightgbm\" rel=\"noopener noreferrer nofollow\">\u043e\u0434\u0438\u043d<\/a>,\u00a0<a href=\"https:\/\/www.kaggle.com\/code\/faressayah\/xgboost-vs-lightgbm-vs-catboost-vs-adaboost\" rel=\"noopener noreferrer nofollow\">\u0434\u0432\u0430<\/a>,\u00a0<a href=\"https:\/\/medium.com\/riskified-technology\/xgboost-lightgbm-or-catboost-which-boosting-algorithm-should-i-use-e7fda7bb36bc\" rel=\"noopener noreferrer nofollow\">\u0442\u0440\u0438<\/a>.<\/p>\n<hr\/>\n<p><a href=\"https:\/\/habr.com\/ru\/articles\/800499\/\" rel=\"noopener noreferrer nofollow\"><strong>? AdaBoost<\/strong><\/a><strong>  |  <\/strong><a href=\"https:\/\/habr.com\/ru\/articles\/799483\/\" rel=\"noopener noreferrer nofollow\"><strong>\u0421\u0442\u0435\u043a\u0438\u043d\u0433 \u0438 \u0431\u043b\u0435\u043d\u0434\u0438\u043d\u0433 \u0432 ML ?<\/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\/799725\/\"> https:\/\/habr.com\/ru\/articles\/799725\/<\/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>\u041d\u0430 \u0441\u0435\u0433\u043e\u0434\u043d\u044f\u0448\u043d\u0438\u0439 \u0434\u0435\u043d\u044c \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u043d\u044b\u0439 \u0431\u0443\u0441\u0442\u0438\u043d\u0433 (gradient boosting machine) \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0434\u043d\u0438\u043c \u0438\u0437 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 production-\u0440\u0435\u0448\u0435\u043d\u0438\u0439 \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u0442\u0430\u0431\u043b\u0438\u0447\u043d\u044b\u043c\u0438, \u043d\u0435\u043e\u0434\u043d\u043e\u0440\u043e\u0434\u043d\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043e\u0431\u043b\u0430\u0434\u0430\u0435\u0442 \u0432\u044b\u0441\u043e\u043a\u043e\u0439 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c\u044e \u0438 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c\u044e, \u0430 \u0435\u0441\u043b\u0438 \u0431\u044b\u0442\u044c \u0442\u043e\u0447\u043d\u0435\u0435, \u0442\u043e \u0435\u0433\u043e \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438, \u0440\u0435\u0447\u044c \u043e \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043f\u043e\u0439\u0434\u0451\u0442 \u0447\u0443\u0442\u044c \u043f\u043e\u0437\u0436\u0435.<\/p>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0430 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u043d\u043e\u0433\u043e \u0431\u0443\u0441\u0442\u0438\u043d\u0433\u0430 GBM \u0441 \u043d\u0443\u043b\u044f \u043d\u0430 Python, \u043d\u043e \u0430 \u0442\u0430\u043a\u0436\u0435 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u044b \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0435 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0435\u0433\u043e \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0439.<\/p>\n<blockquote>\n<p><em>\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<\/em><a href=\"https:\/\/www.kaggle.com\/code\/egazakharenko\/gradient-boosting-from-scratch-full-tutorial\" rel=\"noopener noreferrer nofollow\"><strong><em>Kaggle<\/em><\/strong><\/a><em>\u00a0(eng) \u0438\u00a0<\/em><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\/10%29%20%D0%93%D1%80%D0%B0%D0%B4%D0%B8%D0%B5%D0%BD%D1%82%D0%BD%D1%8B%D0%B9%20%D0%B1%D1%83%D1%81%D1%82%D0%B8%D0%BD%D0%B3%20%28GBM%2C%20XGBoost%2C%20CatBoost%2C%20LightGBM%29.ipynb\" rel=\"noopener noreferrer nofollow\"><strong><em>GitHub<\/em><\/strong><\/a><em>\u00a0(rus).<\/em>  <\/p>\n<\/blockquote>\n<h3>\u0421\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435<\/h3>\n<p><a href=\"#gradient_boosting_machine\" rel=\"noopener noreferrer nofollow\">Gradient Boosting Machine<\/a><\/p>\n<p><a href=\"#xgboost\" rel=\"noopener noreferrer nofollow\">\u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 XGBoost<\/a><\/p>\n<p><a href=\"#catboost\" rel=\"noopener noreferrer nofollow\">\u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 CatBoost<\/a><\/p>\n<p><a href=\"#lightgbm\" rel=\"noopener noreferrer nofollow\">\u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 LightGBM<\/a><\/p>\n<p><a href=\"#best_boosting\" rel=\"noopener noreferrer nofollow\">\u041a\u0430\u043a\u043e\u0439 \u0431\u0443\u0441\u0442\u0438\u043d\u0433 \u043b\u0443\u0447\u0448\u0435<\/a><\/p>\n<p><a class=\"anchor\" name=\"gradient_boosting_machine\" id=\"gradient_boosting_machine\"><\/a><\/p>\n<h3>Gradient Boosting Machine<\/h3>\n<p>\u041a\u0430\u043a \u0438 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441 Adaboost, \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u043d\u044b\u0439 \u0431\u0443\u0441\u0442\u0438\u043d\u0433 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u0431\u0430\u0437\u043e\u0432\u044b\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u0432 \u0430\u043d\u0441\u0430\u043c\u0431\u043b\u044c \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u043e\u0434\u043d\u0430\u043a\u043e \u0432\u043c\u0435\u0441\u0442\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0441 \u0443\u0447\u0451\u0442\u043e\u043c \u0432\u0435\u0441\u043e\u0432 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043e\u0448\u0438\u0431\u043e\u043a \u043f\u0440\u0435\u0434\u0448\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u0438\u043a\u043e\u0432, \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u043e\u0431\u0443\u0447\u0430\u044e\u0442\u0441\u044f \u043d\u0430 \u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u044b\u0445 \u043e\u0448\u0438\u0431\u043a\u0430\u0445 (residual errors), \u0434\u043e\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0445 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u043c\u0438 \u043c\u043e\u0434\u0435\u043b\u044f\u043c\u0438.<\/p>\n<h4>\u041f\u0440\u0438\u043d\u0446\u0438\u043f \u0440\u0430\u0431\u043e\u0442\u044b \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u043d\u043e\u0433\u043e \u0431\u0443\u0441\u0442\u0438\u043d\u0433\u0430 \u0434\u043b\u044f \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u0438<\/h4>\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<ul>\n<li>\n<p>1) \u043f\u0435\u0440\u0432\u043e\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u043c\u0443 \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u0443 \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0441\u0440\u0435\u0434\u043d\u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 y_train \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u043e\u0431\u0440\u0430\u0437\u0446\u043e\u0432;<\/p>\n<\/li>\n<li>\n<p>2) \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043e\u0441\u0442\u0430\u0442\u043a\u0438 \u043c\u043e\u0434\u0435\u043b\u0438 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0430\u043d\u0442\u0438\u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043f\u043e\u0442\u0435\u0440\u044c;<\/p>\n<\/li>\n<li>\n<p>3) \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u043e\u043d\u043d\u043e\u0435 \u0434\u0435\u0440\u0435\u0432\u043e \u043e\u0431\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u043d\u0430 X_train \u0438 \u043e\u0441\u0442\u0430\u0442\u043a\u0430\u0445, \u0434\u0430\u043b\u0435\u0435 \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0433\u043d\u043e\u0437 \u043d\u0430 X_train;<\/p>\n<\/li>\n<li>\n<p>4) \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 \u043f\u0440\u043e\u0433\u043d\u043e\u0437 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043a \u043f\u0435\u0440\u0432\u043e\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u043c\u0443 \u0438 \u0448\u0430\u0433\u0438 2-4 \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u044e\u0442\u0441\u044f \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0434\u0435\u0440\u0435\u0432\u0430;<\/p>\n<\/li>\n<li>\n<p>5) \u043f\u043e\u0441\u043b\u0435 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u0432\u0441\u0435\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0441\u043d\u043e\u0432\u0430 \u0441\u043e\u0437\u0434\u0430\u0451\u0442\u0441\u044f \u043f\u0435\u0440\u0432\u043e\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u0440\u043e\u0433\u043d\u043e\u0437 \u0438\u0437 \u0448\u0430\u0433\u0430 1;<\/p>\n<\/li>\n<li>\n<p>6) \u0434\u0430\u043b\u0435\u0435 \u0434\u0435\u043b\u0430\u044e\u0442\u0441\u044f \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u044b \u0434\u043b\u044f X_test \u043d\u0430 \u043e\u0431\u0443\u0447\u0435\u043d\u043d\u044b\u0445 \u0434\u0435\u0440\u0435\u0432\u044c\u044f\u0445 \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043a \u043f\u0435\u0440\u0432\u043e\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u043c\u0443;<\/p>\n<\/li>\n<li>\n<p>7) \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u0430\u044f \u0441\u0443\u043c\u043c\u0430 \u0438 \u0431\u0443\u0434\u0435\u0442 \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u043c \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u043e\u043c.<\/p>\n<\/li>\n<\/ul>\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>\u0424\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u043e\u0442\u0435\u0440\u044c:  <\/p>\n<p>\u041e\u0441\u0442\u0430\u0442\u043a\u0438:  <\/p>\n<h4>\u041f\u0440\u0438\u043d\u0446\u0438\u043f \u0440\u0430\u0431\u043e\u0442\u044b \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u043d\u043e\u0433\u043e \u0431\u0443\u0441\u0442\u0438\u043d\u0433\u0430 \u0434\u043b\u044f \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438<\/h4>\n<p>\u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0434\u0435\u043b\u0430 \u043e\u0431\u0441\u0442\u043e\u044f\u0442 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0441\u043b\u043e\u0436\u043d\u0435\u0435: \u043a \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u043e\u043c\u0443 \u043a\u043b\u0430\u0441\u0441\u0443 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c one-hot encoding \u0438 \u043f\u0435\u0440\u0435\u0432\u0435\u0441\u0442\u0438 \u0432 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e softmax-\u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0430 \u043a \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u0430\u043c \u0434\u0435\u0440\u0435\u0432\u044c\u0435\u0432 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u00a0, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0440\u0435\u0433\u0443\u043b\u0438\u0440\u0443\u0435\u0442 \u0441\u0442\u0435\u043f\u0435\u043d\u044c \u0432\u043a\u043b\u0430\u0434\u0430 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043d\u043e\u0432\u043e\u0433\u043e \u0434\u0435\u0440\u0435\u0432\u0430 \u0432 \u043e\u0431\u0449\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c \u0434\u043b\u044f \u0441\u043d\u0438\u0436\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f. \u0422\u0430\u043a\u0436\u0435 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u043e\u0432 \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u043d\u043e\u0433\u043e \u0431\u0443\u0441\u0442\u0438\u043d\u0433\u0430 \u043c\u043e\u0436\u043d\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0443\u043b\u0443\u0447\u0448\u0438\u0442\u044c, \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0432 \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u044e K-class LogitBoost: \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0434\u0435\u0440\u0435\u0432\u0430 \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0432\u0435\u0441\u0430, \u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0442\u043e\u043c \u043d\u0430 \u0438\u0445 \u043e\u0441\u043d\u043e\u0432\u0435 \u043e\u0441\u0442\u0430\u0442\u043a\u0438.<\/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<ul>\n<li>\n<p>1) \u0434\u043b\u044f y_train \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f one-hot encoding \u0438 \u043f\u0435\u0440\u0432\u043e\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u043c\u0443 \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u0443 \u043f\u0440\u0438c\u0432\u0430\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f 0 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430;<\/p>\n<\/li>\n<li>\n<p>2) \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u044b \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u044e\u0442\u0441\u044f \u0432 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e softmax-\u0444\u0443\u043d\u043a\u0446\u0438\u0438;<\/p>\n<\/li>\n<li>\n<p>3) \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043e\u0441\u0442\u0430\u0442\u043a\u0438 \u043c\u043e\u0434\u0435\u043b\u0438 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0430\u043d\u0442\u0438\u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043f\u043e\u0442\u0435\u0440\u044c \u0438 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0435\u0439 (\u0430 \u0442\u0430\u043a\u0436\u0435 \u0432\u0435\u0441\u0430 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 LogitBoost);<\/p>\n<\/li>\n<li>\n<p>4) \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u043e\u043d\u043d\u043e\u0435 \u0434\u0435\u0440\u0435\u0432\u043e \u043e\u0431\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u043d\u0430 X_train \u0438 \u043e\u0441\u0442\u0430\u0442\u043a\u0430\u0445 (\u0430 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 LogitBoost \u0435\u0449\u0451 \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0432\u0435\u0441\u0430), \u0434\u0430\u043b\u0435\u0435 \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0433\u043d\u043e\u0437 \u043d\u0430 X_train;<\/p>\n<\/li>\n<li>\n<p>5) \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043b\u0438\u0441\u0442\u0430 \u0432 \u0434\u0435\u0440\u0435\u0432\u0435 \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u044b\u00a0 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043e\u0441\u0442\u0430\u0442\u043a\u043e\u0432, \u0432\u0437\u044f\u0442\u044b\u0445 \u043f\u043e \u043f\u043e\u0437\u0438\u0446\u0438\u044f\u043c \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u0439, \u043f\u043e\u043f\u0430\u0432\u0448\u0438\u0445 \u0432 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u0439 \u0432 \u043b\u0438\u0441\u0442\u043e\u0432\u043e\u0439 \u0443\u0437\u0435\u043b;<\/p>\n<\/li>\n<li>\n<p>6) \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u044b \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 \u0438 \u0441\u0443\u043c\u043c\u0430 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u043e\u0432\u00a0\u00a0\u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043a \u043f\u0435\u0440\u0432\u043e\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u043c;<\/p>\n<\/li>\n<li>\n<p>7) \u0448\u0430\u0433\u0438 2-6 \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u044e\u0442\u0441\u044f \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0434\u0435\u0440\u0435\u0432\u0430 \u0432 \u043a\u0430\u0436\u0434\u043e\u043c \u043a\u043b\u0430\u0441\u0441\u0435;<\/p>\n<\/li>\n<li>\n<p>8) \u043f\u043e\u0441\u043b\u0435 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u0432\u0441\u0435\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0441\u043e\u0437\u0434\u0430\u0451\u0442\u0441\u044f \u043f\u0435\u0440\u0432\u043e\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u0440\u043e\u0433\u043d\u043e\u0437 \u0438\u0437 \u0448\u0430\u0433\u0430 1;<\/p>\n<\/li>\n<li>\n<p>9) \u0434\u0430\u043b\u0435\u0435 \u0434\u0435\u043b\u0430\u044e\u0442\u0441\u044f \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u044b \u0434\u043b\u044f X_test \u043d\u0430 \u043e\u0431\u0443\u0447\u0435\u043d\u043d\u044b\u0445 \u0434\u0435\u0440\u0435\u0432\u044c\u044f\u0445 \u043f\u043e \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u043a\u043b\u0430\u0441\u0441\u0443 \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043a \u043f\u0435\u0440\u0432\u043e\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u043c;<\/p>\n<\/li>\n<li>\n<p>10) \u043a\u043b\u0430\u0441\u0441\u044b \u0441 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0443\u043c\u043c\u043e\u0439 \u0438 \u0431\u0443\u0434\u0443\u0442 \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u043c \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u043e\u043c.<\/p>\n<\/li>\n<\/ul>\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>\u0424\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u043e\u0442\u0435\u0440\u044c:<\/p>\n<p>\u0412\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430:<\/p>\n<p>\u041e\u0441\u0442\u0430\u0442\u043a\u0438:<\/p>\n<p>\u041a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442  :<\/p>\n<p>\u0412\u0435\u0441\u0430 \u0434\u043b\u044f K-class LogitBoost:<\/p>\n<p>\u041e\u0441\u0442\u0430\u0442\u043a\u0438 \u0434\u043b\u044f K-class LogitBoost:<\/p>\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.tree import DecisionTreeRegressor from sklearn.ensemble import GradientBoostingClassifier, GradientBoostingRegressor from sklearn.ensemble import HistGradientBoostingClassifier, HistGradientBoostingRegressor 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 GBMClassifier:     def __init__(self, logitboost=False, learning_rate=0.1, n_estimators=100,                  max_depth=3, random_state=0):         self.logitboost = logitboost         self.learning_rate = learning_rate         self.n_estimators = n_estimators         self.max_depth = max_depth         self.random_state = random_state      def _softmax(self, predictions):         exp = np.exp(predictions)          return exp \/ np.sum(exp, axis=1, keepdims=True)      def _compute_gammas(self, residuals, leaf_indexes, eps=1e-4):         gammas = []          for j in np.unique(leaf_indexes):             x_i = np.where(leaf_indexes == j)             numerator = np.sum(residuals[x_i])             norm_residuals_xi = np.linalg.norm(residuals[x_i]) + eps             denominator = np.sum(norm_residuals_xi * (1 - norm_residuals_xi))             gamma = (self.K - 1) \/ self.K * numerator \/ denominator             gammas.append(gamma)          return gammas      def fit(self, X, y):         self.K = len(np.unique(y))         self.trees = {k: [] for k in range(self.K)}         one_hot_y = pd.get_dummies(y).to_numpy()   # one-hot encoding         predictions = np.zeros(one_hot_y.shape)          for _ in range(self.n_estimators):             probabilities = self._softmax(predictions)              for k in range(self.K):                 if self.logitboost:   # based on K-class LogitBoost                     numerator = (one_hot_y.T[k] - probabilities.T[k])                     denominator = probabilities.T[k] * (1 - probabilities.T[k])                     residuals = (self.K - 1) \/ self.K * numerator \/ denominator                     weights = denominator                 else:                     residuals = one_hot_y.T[k] - probabilities.T[k]                     weights = None                  tree = DecisionTreeRegressor(criterion='friedman_mse', max_depth=self.max_depth,                                              random_state=self.random_state)                 tree.fit(X, residuals, sample_weight=weights)                 self.trees[k].append(tree)                  leaf_indexes = tree.apply(X)                 gammas = [] if self.logitboost else self._compute_gammas(residuals, leaf_indexes)                 predictions.T[k] += self.learning_rate * tree.predict(X) + np.sum(gammas)      def predict(self, samples):         predictions = np.zeros((len(samples), self.K))          for i in range(self.n_estimators):             for k in range(self.K):                 predictions.T[k] += self.learning_rate * self.trees[k][i].predict(samples)          return np.argmax(predictions, axis=1)<\/code><\/pre>\n<pre><code class=\"python\">class GBMRegressor:     def __init__(self, learning_rate=0.1, n_estimators=100, max_depth=3, random_state=0):         self.learning_rate = learning_rate         self.n_estimators = n_estimators         self.max_depth = max_depth         self.random_state = random_state         self.trees = []      def fit(self, X, y):         self.initial_leaf = y.mean()         predictions = np.zeros(len(y)) + self.initial_leaf          for _ in range(self.n_estimators):             residuals = y - predictions             tree = DecisionTreeRegressor(criterion='friedman_mse', max_depth=self.max_depth,                                          random_state=self.random_state)             tree.fit(X, residuals)             predictions += self.learning_rate * tree.predict(X)             self.trees.append(tree)      def predict(self, samples):         predictions = np.zeros(len(samples)) + self.initial_leaf          for i in range(self.n_estimators):             predictions += self.learning_rate * self.trees[i].predict(samples)          return predictions<\/code><\/pre>\n<h4>\u041a\u043e\u0434 \u0434\u043b\u044f \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0438 \u0440\u0435\u0448\u0430\u044e\u0449\u0438\u0445 \u0433\u0440\u0430\u043d\u0438\u0446<\/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<blockquote>\n<p><em>\u0414\u0430\u043d\u043d\u044b\u0435 \u043d\u0438\u0436\u0435 \u0431\u0443\u0434\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445 \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0439 \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u043d\u043e\u0433\u043e \u0431\u0443\u0441\u0442\u0438\u043d\u0433\u0430.<\/em><\/p>\n<\/blockquote>\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<\/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-370613","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/370613","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=370613"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/370613\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=370613"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=370613"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=370613"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}