{"id":289525,"date":"2018-09-17T21:50:03","date_gmt":"2018-09-17T17:50:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=289525"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=289525","title":{"rendered":"\u0427\u0442\u043e \u0432\u043d\u0443\u0442\u0440\u0438 XGBoost, \u0438 \u043f\u0440\u0438 \u0447\u0435\u043c \u0437\u0434\u0435\u0441\u044c Go"},"content":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\">\u0412 \u043c\u0438\u0440\u0435 \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u043e\u0434\u043d\u0438\u043c\u0438 \u0438\u0437 \u0441\u0430\u043c\u044b\u0445 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u0442\u0438\u043f\u043e\u0432 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0440\u0435\u0448\u0430\u044e\u0449\u0435\u0435 \u0434\u0435\u0440\u0435\u0432\u043e \u0438 \u0430\u043d\u0441\u0430\u043c\u0431\u043b\u0438 \u043d\u0430 \u0438\u0445 \u043e\u0441\u043d\u043e\u0432\u0435. \u041f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430\u043c\u0438 \u0434\u0435\u0440\u0435\u0432\u044c\u0435\u0432 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f: \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u0430 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0446\u0438\u0438, \u043d\u0435\u0442 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0439 \u043d\u0430 \u0432\u0438\u0434 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0439 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438, \u043c\u044f\u0433\u043a\u0438\u0435 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f \u043a \u0440\u0430\u0437\u043c\u0435\u0440\u0443 \u0432\u044b\u0431\u043e\u0440\u043a\u0443. \u0414\u0435\u0440\u0435\u0432\u044c\u044f \u0438\u043c\u0435\u044e\u0442 \u0438 \u043a\u0440\u0443\u043f\u043d\u044b\u0439 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u043a \u2014 \u0441\u043a\u043b\u043e\u043d\u043d\u043e\u0441\u0442\u044c \u043a \u043f\u0435\u0440\u0435\u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044e. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u043e\u0447\u0442\u0438 \u0432\u0441\u0435\u0433\u0434\u0430 \u0434\u0435\u0440\u0435\u0432\u044c\u044f \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u044e\u0442 \u0432 \u0430\u043d\u0441\u0430\u043c\u0431\u043b\u0438: \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0439 \u043b\u0435\u0441, \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u043d\u044b\u0439 \u0431\u0443\u0441\u0442\u0438\u043d\u0433 \u0438 \u0434\u0440. \u0421\u043b\u043e\u0436\u043d\u043e\u0439 \u0442\u0435\u043e\u0440\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0438 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0435\u0439 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0434\u0435\u0440\u0435\u0432\u044c\u0435\u0432 \u0438 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0438\u0445 \u0432 \u0430\u043d\u0441\u0430\u043c\u0431\u043b\u0438. \u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0436\u0435 \u0441\u0442\u0430\u0442\u044c\u0435 \u0431\u0443\u0434\u0443\u0442 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u044b \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0430 \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u0438\u0439 \u043f\u043e \u0443\u0436\u0435 \u043e\u0431\u0443\u0447\u0435\u043d\u043d\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \u0430\u043d\u0441\u0430\u043c\u0431\u043b\u044f \u0434\u0435\u0440\u0435\u0432\u044c\u0435\u0432, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0439 \u0432 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430\u0445 \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u043d\u043e\u0433\u043e \u0431\u0443\u0441\u0442\u0438\u043d\u0433\u0430 <a href=\"https:\/\/github.com\/dmlc\/xgboost\"><code>XGBoost<\/code><\/a> \u0438 <a href=\"https:\/\/github.com\/Microsoft\/LightGBM\"><code>LightGBM<\/code><\/a>. \u0410 \u0442\u0430\u043a \u0436\u0435 \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044c \u043f\u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u0441\u044f \u0441 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439 <a href=\"https:\/\/github.com\/dmitryikh\/leaves\"><code>leaves<\/code><\/a> \u0434\u043b\u044f Go, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u0438\u044f \u0434\u043b\u044f \u0430\u043d\u0441\u0430\u043c\u0431\u043b\u0435\u0439 \u0434\u0435\u0440\u0435\u0432\u044c\u0435\u0432, \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043f\u0440\u0438 \u044d\u0442\u043e\u043c C API \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a.<\/p>\n<p>  <a name=\"habracut\"><\/a>  <\/p>\n<h2> \u041e\u0442\u043a\u0443\u0434\u0430 \u0440\u0430\u0441\u0442\u0443\u0442 \u0434\u0435\u0440\u0435\u0432\u044c\u044f?<\/h2>\n<p>  \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043e\u0431\u0449\u0438\u0435 \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u041e\u0431\u044b\u0447\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0441 \u0434\u0435\u0440\u0435\u0432\u044c\u044f\u043c\u0438, \u0433\u0434\u0435:<br \/>  1. \u0440\u0430\u0437\u0431\u0438\u0435\u043d\u0438\u0435 \u0432 \u0443\u0437\u043b\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u043e \u043e\u0434\u043d\u043e\u043c\u0443 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0443<br \/>  2. \u0434\u0435\u0440\u0435\u0432\u043e \u0431\u0438\u043d\u0430\u0440\u043d\u043e \u2014 \u0443 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0443\u0437\u043b\u0430 \u0435\u0441\u0442\u044c \u043b\u0435\u0432\u044b\u0439 \u0438 \u043f\u0440\u0430\u0432\u044b\u0439 \u043f\u043e\u0442\u043e\u043c\u043e\u043a<br \/>  3. \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0432\u0435\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0430 \u0440\u0435\u0448\u0430\u044e\u0449\u0435\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0430 \u0441 \u043f\u043e\u0440\u043e\u0433\u043e\u0432\u044b\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c<\/p>\n<p>  \u0414\u0430\u043d\u043d\u0443\u044e \u0438\u043b\u043b\u044e\u0441\u0442\u0440\u0430\u0446\u0438\u044e \u044f \u0432\u0437\u044f\u043b \u0438\u0437 <a href=\"https:\/\/xgboost.readthedocs.io\/en\/latest\/tutorials\/model.html\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 XGBoost<\/a><\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/is\/kk\/wt\/iskkwtpwjobce6ix23itjf0l48i.png\" width=\"400\"><br \/>  \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0434\u0435\u0440\u0435\u0432\u0435 \u0438\u043c\u0435\u0435\u043c 2 \u0443\u0437\u043b\u0430, 2 \u0440\u0435\u0448\u0430\u044e\u0449\u0438\u0445 \u043f\u0440\u0430\u0432\u0438\u043b \u0438 3 \u043b\u0438\u0441\u0442\u0430. \u041f\u043e\u0434 \u043a\u0440\u0443\u0436\u043e\u0447\u043a\u0430\u043c\u0438 \u0443\u043a\u0430\u0437\u0430\u043d\u044b \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u2014 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0434\u0435\u0440\u0435\u0432\u0430 \u043a \u043a\u0430\u043a\u043e\u043c\u0443-\u0442\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0443. \u041e\u0431\u044b\u0447\u043d\u043e, \u043a \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0443 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0434\u0435\u0440\u0435\u0432\u0430 \u0438\u043b\u0438 \u0430\u043d\u0441\u0430\u043c\u0431\u043b\u044f \u0434\u0435\u0440\u0435\u0432\u044c\u0435\u0432 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u044e\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0442\u0440\u0430\u043d\u0441\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <a href=\"https:\/\/ru.wikipedia.org\/wiki\/%D0%A1%D0%B8%D0%B3%D0%BC%D0%BE%D0%B8%D0%B4%D0%B0\">\u0441\u0438\u0433\u043c\u043e\u0438\u0434\u0443<\/a> \u0434\u043b\u044f \u0437\u0430\u0434\u0430\u0447\u0438 \u0431\u0438\u043d\u0430\u0440\u043d\u043e\u0439 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438.<\/p>\n<p>  \u0414\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u0438\u0439 \u043e\u0442 \u0430\u043d\u0441\u0430\u043c\u0431\u043b\u044f \u0434\u0435\u0440\u0435\u0432\u044c\u0435\u0432, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u043e\u043c \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u043d\u043e\u0433\u043e \u0431\u0443\u0441\u0442\u0438\u043d\u0433\u0430, \u043d\u0443\u0436\u043d\u043e \u0441\u043b\u043e\u0436\u0438\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u0438\u0439 \u0432\u0441\u0435\u0445 \u0434\u0435\u0440\u0435\u0432\u044c\u0435\u0432:  <\/p>\n<pre><code class=\"cpp\">double pred = 0.0; for (auto&amp; tree: trees)     pred += tree-&gt;Predict(feature_values); <\/code><\/pre>\n<p>  \u0417\u0434\u0435\u0441\u044c \u0438 \u0434\u0430\u043b\u0435\u0435 \u0431\u0443\u0434\u0435\u0442 \u043a\u043e\u0434 \u043d\u0430 <code>C++<\/code>, \u0442.\u043a. \u0438\u043c\u0435\u043d\u043d\u043e \u043d\u0430 \u044d\u0442\u043e\u043c \u044f\u0437\u044b\u043a\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u044b <code>XGBoost<\/code> \u0438 <code>LightGBM<\/code>. \u042f \u0431\u0443\u0434\u0443 \u043e\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043d\u0435\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u0434\u0435\u0442\u0430\u043b\u0438 \u0438 \u0441\u0442\u0430\u0440\u0430\u0442\u044c\u0441\u044f \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442\u044c \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u043b\u0430\u043a\u043e\u043d\u0438\u0447\u043d\u044b\u0439 \u043a\u043e\u0434.<\/p>\n<p>  \u0414\u0430\u043b\u0435\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u0447\u0442\u043e \u0441\u043a\u0440\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 <code>Predict<\/code>, \u0438 \u043a\u0430\u043a \u0443\u0441\u0442\u0440\u043e\u0435\u043d\u0430 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u0435\u0440\u0435\u0432\u0430.<\/p>\n<h2> \u0414\u0435\u0440\u0435\u0432\u044c\u044f XGBoost <\/h2>\n<p>  \u0412 <code>XGBoost<\/code> \u0435\u0441\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043a\u043b\u0430\u0441\u0441\u043e\u0432 (\u0432 \u0441\u043c\u044b\u0441\u043b\u0435 \u041e\u041e\u041f) \u0434\u0435\u0440\u0435\u0432\u044c\u0435\u0432. \u0411\u0443\u0434\u0435\u043c \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u044c \u043e\u0431 <code>RegTree<\/code> (\u0441\u043c. <code>include\/xgboost\/tree_model.h<\/code>), \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u043e \u0441\u043b\u043e\u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439. \u0415\u0441\u043b\u0438 \u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u0435\u0442\u0430\u043b\u0438, \u0432\u0430\u0436\u043d\u044b\u0435 \u0434\u043b\u044f \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u0438\u0439, \u0442\u043e \u0447\u043b\u0435\u043d\u044b \u043a\u043b\u0430\u0441\u0441\u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u044f\u0442 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e:  <\/p>\n<pre><code class=\"cpp\">class RegTree {   \/\/ vector of nodes   std::vector&lt;Node&gt; nodes_; }; <\/code><\/pre>\n<p>  \u0420\u0435\u0448\u0430\u044e\u0449\u0435\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043e \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>GetNext<\/code>. \u041a\u043e\u0434 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0432\u0438\u0434\u043e\u0438\u0437\u043c\u0435\u043d\u0435\u043d, \u0431\u0435\u0437 \u0432\u043b\u0438\u044f\u043d\u0438\u044f \u043d\u0430 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439:  <\/p>\n<pre><code class=\"cpp\">\/\/ get next position of the tree given current pid int RegTree::GetNext(int pid, float fvalue, bool is_unknown) const {   const auto&amp; node = nodes_[pid]   float split_value = node.info_.split_cond;   if (is_unknown) {     return node.DefaultLeft() ? node.cleft_ : node.cright_;   } else {     if (fvalue &lt; split_value) {       return node.cleft_;     } else {       return node.cright_;     }   } } <\/code><\/pre>\n<p>  \u041e\u0442\u0441\u044e\u0434\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0442 \u0434\u0432\u0435 \u0432\u0435\u0449\u0438:<\/p>\n<ol>\n<li> <code>RegTree<\/code> \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0441 \u0432\u0435\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c\u0438 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0430\u043c\u0438 (\u0442\u0438\u043f <code>float<\/code>) <\/li>\n<li> \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u043f\u0440\u043e\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432 <\/li>\n<\/ol>\n<p>  \u0426\u0435\u043d\u0442\u0440\u0430\u043b\u044c\u043d\u044b\u043c \u043c\u0435\u0441\u0442\u043e\u043c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u043b\u0430\u0441\u0441 <code>Node<\/code>. \u0412 \u043d\u0435\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u0441\u044f \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u0430\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0434\u0435\u0440\u0435\u0432\u0430, \u0440\u0435\u0448\u0430\u044e\u0449\u0435\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043b\u0438\u0441\u0442\u0430:<\/p>\n<pre><code class=\"cpp\">class Node { public:   \/\/ feature index of split condition   unsigned SplitIndex() const {     return sindex_ &amp; ((1U &lt;&lt; 31) - 1U);   }   \/\/ when feature is unknown, whether goes to left child   bool DefaultLeft() const {     return (sindex_ &gt;&gt; 31) != 0;   }   \/\/ whether current node is leaf node   bool IsLeaf() const {     return cleft_ == -1;   } private:   \/\/ in leaf node, we have weights, in non-leaf nodes, we have split condition   union Info {     float leaf_value;     float split_cond;   } info_;   \/\/ pointer to left, right   int cleft_, cright_;   \/\/ split feature index, left split or right split depends on the highest bit   unsigned sindex_{0}; }; <\/code><\/pre>\n<p>  \u041c\u043e\u0436\u043d\u043e \u0432\u044b\u0434\u0435\u043b\u0438\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438:<\/p>\n<ol>\n<li> \u043b\u0438\u0441\u0442\u044b \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b \u043a\u0430\u043a \u0443\u0437\u043b\u044b, \u0443 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 <code>cleft_ = -1<\/code> <\/li>\n<li> \u043f\u043e\u043b\u0435 <code>info_<\/code> \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043e \u043a\u0430\u043a <code>union<\/code>, \u0442.\u0435. \u0434\u0432\u0430 \u0442\u0438\u043f\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 (\u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0435) \u0434\u0435\u043b\u044f\u0442 \u043e\u0434\u0438\u043d \u0443\u0447\u0430\u0441\u0442\u043e\u043a \u043f\u0430\u043c\u044f\u0442\u0438 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0442\u0438\u043f\u0430 \u0443\u0437\u043b\u0430 <\/li>\n<li> \u0441\u0442\u0430\u0440\u0448\u0438\u0439 \u0431\u0438\u0442 \u0432 <code>sindex_<\/code> \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u0442\u043e, \u043a\u0443\u0434\u0430 \u0441\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u043e\u0431\u044a\u0435\u043a\u0442, \u0443 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0430 \u043f\u0440\u043e\u043f\u0443\u0449\u0435\u043d\u043e <\/li>\n<\/ol>\n<p>  \u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043f\u0440\u043e\u0441\u043b\u0435\u0434\u0438\u0442\u044c \u043f\u0443\u0442\u044c \u043e\u0442 \u0432\u044b\u0437\u043e\u0432\u0430 \u043c\u0435\u0442\u043e\u0434\u0430 <code> RegTree::Predict<\/code> \u0434\u043e \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043e\u0442\u0432\u0435\u0442\u0430, \u043f\u0440\u0438\u0432\u0435\u0434\u0443 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u044e\u0449\u0438\u0435 \u0434\u0432\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438:  <\/p>\n<pre><code class=\"cpp\">float RegTree::Predict(const RegTree::FVec&amp; feat, unsigned root_id) const {   int pid = this-&gt;GetLeafIndex(feat, root_id);   return nodes_[pid].leaf_value; }  int RegTree::GetLeafIndex(const RegTree::FVec&amp; feat, unsigned root_id) const {   auto pid = static_cast&lt;int&gt;(root_id);   while (!nodes_[pid].IsLeaf()) {     unsigned split_index = nodes_[pid].SplitIndex();     pid = this-&gt;GetNext(pid, feat.Fvalue(split_index), feat.IsMissing(split_index));   }   return pid; } <\/code><\/pre>\n<p>  \u0412 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>GetLeafIndex<\/code> \u043c\u044b \u0432 \u0446\u0438\u043a\u043b\u0435 \u0441\u043f\u0443\u0441\u043a\u0430\u0435\u043c\u0441\u044f \u043f\u043e \u0443\u0437\u043b\u0430\u043c \u0434\u0435\u0440\u0435\u0432\u0430, \u043f\u043e\u043a\u0430 \u043d\u0435 \u043f\u043e\u043f\u0430\u0434\u0435\u043c \u0432 \u043b\u0438\u0441\u0442.<\/p>\n<h2> \u0414\u0435\u0440\u0435\u0432\u044c\u044f LightGBM <\/h2>\n<p>  \u0412 LightGBM \u043d\u0435\u0442 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043b\u044f \u0443\u0437\u043b\u0430. \u0412\u043c\u0435\u0441\u0442\u043e \u044d\u0442\u043e\u0433\u043e \u0432 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u0435\u0440\u0435\u0432\u0430 <code>Tree<\/code> (\u0444\u0430\u0439\u043b <code>include\/LightGBM\/tree.h<\/code>) \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u0441\u044f \u043c\u0430\u0441\u0441\u0438\u0432\u044b \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439, \u0433\u0434\u0435 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0438\u043d\u0434\u0435\u043a\u0441\u0430 \u0432\u044b\u0441\u0442\u0443\u043f\u0430\u0435\u0442 \u043d\u043e\u043c\u0435\u0440 \u0443\u0437\u043b\u0430. \u0417\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432 \u043b\u0438\u0441\u0442\u044c\u044f\u0445 \u0442\u0430\u043a\u0436\u0435 \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0445 \u043c\u0430\u0441\u0441\u0438\u0432\u0430\u0445.  <\/p>\n<pre><code class=\"cpp\">class Tree {   \/\/ Number of current leaves   int num_leaves_;   \/\/ A non-leaf node's left child   std::vector&lt;int&gt; left_child_;   \/\/ A non-leaf node's right child   std::vector&lt;int&gt; right_child_;   \/\/ A non-leaf node's split feature, the original index   std::vector&lt;int&gt; split_feature_;   \/\/A non-leaf node's split threshold in feature value   std::vector&lt;double&gt; threshold_;   std::vector&lt;int&gt; cat_boundaries_;   std::vector&lt;uint32_t&gt; cat_threshold_;   \/\/ Store the information for categorical feature handle and mising value handle.   std::vector&lt;int8_t&gt; decision_type_;   \/\/ Output of leaves   std::vector&lt;double&gt; leaf_value_; }; <\/code><\/pre>\n<p>  <code>LightGBM<\/code> \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0438. \u041f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0431\u0438\u0442\u043e\u0432\u043e\u0433\u043e \u043f\u043e\u043b\u044f, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0432 <code>cat_threshold_<\/code> \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0443\u0437\u043b\u043e\u0432. \u0412 <code>cat_boundaries_<\/code> \u0445\u0440\u0430\u043d\u0438\u0442, \u043a \u043a\u0430\u043a\u043e\u043c\u0443 \u0443\u0437\u043b\u0443 \u043a\u0430\u043a\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u0431\u0438\u0442\u043e\u0432\u043e\u0433\u043e \u043f\u043e\u043b\u044f \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442. \u041f\u043e\u043b\u0435 <code>threshold_<\/code> \u0434\u043b\u044f \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0441\u043b\u0443\u0447\u0430\u044f \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0432 <code>int<\/code> \u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0432\u0443\u0435\u0442 \u0438\u043d\u0434\u0435\u043a\u0441\u0443 \u0432 <code>cat_boundaries_<\/code> \u0434\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u043d\u0430\u0447\u0430\u043b\u0430 \u0431\u0438\u0442\u043e\u0432\u043e\u0433\u043e \u043f\u043e\u043b\u044f.<\/p>\n<p>  \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0440\u0435\u0448\u0430\u044e\u0449\u0435\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u0434\u043b\u044f \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0430:  <\/p>\n<pre><code class=\"cpp\">int CategoricalDecision(double fval, int node) const {   uint8_t missing_type = GetMissingType(decision_type_[node]);   int int_fval = static_cast&lt;int&gt;(fval);   if (int_fval &lt; 0) {     return right_child_[node];;   } else if (std::isnan(fval)) {     \/\/ NaN is always in the right     if (missing_type == 2) {       return right_child_[node];     }     int_fval = 0;   }   int cat_idx = static_cast&lt;int&gt;(threshold_[node]);   if (FindInBitset(cat_threshold_.data() + cat_boundaries_[cat_idx],                   cat_boundaries_[cat_idx + 1] - cat_boundaries_[cat_idx], int_fval)) {     return left_child_[node];   }   return right_child_[node]; } <\/code><\/pre>\n<p>  \u0412\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 <code>missing_type<\/code> \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <code>NaN<\/code> \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043f\u043e \u043f\u0440\u0430\u0432\u043e\u0439 \u0432\u0435\u0442\u0432\u0438 \u0434\u0435\u0440\u0435\u0432\u0430. \u0418\u043d\u0430\u0447\u0435 <code>NaN<\/code> \u0437\u0430\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043d\u0430 0. \u041f\u043e\u0438\u0441\u043a \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432 \u0431\u0438\u0442\u043e\u0432\u043e\u043c \u043f\u043e\u043b\u0435 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e:  <\/p>\n<pre><code class=\"cpp\">bool FindInBitset(const uint32_t* bits, int n, int pos) {   int i1 = pos \/ 32;   if (i1 &gt;= n) {     return false;   }   int i2 = pos % 32;   return (bits[i1] &gt;&gt; i2) &amp; 1; } <\/code><\/pre>\n<p>  \u0442.\u0435., \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u043b\u044f \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0430 <code>int_fval=42<\/code> \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f, \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u0435\u043d \u043b\u0438 41-\u044b\u0439 (\u043d\u0443\u043c\u0435\u0440\u0430\u0446\u0438\u044f \u0441 0) \u0431\u0438\u0442 \u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0435.<br \/>  \u042d\u0442\u043e\u0442 \u043f\u043e\u0434\u0445\u043e\u0434 \u0438\u043c\u0435\u0435\u0442 \u043e\u0434\u0438\u043d \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u043a: \u0435\u0441\u043b\u0438 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u0440\u0438\u0437\u043d\u0430\u043a \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 100500, \u0442\u043e \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0440\u0435\u0448\u0430\u044e\u0449\u0435\u0433\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0430 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u043e \u0431\u0438\u0442\u043e\u0432\u043e\u0435 \u043f\u043e\u043b\u0435 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u043c \u0434\u043e 12564 \u0431\u0430\u0439\u0442!<\/p>\n<p>  <b>\u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0436\u0435\u043b\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u0435\u0440\u0435\u043d\u0443\u043c\u0435\u0440\u043e\u0432\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\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, \u0447\u0442\u043e\u0431\u044b \u043e\u043d\u0438 \u0448\u043b\u0438 \u043d\u0435\u043f\u0440\u0435\u0440\u044b\u0432\u043d\u043e \u043e\u0442 0 \u0434\u043e \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f<\/b>.<\/p>\n<p>  \u0421\u043e \u0441\u0432\u043e\u0435\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b \u044f \u0432\u043d\u0435\u0441 \u043f\u043e\u044f\u0441\u043d\u044f\u044e\u0449\u0438\u0435 \u043f\u0440\u0430\u0432\u043a\u0438 \u0432 <code>LightGBM<\/code> \u0438 <a href=\"https:\/\/github.com\/Microsoft\/LightGBM\/pull\/1636\">\u0438\u0445 \u043f\u0440\u0438\u043d\u044f\u043b\u0438<\/a>.<\/p>\n<p>  \u0420\u0430\u0431\u043e\u0442\u0430 \u0441 \u0432\u0435\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c\u0438 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0430\u043c\u0438 \u043c\u0430\u043b\u043e \u0447\u0435\u043c \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 <code>XGBoost<\/code>, \u0438 \u044f \u043f\u0440\u043e\u043f\u0443\u0449\u0443 \u044d\u0442\u043e \u0434\u043b\u044f \u043a\u0440\u0430\u0442\u043a\u043e\u0441\u0442\u0438.<\/p>\n<h2> leaves \u2014 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0434\u043b\u044f \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u0438\u0439 \u0432 Go <\/h2>\n<p>  <code>XGBoost<\/code> \u0438 <code>LightGBM<\/code> \u043e\u0447\u0435\u043d\u044c \u043c\u043e\u0449\u043d\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0434\u043b\u044f \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u043d\u043e\u0433\u043e \u0431\u0443\u0441\u0442\u0438\u043d\u0433\u0430 \u043d\u0430 \u0440\u0435\u0448\u0430\u044e\u0449\u0438\u0445 \u0434\u0435\u0440\u0435\u0432\u044c\u044f\u0445. \u0414\u043b\u044f \u0438\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0432 backend \u0441\u0435\u0440\u0432\u0438\u0441\u0435, \u0433\u0434\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0440\u0435\u0448\u0438\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0437\u0430\u0434\u0430\u0447\u0438:<\/p>\n<ol>\n<li> \u041f\u0435\u0440\u0438\u043e\u0434\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0432 \u043e\u0444\u0444\u043b\u0430\u0439\u043d <\/li>\n<li> \u0414\u043e\u0441\u0442\u0430\u0432\u043a\u0430 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0432 backend \u0441\u0435\u0440\u0432\u0438\u0441 <\/li>\n<li> \u041e\u043f\u0440\u043e\u0441 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u043e\u043d\u043b\u0430\u0439\u043d <\/li>\n<\/ol>\n<p>  \u0414\u043b\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043d\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u043e\u0433\u043e backend \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u043c \u044f\u0437\u044b\u043a\u043e\u043c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f <code>Go<\/code>. \u0422\u0430\u0449\u0438\u0442\u044c <code>XGBoost<\/code> \u0438\u043b\u0438 <code>LightGBM<\/code> \u0447\u0435\u0440\u0435\u0437 C API \u0438 cgo \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0435 \u0441\u0430\u043c\u044b\u043c \u043f\u0440\u043e\u0441\u0442\u044b\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u0435\u043c \u2014 \u0443\u0441\u043b\u043e\u0436\u043d\u044f\u0435\u0442\u0441\u044f \u0441\u0431\u043e\u0440\u043a\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b, \u0438\u0437-\u0437\u0430 \u043d\u0435\u043e\u0441\u0442\u043e\u0440\u043e\u0436\u043d\u043e\u0433\u043e \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u043d\u043e \u0441\u043b\u043e\u0432\u0438\u0442\u044c <code>SIGTERM<\/code>, \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0441 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0445 \u043f\u043e\u0442\u043e\u043a\u043e\u0432 (OpenMP \u0432\u043d\u0443\u0442\u0440\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a vs \u043f\u043e\u0442\u043e\u043a\u0438 go runtime).<\/p>\n<p>  \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u0440\u0435\u0448\u0438\u043b \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u043d\u0430 \u0447\u0438\u0441\u0442\u043e\u043c <code>Go<\/code> \u0434\u043b\u044f \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u0438\u0439 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u043e\u0434\u0435\u043b\u0435\u0439, \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0445 \u0432 <code>XGBoost<\/code> \u0438\u043b\u0438 <code>LightGBM<\/code>. \u041e\u043d\u0430 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f <a href=\"https:\/\/github.com\/dmitryikh\/leaves\"><code>leaves<\/code><\/a>.<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/c31\/ac7\/577\/c31ac7577425653a4902dcff8a3b9456.png\" alt=\"leaves\"><br \/>  \u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438:<\/p>\n<ul>\n<li> \u0414\u043b\u044f <code>LightGBM<\/code> \u043c\u043e\u0434\u0435\u043b\u0435\u0439<br \/> \n<ul>\n<li> \u0427\u0442\u0435\u043d\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0438\u0437 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0433\u043e \u0444\u043e\u0440\u043c\u0430\u0442\u0430 (\u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0439) <\/li>\n<li> \u041f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u0432\u0435\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0445 \u0438 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432 <\/li>\n<li> \u041f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u043f\u0440\u043e\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 <\/li>\n<li> \u041e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c\u0438 <\/li>\n<li> \u041e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u0438\u0439 \u0437\u0430 \u0441\u0447\u0435\u0442 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440 \u0434\u0430\u043d\u043d\u044b\u0445, \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u043d\u043d\u044b\u0445 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u0438\u044f <\/li>\n<\/ul>\n<p>   <\/li>\n<li> \u0414\u043b\u044f <code>XGBoost<\/code> \u043c\u043e\u0434\u0435\u043b\u0435\u0439<br \/> \n<ul>\n<li> \u0427\u0442\u0435\u043d\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0438\u0437 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0433\u043e \u0444\u043e\u0440\u043c\u0430\u0442\u0430 (\u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0439) <\/li>\n<li> \u041f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u043f\u0440\u043e\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 <\/li>\n<li> \u041e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u0438\u0439 <\/li>\n<\/ul>\n<p>   <\/li>\n<\/ul>\n<p>  \u041f\u0440\u0438\u0432\u0435\u0434\u0443 \u0437\u0434\u0435\u0441\u044c \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u0443\u044e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u043d\u0430 <code>Go<\/code>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442 \u043c\u043e\u0434\u0435\u043b\u044c \u0441 \u0434\u0438\u0441\u043a\u0430 \u0438 \u0432\u044b\u0432\u043e\u0434\u0438\u0442 \u043d\u0430 \u044d\u043a\u0440\u0430\u043d \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u0438\u0435:  <\/p>\n<pre><code class=\"cpp\">package main  import ( \t\"bufio\" \t\"fmt\" \t\"os\" \t\"github.com\/dmitryikh\/leaves\" )  func main() { \t\/\/ 1. \u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u0444\u0430\u0439\u043b \u0441 \u043c\u043e\u0434\u0435\u043b\u044c\u044e \tpath := \"lightgbm_model.txt\" \treader, err := os.Open(path) \tif err != nil { \t\tpanic(err) \t} \tdefer reader.Close()  \t\/\/ 2. \u0427\u0438\u0442\u0430\u0435\u043c \u043c\u043e\u0434\u0435\u043b\u044c LightGBM \tmodel, err := leaves.LGEnsembleFromReader(bufio.NewReader(reader)) \tif err != nil { \t\tpanic(err) \t}  \t\/\/ 3. \u0414\u0435\u043b\u0430\u0435\u043c \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u0438\u0435! \tfvals := []float64{1.0, 2.0, 3.0} \tp := model.Predict(fvals, 0) \tfmt.Printf(\"Prediction for %v: %f\\n\", fvals, p) } <\/code><\/pre>\n<p>  API \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u0438\u0441\u0442\u0438\u0447\u0435\u043d. \u0414\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043c\u043e\u0434\u0435\u043b\u0438 <code>XGBoost<\/code> \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434 <code>leaves.XGEnsembleFromReader<\/code>, \u0432\u043c\u0435\u0441\u0442\u043e \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u043e\u0433\u043e \u0432\u044b\u0448\u0435. \u041f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u0438\u044f \u043c\u043e\u0436\u043d\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0430\u0447\u043a\u0430\u043c\u0438, \u0432\u044b\u0437\u044b\u0432\u0430\u044f \u043c\u0435\u0442\u043e\u0434\u044b <code>PredictDense<\/code> \u0438\u043b\u0438 <code> model.PredictCSR<\/code>. \u0411\u043e\u043b\u044c\u0448\u0435 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0435\u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0432 <a href=\"https:\/\/github.com\/dmitryikh\/leaves\/blob\/master\/leaves_test.go\">\u0442\u0435\u0441\u0442\u0430\u0445 \u043a leaves<\/a>.<\/p>\n<p>  \u041d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u044f\u0437\u044b\u043a <code>Go<\/code> \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u0435\u0439 <code>C++<\/code> (\u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u0438\u0437-\u0437\u0430 \u0431\u043e\u043b\u0435\u0435 \u0442\u044f\u0436\u0435\u043b\u043e\u0433\u043e runtime \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043e\u043a \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f), \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0440\u044f\u0434\u0443 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0439 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0434\u043e\u0441\u0442\u0438\u0447\u044c \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u0438\u0439, \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u0438\u043c\u043e\u0439 \u0441 \u0432\u044b\u0437\u043e\u0432\u043e\u043c C API \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a.<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/xl\/rw\/bi\/xlrwbiikgtfpor6luj5_n0gm4c8.png\" width=\"600\"><\/p>\n<p>  \u0411\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430\u0445 \u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u0435 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0439 \u0435\u0441\u0442\u044c \u0432 <a href=\"https:\/\/github.com\/dmitryikh\/leaves\">\u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438 \u043d\u0430 github<\/a>.<\/p>\n<h2>\u0417\u0440\u0438 \u0432 \u043a\u043e\u0440\u0435\u043d\u044c<\/h2>\n<p>  \u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435\u0439 \u044f \u043f\u0440\u0438\u043e\u0442\u043a\u0440\u044b\u043b \u0434\u0432\u0435\u0440\u0446\u0443 \u0432 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u0435\u0440\u0435\u0432\u044c\u0435\u0432 \u0432 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430\u0445 <code>XGBoost<\/code> \u0438 <code>LightGBM<\/code>. \u041a\u0430\u043a \u0432\u0438\u0434\u0438\u0442\u0435, \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u044b, \u0438 \u044f \u043f\u0440\u0438\u0437\u044b\u0432\u0430\u044e \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u0435\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u043c open source \u2014 \u0438\u0437\u0443\u0447\u0430\u0442\u044c \u043a\u043e\u0434, \u043a\u043e\u0433\u0434\u0430 \u0435\u0441\u0442\u044c \u0432\u043e\u043f\u0440\u043e\u0441\u044b \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u043e\u043d \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442.<\/p>\n<p>  \u0414\u043b\u044f \u0442\u0435\u0445 \u0436\u0435, \u043a\u043e\u043c\u0443 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0430 \u0442\u0435\u043c\u0430 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u043d\u043e\u0433\u043e \u0431\u0443\u0441\u0442\u0438\u043d\u0433\u0430 \u0432 \u0438\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u0445 \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 Go, \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439 <a href=\"https:\/\/github.com\/dmitryikh\/leaves\">leaves<\/a>. \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>leaves<\/code> \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c leading edge \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0432 \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u043c \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0438 \u0432 \u0432\u0430\u0448\u0435\u0439 production \u0441\u0440\u0435\u0434\u0435, \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0435 \u043f\u0440\u043e\u0438\u0433\u0440\u044b\u0432\u0430\u044f \u043f\u043e \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0432 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0438 \u0441 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f\u043c \u043d\u0430 C++.<\/p>\n<p>  \u0423\u0441\u043f\u0435\u0445\u043e\u0432!<\/p><\/div>\n<p>        <script class=\"js-mediator-script\">!function(e){function t(t,n){if(!(n in e)){for(var r,a=e.document,i=a.scripts,o=i.length;o--;)if(-1!==i[o].src.indexOf(t)){r=i[o];break}if(!r){r=a.createElement(\"script\"),r.type=\"text\/javascript\",r.async=!0,r.defer=!0,r.src=t,r.charset=\"UTF-8\";var d=function(){var e=a.getElementsByTagName(\"script\")[0];e.parentNode.insertBefore(r,e)};\"[object Opera]\"==e.opera?a.addEventListener?a.addEventListener(\"DOMContentLoaded\",d,!1):e.attachEvent(\"onload\",d):d()}}}t(\"\/\/mediator.mail.ru\/script\/2820404\/\",\"_mediator\")}(window);<\/script>     <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\/post\/423495\/\"> https:\/\/habr.com\/post\/423495\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\">\u0412 \u043c\u0438\u0440\u0435 \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u043e\u0434\u043d\u0438\u043c\u0438 \u0438\u0437 \u0441\u0430\u043c\u044b\u0445 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u0442\u0438\u043f\u043e\u0432 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0440\u0435\u0448\u0430\u044e\u0449\u0435\u0435 \u0434\u0435\u0440\u0435\u0432\u043e \u0438 \u0430\u043d\u0441\u0430\u043c\u0431\u043b\u0438 \u043d\u0430 \u0438\u0445 \u043e\u0441\u043d\u043e\u0432\u0435. \u041f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430\u043c\u0438 \u0434\u0435\u0440\u0435\u0432\u044c\u0435\u0432 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f: \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u0430 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0446\u0438\u0438, \u043d\u0435\u0442 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0439 \u043d\u0430 \u0432\u0438\u0434 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0439 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438, \u043c\u044f\u0433\u043a\u0438\u0435 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f \u043a \u0440\u0430\u0437\u043c\u0435\u0440\u0443 \u0432\u044b\u0431\u043e\u0440\u043a\u0443. \u0414\u0435\u0440\u0435\u0432\u044c\u044f \u0438\u043c\u0435\u044e\u0442 \u0438 \u043a\u0440\u0443\u043f\u043d\u044b\u0439 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u043a \u2014 \u0441\u043a\u043b\u043e\u043d\u043d\u043e\u0441\u0442\u044c \u043a \u043f\u0435\u0440\u0435\u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044e. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u043e\u0447\u0442\u0438 \u0432\u0441\u0435\u0433\u0434\u0430 \u0434\u0435\u0440\u0435\u0432\u044c\u044f \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u044e\u0442 \u0432 \u0430\u043d\u0441\u0430\u043c\u0431\u043b\u0438: \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0439 \u043b\u0435\u0441, \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u043d\u044b\u0439 \u0431\u0443\u0441\u0442\u0438\u043d\u0433 \u0438 \u0434\u0440. \u0421\u043b\u043e\u0436\u043d\u043e\u0439 \u0442\u0435\u043e\u0440\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0438 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0435\u0439 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0434\u0435\u0440\u0435\u0432\u044c\u0435\u0432 \u0438 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0438\u0445 \u0432 \u0430\u043d\u0441\u0430\u043c\u0431\u043b\u0438. \u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0436\u0435 \u0441\u0442\u0430\u0442\u044c\u0435 \u0431\u0443\u0434\u0443\u0442 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u044b \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0430 \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u0438\u0439 \u043f\u043e \u0443\u0436\u0435 \u043e\u0431\u0443\u0447\u0435\u043d\u043d\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \u0430\u043d\u0441\u0430\u043c\u0431\u043b\u044f \u0434\u0435\u0440\u0435\u0432\u044c\u0435\u0432, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0439 \u0432 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430\u0445 \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u043d\u043e\u0433\u043e \u0431\u0443\u0441\u0442\u0438\u043d\u0433\u0430 <a href=\"https:\/\/github.com\/dmlc\/xgboost\"><code>XGBoost<\/code><\/a> \u0438 <a href=\"https:\/\/github.com\/Microsoft\/LightGBM\"><code>LightGBM<\/code><\/a>. \u0410 \u0442\u0430\u043a \u0436\u0435 \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044c \u043f\u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u0441\u044f \u0441 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439 <a href=\"https:\/\/github.com\/dmitryikh\/leaves\"><code>leaves<\/code><\/a> \u0434\u043b\u044f Go, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u0438\u044f \u0434\u043b\u044f \u0430\u043d\u0441\u0430\u043c\u0431\u043b\u0435\u0439 \u0434\u0435\u0440\u0435\u0432\u044c\u0435\u0432, \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043f\u0440\u0438 \u044d\u0442\u043e\u043c C API \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-289525","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/289525","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=289525"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/289525\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=289525"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=289525"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=289525"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}