{"id":323698,"date":"2021-05-25T09:00:19","date_gmt":"2021-05-25T09:00:19","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=323698"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=323698","title":{"rendered":"\u0414\u0430\u0442\u0430\u0441\u0435\u0442 \u043e \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u0445"},"content":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<h2>\u0412\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0435<\/h2>\n<p>\u041c\u043e\u044f \u043e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0440\u0430\u0431\u043e\u0442\u0430 \u0441\u0432\u044f\u0437\u0430\u043d\u0430 \u0441 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u043e\u0439 \u0440\u0435\u043a\u043b\u0430\u043c\u043e\u0439, \u0438 \u0432\u0440\u0435\u043c\u044f \u043e\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043c\u043d\u0435 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u043e \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u0445. \u042f \u0440\u0435\u0448\u0438\u043b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043e\u0431\u0449\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u043c\u0438 \u0434\u043b\u044f \u0442\u0435\u0445, \u043a\u0442\u043e \u0445\u043e\u0447\u0435\u0442 \u043f\u043e\u043f\u0440\u0430\u043a\u0442\u0438\u043a\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0438 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0438\u043b\u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043e \u0434\u0430\u043d\u043d\u044b\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0438\u0437 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0445 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u0432. \u042f \u0441\u0447\u0438\u0442\u0430\u044e, \u0447\u0442\u043e \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0435 \u043d\u0430\u0431\u043e\u0440\u044b \u0434\u0430\u043d\u043d\u044b\u0445  \u0432\u0441\u0435\u0433\u0434\u0430 \u043f\u043e\u043b\u0435\u0437\u043d\u044b \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u0443. \u0421\u0431\u043e\u0440 \u0434\u0430\u043d\u043d\u044b\u0445 \u0447\u0430\u0441\u0442\u043e \u0431\u044b\u0432\u0430\u0435\u0442 \u0441\u043b\u043e\u0436\u043d\u043e\u0439 \u0438 \u0443\u043d\u044b\u043b\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u043e\u0439, \u0438 \u043d\u0435 \u0443 \u0432\u0441\u0435\u0445 \u0435\u0441\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044e \u0434\u0430\u0442\u0430\u0441\u0435\u0442 \u0438, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0435\u0433\u043e, \u043f\u043e\u0441\u0442\u0440\u043e\u044e \u043e\u0434\u043d\u0443 \u043c\u043e\u0434\u0435\u043b\u044c.<\/p>\n<h2>\u0414\u0430\u043d\u043d\u044b\u0435<\/h2>\n<p>\u0414\u0430\u0442\u0430\u0441\u0435\u0442 \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043d \u043d\u0430 \u0441\u0430\u0439\u0442\u0435 <a href=\"https:\/\/medium.com\/r\/?url=https%3A%2F%2Fwww.kaggle.com%2Fsagol79%2Fstemmed-description-tokens-and-application-genres\" rel=\"noopener noreferrer nofollow\">Kaggle<\/a>.<\/p>\n<p><code>DOI: 10.34740\/KAGGLE\/DSV\/2107675.<\/code><\/p>\n<p>\u0414\u043b\u044f 293392 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 (\u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0445) \u0441\u043e\u0431\u0440\u0430\u043d\u044b \u0442\u043e\u043a\u0435\u043d\u044b \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0439 \u0438 \u0441\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439, \u0432\u043a\u043b\u044e\u0447\u0430\u044f \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435. \u0412 \u043d\u0430\u0431\u043e\u0440\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0435\u0442 \u0438\u043c\u0435\u043d \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439; \u0438\u0445 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u0446\u0438\u0440\u0443\u044e\u0442 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0435 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u044b. \u041f\u0435\u0440\u0435\u0434 \u0442\u043e\u043a\u0435\u043d\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0439 \u0431\u044b\u043b\u0438 \u043f\u0435\u0440\u0435\u0432\u0435\u0434\u0435\u043d\u044b \u043d\u0430 \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u0438\u0439 \u044f\u0437\u044b\u043a.<\/p>\n<p>\u0412 \u0434\u0430\u0442\u0430\u0441\u0435\u0442\u0435 4 \u0444\u0430\u0439\u043b\u0430:<\/p>\n<ul>\n<li>\n<p><strong>bundles_desc.csv\u200a\u2014<\/strong>\u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f;<\/p>\n<\/li>\n<li>\n<p><strong>bundles_desc_tokens.csv\u200a\u2014\u200a<\/strong>\u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0442\u043e\u043a\u0435\u043d\u044b \u0438 \u0436\u0430\u043d\u0440\u044b;<\/p>\n<\/li>\n<li>\n<p><strong>bundles_prop.csv, bundles_summary.csv\u200a<\/strong>\u2014\u200a\u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442 \u0440\u043f\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0441\u0442\u0438\u043a\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0438 \u0434\u0430\u0442\u044b \u0440\u0435\u043b\u0438\u0437\u0430\/\u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f.<\/p>\n<\/li>\n<\/ul>\n<h2>EDA<\/h2>\n<p>\u041f\u0440\u0435\u0436\u0434\u0435 \u0432\u0441\u0435\u0433\u043e, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u0434\u0430\u043d\u043d\u044b\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0442\u0441\u044f \u043f\u043e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u043c \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u043c.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d00\/680\/dfa\/d00680dfa431eb9ca2ee860ca61ded8c.png\" width=\"859\" height=\"525\"><figcaption><\/figcaption><\/figure>\n<p>\u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0434\u043b\u044f Android \u0434\u043e\u043c\u0438\u043d\u0438\u0440\u0443\u044e\u0442 \u0432 \u0434\u0430\u043d\u043d\u044b\u0445. \u0421\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u044d\u0442\u043e \u0441\u0432\u044f\u0437\u0430\u043d\u043e \u0441 \u0442\u0435\u043c, \u0447\u0442\u043e \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0434\u043b\u044f Android. <\/p>\n<p>\u0423\u0447\u0438\u0442\u044b\u0432\u0430\u044f, \u0447\u0442\u043e \u043d\u0430\u0431\u043e\u0440 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0430\u043c\u044b\u0435 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c, \u043a\u0430\u043a \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u0434\u0430\u0442\u0430 \u0432\u044b\u043f\u0443\u0441\u043a\u0430.<\/p>\n<p><code>histnorm ='probability' # type of normalization<\/code><\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f8f\/277\/9bc\/f8f2779bcb62eaeabd61a03c9b938c4f.png\" width=\"859\" height=\"525\"><figcaption><\/figcaption><\/figure>\n<p>\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0433\u0440\u0430\u0444\u0438\u043a \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u0447\u0442\u043e \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u043e.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/981\/26c\/80e\/98126c80e201ac467595dafdb1a0d041.png\" width=\"859\" height=\"525\"><figcaption><\/figcaption><\/figure>\n<p>\u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0431\u044b\u043b\u0438 \u0441\u043e\u0431\u0440\u0430\u043d\u044b \u0437\u0430 \u043a\u043e\u0440\u043e\u0442\u043a\u0438\u0439 \u043f\u0435\u0440\u0438\u043e\u0434 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0432 \u044f\u043d\u0432\u0430\u0440\u0435 2021 \u0433\u043e\u0434\u0430.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/56a\/c2a\/9d7\/56ac2a9d7967fea19bc496321e9405da.png\" width=\"859\" height=\"525\"><figcaption><\/figcaption><\/figure>\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u043c \u043d\u043e\u0432\u0443\u044e \u0444\u0438\u0447\u0443 &#8212; \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043c\u0435\u0441\u044f\u0446\u0435\u0432 \u043c\u0435\u0436\u0434\u0443 \u0434\u0430\u0442\u043e\u0439 \u0432\u044b\u043f\u0443\u0441\u043a\u0430 \u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u043c \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435\u043c.<\/p>\n<pre><code class=\"python\">df['bundle_update_period'] = \\     (pd.to_datetime(         df['bundle_updated_at'], utc=True).dt.tz_convert(None).dt.to_period('M').astype('int') -       df['bundle_released_at'].dt.to_period('M').astype('int'))\u0443<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/861\/d88\/fe9\/861d88fe967ba76024ae262135c559da.png\" width=\"859\" height=\"525\"><figcaption><\/figcaption><\/figure>\n<p>\u0418\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c, \u043a\u0430\u043a \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u044b \u0436\u0430\u043d\u0440\u044b \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439. \u041f\u0440\u0438\u043d\u0438\u043c\u0430\u044f \u0432\u043e \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0434\u0438\u0441\u0431\u0430\u043b\u0430\u043d\u0441 \u041e\u0421, \u044f \u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u0443\u044e \u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u0433\u0438\u0441\u0442\u043e\u0433\u0440\u0430\u043c\u043c\u044b.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f02\/a3b\/085\/f02a3b085e87e5918c05be4a2be50cac.png\" width=\"859\" height=\"1200\"><figcaption><\/figcaption><\/figure>\n<p>\u041c\u044b \u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e \u0436\u0430\u043d\u0440\u044b \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043d\u0435 \u043f\u0435\u0440\u0435\u0441\u0435\u043a\u0430\u044e\u0442\u0441\u044f. \u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u044d\u0442\u043e \u0437\u0430\u043c\u0435\u0442\u043d\u043e \u0432 \u0438\u0433\u0440\u0430\u0445. \u0414\u043b\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0442\u0430\u043a\u0430\u044f \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f \u043a\u0440\u0430\u0439\u043d\u0435 \u043d\u0435\u043f\u0440\u0438\u044f\u0442\u043d\u0430. \u0427\u0442\u043e \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441 \u044d\u0442\u0438\u043c \u043f\u043e\u0434\u0435\u043b\u0430\u0442\u044c? \u0421\u0430\u043c\u043e\u0435 \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e\u0435 &#8212; \u0443\u043c\u0435\u043d\u044c\u0448\u0438\u0442\u044c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0436\u0430\u043d\u0440\u043e\u0432 \u0434\u043b\u044f Android \u0438 \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u0438\u0445 \u043a \u0442\u043e\u043c\u0443 \u0436\u0435 \u0432\u0438\u0434\u0443, \u0447\u0442\u043e \u0438 \u0434\u043b\u044f iOS \u043f\u0443\u0442\u0435\u043c \u0441\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0432\u0441\u0435\u0445 \u0438\u0433\u0440\u043e\u0432\u044b\u0445 \u0436\u0430\u043d\u0440\u043e\u0432 \u043a \u043e\u0434\u043d\u043e\u043c\u0443 <em>Games<\/em>. \u041d\u043e \u044f \u043f\u043e\u043b\u0430\u0433\u0430\u044e, \u0447\u0442\u043e \u044d\u0442\u043e \u043d\u0435 \u043b\u0443\u0447\u0448\u0438\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442, \u0442\u0430\u043a \u043a\u0430\u043a \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0442\u0435\u0440\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438. \u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0440\u0435\u0448\u0438\u0442\u044c \u043e\u0431\u0440\u0430\u0442\u043d\u0443\u044e \u0437\u0430\u0434\u0430\u0447\u0443. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u044c, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0436\u0430\u043d\u0440\u044b \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u043f\u043e \u0438\u0445 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044e.<\/p>\n<h2>\u041c\u043e\u0434\u0435\u043b\u044c<\/h2>\n<p>\u042f \u0441\u043e\u0437\u0434\u0430\u043b \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0444\u0438\u0447\u0435\u0439, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0434\u043b\u0438\u043d\u0443 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0438 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0442\u043e\u043a\u0435\u043d\u043e\u0432.<\/p>\n<pre><code class=\"python\">def get_lengths(df, columns=['tokens', 'description']):     lengths_df = pd.DataFrame()     for i, c in enumerate(columns):         lengths_df[f\"{c}_len\"] = df[c].apply(len)         if i &gt; 0:             lengths_df[f\"{c}_div\"] = \\                 lengths_df.iloc[:, i-1] \/ lengths_df.iloc[:, i]             lengths_df[f\"{c}_diff\"] = \\                 lengths_df.iloc[:, i-1] - lengths_df.iloc[:, i]     return lengths_df df = pd.concat([df, get_lengths(df)], axis=1, sort=False, copy=False)<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/746\/bb3\/713\/746bb37139fcd5ed4f8d92c7dbf4fc77.png\" width=\"859\" height=\"525\"><figcaption><\/figcaption><\/figure>\n<p>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0435\u0449\u0435 \u043e\u0434\u043d\u043e\u0439 \u0444\u0438\u0447\u0438 \u044f \u0432\u0437\u044f\u043b \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043c\u0435\u0441\u044f\u0446\u0435\u0432, \u043f\u0440\u043e\u0448\u0435\u0434\u0448\u0438\u0445 \u0441 \u0434\u0430\u0442\u044b \u0432\u044b\u043f\u0443\u0441\u043a\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0418\u0434\u0435\u044f \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043d\u0430 \u0440\u044b\u043d\u043a\u0435 \u0432 \u0440\u0430\u0437\u043d\u044b\u0435 \u043f\u0435\u0440\u0438\u043e\u0434\u044b \u043c\u043e\u0433\u043b\u043e \u0431\u044b\u0442\u044c \u043a\u0430\u043a\u043e\u0435-\u0442\u043e \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0442\u0435\u043d\u0438\u0435 \u0438\u0433\u0440\u043e\u0432\u044b\u043c \u0436\u0430\u043d\u0440\u0430\u043c.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/cc3\/cce\/9e4\/cc3cce9e45ce96e166a998df36b18659.png\" width=\"859\" height=\"525\"><figcaption><\/figcaption><\/figure>\n<p>\u0414\u043b\u044f \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0434\u0430\u043d\u043d\u044b\u0435 Android-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439.<\/p>\n<pre><code class=\"python\">android_df = df[df['store_os']=='android'] ios_df = df[df['store_os']=='ios']<\/code><\/pre>\n<p>\u041e\u043a\u043e\u043d\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u0444\u0438\u0447\u0435\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"python\">columns = [     'genre', 'tokens', 'bundle_update_period', 'tokens_len',     'description_len', 'description_div', 'description_diff',     'description', 'rating', 'reviews', 'score',     'released_at_month' ]<\/code><\/pre>\n<p>\u042f \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u043b \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 \u0434\u0432\u0435 \u0447\u0430\u0441\u0442\u0438 &#8212; <em>train<\/em> \u0438 <em>validation<\/em>. \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0441\u0442\u0440\u0430\u0442\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u043e.<\/p>\n<pre><code class=\"python\">train_df, test_df = train_test_split(     android_df[columns], train_size=0.7, random_state=0, stratify=android_df['genre']) y_train, X_train = train_df['genre'], train_df.drop(['genre'], axis=1) y_test, X_test = test_df['genre'], test_df.drop(['genre'], axis=1)<\/code><\/pre>\n<p>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0434\u043b\u044f \u043c\u043e\u0434\u0435\u043b\u0438 \u044f \u0432\u044b\u0431\u0440\u0430\u043b <a href=\"https:\/\/catboost.ai\/\" rel=\"noopener noreferrer nofollow\">CatBoost<\/a>. CatBoost &#8212; \u044d\u0442\u043e \u0432\u044b\u0441\u043e\u043a\u043e\u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0434\u043b\u044f \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u043d\u043e\u0433\u043e \u0431\u0443\u0441\u0442\u0438\u043d\u0433\u0430 \u043d\u0430 \u0434\u0435\u0440\u0435\u0432\u044c\u044f\u0445 \u0440\u0435\u0448\u0435\u043d\u0438\u0439 \u0441 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c. \u041e\u0441\u043d\u043e\u0432\u043d\u044b\u043c \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u043c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0442\u043e, \u0447\u0442\u043e CatBoost \u043c\u043e\u0436\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u0438 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0435 \u0444\u0438\u0447\u0438 \u0431\u0435\u0437 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438. \u0422\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0435 \u0444\u0438\u0447\u0438 \u0434\u043b\u044f \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 \u0432\u0435\u0440\u0441\u0438\u0438 0.19.1<\/p>\n<p>\u0412 <a href=\"https:\/\/habr.com\/ru\/post\/555064\/\" rel=\"noopener noreferrer nofollow\">\u041d\u0435\u0442\u0440\u0430\u0434\u0438\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0430\u043d\u0430\u043b\u0438\u0437 \u0442\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0442\u0435\u043a\u0441\u0442\u0430: BERT vs&nbsp;CatBoost<\/a> \u044f \u043f\u0440\u0438\u0432\u043e\u0436\u0443 \u043f\u0440\u0438\u043c\u0435\u0440 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a CatBoost \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 \u0442\u0435\u043a\u0441\u0442\u043e\u043c \u0438 \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u044e \u0435\u0433\u043e \u0441 BERT. <\/p>\n<pre><code class=\"python\">!pip install -U catboost<\/code><\/pre>\n<p>\u041f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 CatBoost \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Pool. \u042d\u0442\u043e \u0443\u0434\u043e\u0431\u043d\u0430\u044f \u043e\u0431\u043e\u043b\u043e\u0447\u043a\u0430, \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u044e\u0449\u0430\u044f \u043c\u0435\u0442\u043a\u0438 \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0435, \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u0438 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0435 \u0444\u0438\u0447\u0438. \u0411\u043e\u043d\u0443\u0441\u043e\u043c \u0438\u0434\u0435\u0442 \u0441\u043d\u0438\u0436\u0435\u043d\u0438\u0435 \u0437\u0430\u0442\u0440\u0430\u0442 \u043f\u0430\u043c\u044f\u0442\u0438, \u0442\u0430\u043a \u043a\u0430\u043a \u043d\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0430\u0446\u0438\u044f \u0432\u043d\u0443\u0442\u0440\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438.<\/p>\n<pre><code class=\"python\">train_pool = Pool(     data=X_train,      label=y_train,     text_features=['tokens', 'description'] ) test_pool = Pool(     data=X_test,      label=y_test,      text_features=['tokens', 'description'] )<\/code><\/pre>\n<p>\u041d\u0430\u043f\u0438\u0448\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0434\u043b\u044f \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0438 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u043c\u043e\u0434\u0435\u043b\u0438. \u042f \u043d\u0435 \u043f\u043e\u0434\u0431\u0438\u0440\u0430\u043b \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b; \u043f\u0443\u0441\u0442\u044c \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0435\u0449\u0435 \u043e\u0434\u043d\u0438\u043c \u0434\u043e\u043c\u0430\u0448\u043d\u0438\u043c \u0437\u0430\u0434\u0430\u043d\u0438\u0435\u043c.<\/p>\n<pre><code class=\"python\">def fit_model(train_pool, test_pool, **kwargs):     model = CatBoostClassifier(         random_seed=0,         task_type='GPU',         iterations=10000,         learning_rate=0.1,         eval_metric='Accuracy',         od_type='Iter',         od_wait=500,         **kwargs     ) return model.fit(         train_pool,         eval_set=test_pool,         verbose=1000,         plot=True,         use_best_model=True     )<\/code><\/pre>\n<p>\u0422\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0435 \u0444\u0438\u0447\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043d\u043e\u0432\u044b\u0445 \u0447\u0438\u0441\u043b\u043e\u0432\u044b\u0445 \u0444\u0438\u0447\u0435\u0439. \u041d\u043e \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u0431\u044a\u044f\u0441\u043d\u0438\u0442\u044c CatBoost, \u0447\u0442\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u043e\u0442 \u043d\u0435\u0433\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c.<\/p>\n<p><strong>CatBoostClassifier<\/strong> \u0438\u043c\u0435\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432:<\/p>\n<ul>\n<li>\n<p><em>tokenizers\u200a\u2014\u200a<\/em>\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0435 \u0434\u043b\u044f \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0444\u0438\u0447\u0435\u0439 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u0442\u0438\u043f\u0430 \u043f\u0435\u0440\u0435\u0434 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435\u043c \u0441\u043b\u043e\u0432\u0430\u0440\u044f;<\/p>\n<\/li>\n<li>\n<p><em>dictionaries\u200a\u2014\u200a<\/em>\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0444\u0438\u0447\u0435\u0439 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u0442\u0438\u043f\u0430;<\/p>\n<\/li>\n<li>\n<p><em>feature_calcers\u200a\u2014<\/em>\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0440\u0430\u0441\u0447\u0435\u0442\u0430 \u043d\u043e\u0432\u044b\u0445 \u0444\u0438\u0447\u0435\u0439;<\/p>\n<\/li>\n<li>\n<p><em>text_processing\u200a\u2014\u200a<\/em>\u043e\u0431\u0449\u0438\u0439 JSON-\u043a\u043e\u043d\u0444\u0438\u0433 \u0434\u043b\u044f \u0442\u043e\u043a\u0435\u043d\u0438\u0437\u0430\u0442\u043e\u0440\u043e\u0432, \u0441\u043b\u043e\u0432\u0430\u0440\u0435\u0439 \u0438 \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442, \u043a\u0430\u043a \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0435 \u0444\u0438\u0447\u0438 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u044e\u0442\u0441\u044f \u0432 \u0444\u0438\u0447\u0438 \u0441 \u043f\u043b\u0430\u0432\u0430\u044e\u0449\u0435\u0439 \u0442\u043e\u0447\u043a\u043e\u0439.<\/p>\n<\/li>\n<\/ul>\n<p>\u0427\u0435\u0442\u0432\u0435\u0440\u0442\u044b\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u0437\u0430\u043c\u0435\u043d\u044f\u0435\u0442 \u043f\u0435\u0440\u0432\u044b\u0435 \u0442\u0440\u0438 \u0438, \u043d\u0430 \u043c\u043e\u0439 \u0432\u0437\u0433\u043b\u044f\u0434, \u0441\u0430\u043c\u044b\u0439 \u0443\u0434\u043e\u0431\u043d\u044b\u0439, \u0442\u0430\u043a \u043a\u0430\u043a \u0432 \u043e\u0434\u043d\u043e\u043c \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f, \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u0442\u0435\u043a\u0441\u0442\u043e\u043c.<\/p>\n<pre><code class=\"python\">tpo = {     'tokenizers': [         {             'tokenizer_id': 'Sense',             'separator_type': 'BySense',         }     ],     'dictionaries': [         {             'dictionary_id': 'Word',             'token_level_type': 'Word',             'occurrence_lower_bound': '10'         },         {             'dictionary_id': 'Bigram',             'token_level_type': 'Word',             'gram_order': '2',             'occurrence_lower_bound': '10'         },         {             'dictionary_id': 'Trigram',             'token_level_type': 'Word',             'gram_order': '3',             'occurrence_lower_bound': '10'         },     ],     'feature_processing': {         '0': [             {                 'tokenizers_names': ['Sense'],                 'dictionaries_names': ['Word'],                 'feature_calcers': ['BoW']             },             {                 'tokenizers_names': ['Sense'],                 'dictionaries_names': ['Bigram', 'Trigram'],                 'feature_calcers': ['BoW']             },         ],         '1': [             {                 'tokenizers_names': ['Sense'],                 'dictionaries_names': ['Word'],                 'feature_calcers': ['BoW', 'BM25']             },             {                 'tokenizers_names': ['Sense'],                 'dictionaries_names': ['Bigram', 'Trigram'],                 'feature_calcers': ['BoW']             },         ]     } }<\/code><\/pre>\n<p>\u0417\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435:<\/p>\n<pre><code class=\"python\">model_catboost = fit_model(     train_pool, test_pool,     text_processing = tpo )<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/e88\/f6a\/326\/e88f6a326130718a3fdf1ab7962b0f77.png\" alt=\"Accuracy\" title=\"Accuracy\" width=\"700\" height=\"450\"><figcaption>Accuracy<\/figcaption><\/figure>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/474\/337\/ecb\/474337ecbe8d24967f643706be82d6a6.png\" alt=\"Loss\" title=\"Loss\" width=\"700\" height=\"450\"><figcaption>Loss<\/figcaption><\/figure>\n<pre><code class=\"python\">bestTest = 0.6454657601<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/7f7\/d1f\/4d3\/7f7d1f4d36f8a09bcf929a1a594ad69d.png\" width=\"704\" height=\"575\"><figcaption><\/figcaption><\/figure>\n<p>\u0422\u043e\u043b\u044c\u043a\u043e \u0434\u0432\u0435 \u0444\u0438\u0447\u0438 \u0438\u043c\u0435\u044e\u0442 \u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u0432\u043b\u0438\u044f\u043d\u0438\u0435 \u043d\u0430 \u043c\u043e\u0434\u0435\u043b\u044c. \u0421\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0432\u044b\u0441\u0438\u0442\u044c \u0437\u0430 \u0441\u0447\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f <em>summary<\/em>, \u043d\u043e, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443  \u044d\u0442\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0435\u0442 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u0445 iOS, \u0431\u044b\u0441\u0442\u0440\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u043d\u0435 \u0443\u0434\u0430\u0441\u0442\u0441\u044f. \u041c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u044c, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043a\u043e\u0440\u043e\u0442\u043a\u0438\u0439 \u0430\u0431\u0437\u0430\u0446 \u0442\u0435\u043a\u0441\u0442\u0430 \u0438\u0437 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f. \u042f \u043e\u0441\u0442\u0430\u0432\u043b\u044e \u044d\u0442\u043e \u0437\u0430\u0434\u0430\u043d\u0438\u0435 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0434\u043e\u043c\u0430\u0448\u043d\u0435\u0433\u043e \u0437\u0430\u0434\u0430\u043d\u0438\u044f \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044f\u043c.<\/p>\n<p>\u0421\u0443\u0434\u044f \u043f\u043e \u0446\u0438\u0444\u0440\u0430\u043c, \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u0432\u044b\u0441\u043e\u043a\u043e\u0435. \u041e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u043f\u0440\u0438\u0447\u0438\u043d\u0430 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0447\u0430\u0441\u0442\u043e \u0441\u043b\u043e\u0436\u043d\u043e \u043e\u0442\u043d\u0435\u0441\u0442\u0438 \u043a \u043e\u0434\u043d\u043e\u043c\u0443 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u043c\u0443 \u0436\u0430\u043d\u0440\u0443, \u0438 \u043f\u0440\u0438 \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u0438 \u0436\u0430\u043d\u0440\u0430 \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043f\u0440\u0435\u0434\u0432\u0437\u044f\u0442\u043e\u0441\u0442\u044c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430. \u0422\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0431\u043e\u043b\u0435\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u0438\u0432\u043d\u0430\u044f \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0441\u0442\u0438\u043a\u0430, \u043e\u0442\u0440\u0430\u0436\u0430\u044e\u0449\u0430\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0438\u0445 \u0436\u0430\u043d\u0440\u043e\u0432 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0422\u0430\u043a\u0438\u043c \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u043c \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0432\u0435\u043a\u0442\u043e\u0440 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0435\u0439, \u0433\u0434\u0435 \u043a\u0430\u0436\u0434\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0432\u0435\u043a\u0442\u043e\u0440\u0430 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0438 \u043e\u0442\u043d\u0435\u0441\u0435\u043d\u0438\u044f \u043a \u0442\u043e\u043c\u0443 \u0438\u043b\u0438 \u0438\u043d\u043e\u043c\u0443 \u0436\u0430\u043d\u0440\u0443.<\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0442\u0430\u043a\u043e\u0439 \u0432\u0435\u043a\u0442\u043e\u0440, \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0443\u0441\u043b\u043e\u0436\u043d\u0438\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u0438\u044f OOF (Out-of-Fold). \u041d\u0435 \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438; \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e.<\/p>\n<pre><code class=\"python\">def get_oof(n_folds, x_train, y, x_test, text_features, seeds):          ntrain = x_train.shape[0]     ntest = x_test.shape[0]                oof_train = np.zeros((len(seeds), ntrain, 48))     oof_test = np.zeros((ntest, 48))     oof_test_skf = np.empty((len(seeds), n_folds, ntest, 48))     test_pool = Pool(data=x_test, text_features=text_features)      models = {}     for iseed, seed in enumerate(seeds):         kf = StratifiedKFold(             n_splits=n_folds,             shuffle=True,             random_state=seed)                   for i, (tr_i, t_i) in enumerate(kf.split(x_train, y)):             print(f'\\nSeed {seed}, Fold {i}')             x_tr = x_train.iloc[tr_i, :]             y_tr = y[tr_i]             x_te = x_train.iloc[t_i, :]             y_te = y[t_i]             train_pool = Pool(                 data=x_tr, label=y_tr, text_features=text_features)             valid_pool = Pool(                 data=x_te, label=y_te, text_features=text_features)             model = fit_model(                 train_pool, valid_pool,                 random_seed=seed,                 text_processing = tpo             )             x_te_pool = Pool(                 data=x_te, text_features=text_features)             oof_train[iseed, t_i, :] = \\                 model.predict_proba(x_te_pool)             oof_test_skf[iseed, i, :, :] = \\                 model.predict_proba(test_pool)             models[(seed, i)] = model     oof_test[:, :] = oof_test_skf.mean(axis=1).mean(axis=0)     oof_train = oof_train.mean(axis=0)     return oof_train, oof_test, models<\/code><\/pre>\n<p>\u041e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 \u0442\u0440\u0443\u0434\u043e\u0437\u0430\u0442\u0440\u0430\u0442\u043d\u043e, \u043d\u043e \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438:<\/p>\n<ul>\n<li>\n<p><em>oof_train<\/em>\u200a\u2014\u200aOOF-\u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u0438\u044f \u0434\u043b\u044f Android \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439<\/p>\n<\/li>\n<li>\n<p><em>oof_test\u200a\u2014\u200a<\/em>OOF-\u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u0438\u044f \u0434\u043b\u044f iOS \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439<\/p>\n<\/li>\n<li>\n<p><em>models<\/em>\u200a\u2014\u200aall OOF-\u043c\u043e\u0434\u0435\u043b\u0438 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0444\u043e\u043b\u0434\u0430 \u0438  \u0441\u0438\u0434\u0430<\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"python\">from sklearn.metrics import accuracy_score accuracy_score(     android_df['genre'].values,     np.take(models[(0,0)].classes_, oof_train.argmax(axis=1)))<\/code><\/pre>\n<p>\u0417\u0430 \u0441\u0447\u0435\u0442 \u0444\u043e\u043b\u0434\u043e\u0432 \u0438 \u0443\u0441\u0440\u0435\u0434\u043d\u0435\u043d\u0438\u044f \u043f\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u043c \u0440\u0430\u0437\u0431\u0438\u0435\u043d\u0438\u044f\u043c \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0443\u043b\u0443\u0447\u0448\u0438\u043b\u043e\u0441\u044c.<\/p>\n<pre><code class=\"python\">OOF accuracy: 0.6560790777135628<\/code><\/pre>\n<p>\u042f \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u0443\u044e \u0444\u0438\u0447\u0443 <em>android_genre_vec<\/em>, \u043a\u043e\u043f\u0438\u0440\u0443\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0438\u0437 <em>oof_train<\/em> \u0434\u043b\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 Android \u0438 <em>oof_test<\/em> \u0434\u043b\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 iOS.<\/p>\n<pre><code class=\"python\">idx = df[df['store_os']=='ios'].index df.loc[df['store_os']=='ios', 'android_genre_vec'] = \\     pd.Series(list(oof_test), index=idx) idx = df[df['store_os']=='android'].index df.loc[df['store_os']=='android', 'android_genre_vec'] = \\     pd.Series(list(oof_train), index=idx)<\/code><\/pre>\n<p>\u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0431\u044b\u043b \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d <em>android_genre<\/em>, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0436\u0430\u043d\u0440 \u0441 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0439 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c\u044e.<\/p>\n<pre><code class=\"python\">df.loc[df['store_os']=='ios', 'android_genre'] = \\     np.take(models[(0,0)].classes_, oof_test.argmax(axis=1)) df.loc[df['store_os']=='android', 'android_genre'] = \\     np.take(models[(0,0)].classes_, oof_train.argmax(axis=1))<\/code><\/pre>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0432\u0441\u0435\u0445 \u043c\u0430\u043d\u0438\u043f\u0443\u043b\u044f\u0446\u0438\u0439, \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u043a\u043e\u043d\u0435\u0446-\u0442\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0438 \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u044c \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u043f\u043e \u0436\u0430\u043d\u0440\u0430\u043c.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b3d\/ef6\/a98\/b3def6a98b0866b2673e6beae68aeffa.png\" width=\"859\" height=\"1000\"><figcaption><\/figcaption><\/figure>\n<h2>\u0418\u0442\u043e\u0433\u0438<\/h2>\n<p>\u0412 \u0441\u0442\u0430\u0442\u044c\u0435:<\/p>\n<ul>\n<li>\n<p>\u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d \u043d\u043e\u0432\u044b\u0439 \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u044b\u0439 \u0434\u0430\u0442\u0430\u0441\u0435\u0442;<\/p>\n<\/li>\n<li>\n<p>\u0441\u0434\u0435\u043b\u0430\u043d \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 EDA;<\/p>\n<\/li>\n<li>\n<p>\u0441\u043e\u0437\u0434\u0430\u043d\u044b \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043d\u043e\u0432\u044b\u0445 \u0444\u0438\u0447\u0435\u0439;<\/p>\n<\/li>\n<li>\n<p>\u0441\u043e\u0437\u0434\u0430\u043d\u0430 \u043c\u043e\u0434\u0435\u043b\u044c \u0434\u043b\u044f \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u0438\u044f \u0436\u0430\u043d\u0440\u043e\u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u043f\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f\u043c.<\/p>\n<\/li>\n<\/ul>\n<p>\u042f \u043d\u0430\u0434\u0435\u044e\u0441\u044c, \u0447\u0442\u043e \u044d\u0442\u043e\u0442 \u043d\u0430\u0431\u043e\u0440 \u0434\u0430\u043d\u043d\u044b\u0445 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u0435\u0437\u0435\u043d \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u0443 \u0438 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043a\u0430\u043a \u0432 \u043c\u043e\u0434\u0435\u043b\u044f\u0445, \u0442\u0430\u043a \u0438 \u0434\u043b\u044f \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0433\u043e \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u044f. \u041f\u043e \u043c\u0435\u0440\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439, \u044f \u0431\u0443\u0434\u0443 \u0441\u0442\u0430\u0440\u0430\u0442\u044c\u0441\u044f \u0435\u0433\u043e \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c.<\/p>\n<p>\u041a\u043e\u0434 \u0438\u0437 \u0441\u0442\u0430\u0442\u044c\u0438 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c <a href=\"https:\/\/medium.com\/r\/?url=https%3A%2F%2Fgithub.com%2Fsagol%2Fbundles_desc_tokens%2Fblob%2Fmain%2FEDA-apps.ipynb\" rel=\"noopener noreferrer nofollow\">\u0437\u0434\u0435\u0441\u044c<\/a>.<\/p>\n<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/559094\/\"> https:\/\/habr.com\/ru\/post\/559094\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<h2>\u0412\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0435<\/h2>\n<p>\u041c\u043e\u044f \u043e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0440\u0430\u0431\u043e\u0442\u0430 \u0441\u0432\u044f\u0437\u0430\u043d\u0430 \u0441 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u043e\u0439 \u0440\u0435\u043a\u043b\u0430\u043c\u043e\u0439, \u0438 \u0432\u0440\u0435\u043c\u044f \u043e\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043c\u043d\u0435 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u043e \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u0445. \u042f \u0440\u0435\u0448\u0438\u043b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043e\u0431\u0449\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u043c\u0438 \u0434\u043b\u044f \u0442\u0435\u0445, \u043a\u0442\u043e \u0445\u043e\u0447\u0435\u0442 \u043f\u043e\u043f\u0440\u0430\u043a\u0442\u0438\u043a\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0438 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0438\u043b\u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043e \u0434\u0430\u043d\u043d\u044b\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0438\u0437 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0445 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u0432. \u042f \u0441\u0447\u0438\u0442\u0430\u044e, \u0447\u0442\u043e \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0435 \u043d\u0430\u0431\u043e\u0440\u044b \u0434\u0430\u043d\u043d\u044b\u0445  \u0432\u0441\u0435\u0433\u0434\u0430 \u043f\u043e\u043b\u0435\u0437\u043d\u044b \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u0443. \u0421\u0431\u043e\u0440 \u0434\u0430\u043d\u043d\u044b\u0445 \u0447\u0430\u0441\u0442\u043e \u0431\u044b\u0432\u0430\u0435\u0442 \u0441\u043b\u043e\u0436\u043d\u043e\u0439 \u0438 \u0443\u043d\u044b\u043b\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u043e\u0439, \u0438 \u043d\u0435 \u0443 \u0432\u0441\u0435\u0445 \u0435\u0441\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044e \u0434\u0430\u0442\u0430\u0441\u0435\u0442 \u0438, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0435\u0433\u043e, \u043f\u043e\u0441\u0442\u0440\u043e\u044e \u043e\u0434\u043d\u0443 \u043c\u043e\u0434\u0435\u043b\u044c.<\/p>\n<h2>\u0414\u0430\u043d\u043d\u044b\u0435<\/h2>\n<p>\u0414\u0430\u0442\u0430\u0441\u0435\u0442 \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043d \u043d\u0430 \u0441\u0430\u0439\u0442\u0435 <a href=\"https:\/\/medium.com\/r\/?url=https%3A%2F%2Fwww.kaggle.com%2Fsagol79%2Fstemmed-description-tokens-and-application-genres\" rel=\"noopener noreferrer nofollow\">Kaggle<\/a>.<\/p>\n<p><code>DOI: 10.34740\/KAGGLE\/DSV\/2107675.<\/code><\/p>\n<p>\u0414\u043b\u044f 293392 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 (\u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0445) \u0441\u043e\u0431\u0440\u0430\u043d\u044b \u0442\u043e\u043a\u0435\u043d\u044b \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0439 \u0438 \u0441\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439, \u0432\u043a\u043b\u044e\u0447\u0430\u044f \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435. \u0412 \u043d\u0430\u0431\u043e\u0440\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0435\u0442 \u0438\u043c\u0435\u043d \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439; \u0438\u0445 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u0446\u0438\u0440\u0443\u044e\u0442 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0435 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u044b. \u041f\u0435\u0440\u0435\u0434 \u0442\u043e\u043a\u0435\u043d\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0439 \u0431\u044b\u043b\u0438 \u043f\u0435\u0440\u0435\u0432\u0435\u0434\u0435\u043d\u044b \u043d\u0430 \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u0438\u0439 \u044f\u0437\u044b\u043a.<\/p>\n<p>\u0412 \u0434\u0430\u0442\u0430\u0441\u0435\u0442\u0435 4 \u0444\u0430\u0439\u043b\u0430:<\/p>\n<ul>\n<li>\n<p><strong>bundles_desc.csv\u200a\u2014<\/strong>\u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f;<\/p>\n<\/li>\n<li>\n<p><strong>bundles_desc_tokens.csv\u200a\u2014\u200a<\/strong>\u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0442\u043e\u043a\u0435\u043d\u044b \u0438 \u0436\u0430\u043d\u0440\u044b;<\/p>\n<\/li>\n<li>\n<p><strong>bundles_prop.csv, bundles_summary.csv\u200a<\/strong>\u2014\u200a\u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442 \u0440\u043f\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0441\u0442\u0438\u043a\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0438 \u0434\u0430\u0442\u044b \u0440\u0435\u043b\u0438\u0437\u0430\/\u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f.<\/p>\n<\/li>\n<\/ul>\n<h2>EDA<\/h2>\n<p>\u041f\u0440\u0435\u0436\u0434\u0435 \u0432\u0441\u0435\u0433\u043e, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u0434\u0430\u043d\u043d\u044b\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0442\u0441\u044f \u043f\u043e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u043c \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u043c.<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0434\u043b\u044f Android \u0434\u043e\u043c\u0438\u043d\u0438\u0440\u0443\u044e\u0442 \u0432 \u0434\u0430\u043d\u043d\u044b\u0445. \u0421\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u044d\u0442\u043e \u0441\u0432\u044f\u0437\u0430\u043d\u043e \u0441 \u0442\u0435\u043c, \u0447\u0442\u043e \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0434\u043b\u044f Android. <\/p>\n<p>\u0423\u0447\u0438\u0442\u044b\u0432\u0430\u044f, \u0447\u0442\u043e \u043d\u0430\u0431\u043e\u0440 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0430\u043c\u044b\u0435 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c, \u043a\u0430\u043a \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u0434\u0430\u0442\u0430 \u0432\u044b\u043f\u0443\u0441\u043a\u0430.<\/p>\n<p><code>histnorm ='probability' # type of normalization<\/code><\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0433\u0440\u0430\u0444\u0438\u043a \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u0447\u0442\u043e \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u043e.<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0431\u044b\u043b\u0438 \u0441\u043e\u0431\u0440\u0430\u043d\u044b \u0437\u0430 \u043a\u043e\u0440\u043e\u0442\u043a\u0438\u0439 \u043f\u0435\u0440\u0438\u043e\u0434 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0432 \u044f\u043d\u0432\u0430\u0440\u0435 2021 \u0433\u043e\u0434\u0430.<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u043c \u043d\u043e\u0432\u0443\u044e \u0444\u0438\u0447\u0443 &#8212; \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043c\u0435\u0441\u044f\u0446\u0435\u0432 \u043c\u0435\u0436\u0434\u0443 \u0434\u0430\u0442\u043e\u0439 \u0432\u044b\u043f\u0443\u0441\u043a\u0430 \u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u043c \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435\u043c.<\/p>\n<pre><code class=\"python\">df['bundle_update_period'] = \\     (pd.to_datetime(         df['bundle_updated_at'], utc=True).dt.tz_convert(None).dt.to_period('M').astype('int') -       df['bundle_released_at'].dt.to_period('M').astype('int'))\u0443<\/code><\/pre>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0418\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c, \u043a\u0430\u043a \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u044b \u0436\u0430\u043d\u0440\u044b \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439. \u041f\u0440\u0438\u043d\u0438\u043c\u0430\u044f \u0432\u043e \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0434\u0438\u0441\u0431\u0430\u043b\u0430\u043d\u0441 \u041e\u0421, \u044f \u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u0443\u044e \u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u0433\u0438\u0441\u0442\u043e\u0433\u0440\u0430\u043c\u043c\u044b.<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u041c\u044b \u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e \u0436\u0430\u043d\u0440\u044b \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043d\u0435 \u043f\u0435\u0440\u0435\u0441\u0435\u043a\u0430\u044e\u0442\u0441\u044f. \u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u044d\u0442\u043e \u0437\u0430\u043c\u0435\u0442\u043d\u043e \u0432 \u0438\u0433\u0440\u0430\u0445. \u0414\u043b\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0442\u0430\u043a\u0430\u044f \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f \u043a\u0440\u0430\u0439\u043d\u0435 \u043d\u0435\u043f\u0440\u0438\u044f\u0442\u043d\u0430. \u0427\u0442\u043e \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441 \u044d\u0442\u0438\u043c \u043f\u043e\u0434\u0435\u043b\u0430\u0442\u044c? \u0421\u0430\u043c\u043e\u0435 \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e\u0435 &#8212; \u0443\u043c\u0435\u043d\u044c\u0448\u0438\u0442\u044c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0436\u0430\u043d\u0440\u043e\u0432 \u0434\u043b\u044f Android \u0438 \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u0438\u0445 \u043a \u0442\u043e\u043c\u0443 \u0436\u0435 \u0432\u0438\u0434\u0443, \u0447\u0442\u043e \u0438 \u0434\u043b\u044f iOS \u043f\u0443\u0442\u0435\u043c \u0441\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0432\u0441\u0435\u0445 \u0438\u0433\u0440\u043e\u0432\u044b\u0445 \u0436\u0430\u043d\u0440\u043e\u0432 \u043a \u043e\u0434\u043d\u043e\u043c\u0443 <em>Games<\/em>. \u041d\u043e \u044f \u043f\u043e\u043b\u0430\u0433\u0430\u044e, \u0447\u0442\u043e \u044d\u0442\u043e \u043d\u0435 \u043b\u0443\u0447\u0448\u0438\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442, \u0442\u0430\u043a \u043a\u0430\u043a \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0442\u0435\u0440\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438. \u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0440\u0435\u0448\u0438\u0442\u044c \u043e\u0431\u0440\u0430\u0442\u043d\u0443\u044e \u0437\u0430\u0434\u0430\u0447\u0443. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u044c, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0436\u0430\u043d\u0440\u044b \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u043f\u043e \u0438\u0445 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044e.<\/p>\n<h2>\u041c\u043e\u0434\u0435\u043b\u044c<\/h2>\n<p>\u042f \u0441\u043e\u0437\u0434\u0430\u043b \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0444\u0438\u0447\u0435\u0439, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0434\u043b\u0438\u043d\u0443 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0438 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0442\u043e\u043a\u0435\u043d\u043e\u0432.<\/p>\n<pre><code class=\"python\">def get_lengths(df, columns=['tokens', 'description']):     lengths_df = pd.DataFrame()     for i, c in enumerate(columns):         lengths_df[f\"{c}_len\"] = df[c].apply(len)         if i &gt; 0:             lengths_df[f\"{c}_div\"] = \\                 lengths_df.iloc[:, i-1] \/ lengths_df.iloc[:, i]             lengths_df[f\"{c}_diff\"] = \\                 lengths_df.iloc[:, i-1] - lengths_df.iloc[:, i]     return lengths_df df = pd.concat([df, get_lengths(df)], axis=1, sort=False, copy=False)<\/code><\/pre>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0435\u0449\u0435 \u043e\u0434\u043d\u043e\u0439 \u0444\u0438\u0447\u0438 \u044f \u0432\u0437\u044f\u043b \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043c\u0435\u0441\u044f\u0446\u0435\u0432, \u043f\u0440\u043e\u0448\u0435\u0434\u0448\u0438\u0445 \u0441 \u0434\u0430\u0442\u044b \u0432\u044b\u043f\u0443\u0441\u043a\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0418\u0434\u0435\u044f \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043d\u0430 \u0440\u044b\u043d\u043a\u0435 \u0432 \u0440\u0430\u0437\u043d\u044b\u0435 \u043f\u0435\u0440\u0438\u043e\u0434\u044b \u043c\u043e\u0433\u043b\u043e \u0431\u044b\u0442\u044c \u043a\u0430\u043a\u043e\u0435-\u0442\u043e \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0442\u0435\u043d\u0438\u0435 \u0438\u0433\u0440\u043e\u0432\u044b\u043c \u0436\u0430\u043d\u0440\u0430\u043c.<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0414\u043b\u044f \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0434\u0430\u043d\u043d\u044b\u0435 Android-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439.<\/p>\n<pre><code class=\"python\">android_df = df[df['store_os']=='android'] ios_df = df[df['store_os']=='ios']<\/code><\/pre>\n<p>\u041e\u043a\u043e\u043d\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u0444\u0438\u0447\u0435\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"python\">columns = [     'genre', 'tokens', 'bundle_update_period', 'tokens_len',     'description_len', 'description_div', 'description_diff',     'description', 'rating', 'reviews', 'score',     'released_at_month' ]<\/code><\/pre>\n<p>\u042f \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u043b \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 \u0434\u0432\u0435 \u0447\u0430\u0441\u0442\u0438 &#8212; <em>train<\/em> \u0438 <em>validation<\/em>. \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0441\u0442\u0440\u0430\u0442\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u043e.<\/p>\n<pre><code class=\"python\">train_df, test_df = train_test_split(     android_df[columns], train_size=0.7, random_state=0, stratify=android_df['genre']) y_train, X_train = train_df['genre'], train_df.drop(['genre'], axis=1) y_test, X_test = test_df['genre'], test_df.drop(['genre'], axis=1)<\/code><\/pre>\n<p>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0434\u043b\u044f \u043c\u043e\u0434\u0435\u043b\u0438 \u044f \u0432\u044b\u0431\u0440\u0430\u043b <a href=\"https:\/\/catboost.ai\/\" rel=\"noopener noreferrer nofollow\">CatBoost<\/a>. CatBoost &#8212; \u044d\u0442\u043e \u0432\u044b\u0441\u043e\u043a\u043e\u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0434\u043b\u044f \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u043d\u043e\u0433\u043e \u0431\u0443\u0441\u0442\u0438\u043d\u0433\u0430 \u043d\u0430 \u0434\u0435\u0440\u0435\u0432\u044c\u044f\u0445 \u0440\u0435\u0448\u0435\u043d\u0438\u0439 \u0441 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c. \u041e\u0441\u043d\u043e\u0432\u043d\u044b\u043c \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u043c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0442\u043e, \u0447\u0442\u043e CatBoost \u043c\u043e\u0436\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u0438 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0435 \u0444\u0438\u0447\u0438 \u0431\u0435\u0437 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438. \u0422\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0435 \u0444\u0438\u0447\u0438 \u0434\u043b\u044f \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 \u0432\u0435\u0440\u0441\u0438\u0438 0.19.1<\/p>\n<p>\u0412 <a href=\"https:\/\/habr.com\/ru\/post\/555064\/\" rel=\"noopener noreferrer nofollow\">\u041d\u0435\u0442\u0440\u0430\u0434\u0438\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0430\u043d\u0430\u043b\u0438\u0437 \u0442\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0442\u0435\u043a\u0441\u0442\u0430: BERT vs&nbsp;CatBoost<\/a> \u044f \u043f\u0440\u0438\u0432\u043e\u0436\u0443 \u043f\u0440\u0438\u043c\u0435\u0440 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a CatBoost \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 \u0442\u0435\u043a\u0441\u0442\u043e\u043c \u0438 \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u044e \u0435\u0433\u043e \u0441 BERT. <\/p>\n<pre><code class=\"python\">!pip install -U catboost<\/code><\/pre>\n<p>\u041f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 CatBoost \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Pool. \u042d\u0442\u043e \u0443\u0434\u043e\u0431\u043d\u0430\u044f \u043e\u0431\u043e\u043b\u043e\u0447\u043a\u0430, \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u044e\u0449\u0430\u044f \u043c\u0435\u0442\u043a\u0438 \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0435, \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u0438 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0435 \u0444\u0438\u0447\u0438. \u0411\u043e\u043d\u0443\u0441\u043e\u043c \u0438\u0434\u0435\u0442 \u0441\u043d\u0438\u0436\u0435\u043d\u0438\u0435 \u0437\u0430\u0442\u0440\u0430\u0442 \u043f\u0430\u043c\u044f\u0442\u0438, \u0442\u0430\u043a \u043a\u0430\u043a \u043d\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0430\u0446\u0438\u044f \u0432\u043d\u0443\u0442\u0440\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438.<\/p>\n<pre><code class=\"python\">train_pool = Pool(     data=X_train,      label=y_train,     text_features=['tokens', 'description'] ) test_pool = Pool(     data=X_test,      label=y_test,      text_features=['tokens', 'description'] )<\/code><\/pre>\n<p>\u041d\u0430\u043f\u0438\u0448\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0434\u043b\u044f \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0438 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u043c\u043e\u0434\u0435\u043b\u0438. \u042f \u043d\u0435 \u043f\u043e\u0434\u0431\u0438\u0440\u0430\u043b \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b; \u043f\u0443\u0441\u0442\u044c \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0435\u0449\u0435 \u043e\u0434\u043d\u0438\u043c \u0434\u043e\u043c\u0430\u0448\u043d\u0438\u043c \u0437\u0430\u0434\u0430\u043d\u0438\u0435\u043c.<\/p>\n<pre><code class=\"python\">def fit_model(train_pool, test_pool, **kwargs):     model = CatBoostClassifier(         random_seed=0,         task_type='GPU',         iterations=10000,         learning_rate=0.1,         eval_metric='Accuracy',         od_type='Iter',         od_wait=500,         **kwargs     ) return model.fit(         train_pool,         eval_set=test_pool,         verbose=1000,         plot=True,         use_best_model=True     )<\/code><\/pre>\n<p>\u0422\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0435 \u0444\u0438\u0447\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043d\u043e\u0432\u044b\u0445 \u0447\u0438\u0441\u043b\u043e\u0432\u044b\u0445 \u0444\u0438\u0447\u0435\u0439. \u041d\u043e \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u0431\u044a\u044f\u0441\u043d\u0438\u0442\u044c CatBoost, \u0447\u0442\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u043e\u0442 \u043d\u0435\u0433\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c.<\/p>\n<p><strong>CatBoostClassifier<\/strong> \u0438\u043c\u0435\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432:<\/p>\n<ul>\n<li>\n<p><em>tokenizers\u200a\u2014\u200a<\/em>\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0435 \u0434\u043b\u044f \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0444\u0438\u0447\u0435\u0439 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u0442\u0438\u043f\u0430 \u043f\u0435\u0440\u0435\u0434 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435\u043c \u0441\u043b\u043e\u0432\u0430\u0440\u044f;<\/p>\n<\/li>\n<li>\n<p><em>dictionaries\u200a\u2014\u200a<\/em>\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0444\u0438\u0447\u0435\u0439 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u0442\u0438\u043f\u0430;<\/p>\n<\/li>\n<li>\n<p><em>feature_calcers\u200a\u2014<\/em>\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0440\u0430\u0441\u0447\u0435\u0442\u0430 \u043d\u043e\u0432\u044b\u0445 \u0444\u0438\u0447\u0435\u0439;<\/p>\n<\/li>\n<li>\n<p><em>text_processing\u200a\u2014\u200a<\/em>\u043e\u0431\u0449\u0438\u0439 JSON-\u043a\u043e\u043d\u0444\u0438\u0433 \u0434\u043b\u044f \u0442\u043e\u043a\u0435\u043d\u0438\u0437\u0430\u0442\u043e\u0440\u043e\u0432, \u0441\u043b\u043e\u0432\u0430\u0440\u0435\u0439 \u0438 \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442, \u043a\u0430\u043a \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0435 \u0444\u0438\u0447\u0438 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u044e\u0442\u0441\u044f \u0432 \u0444\u0438\u0447\u0438 \u0441 \u043f\u043b\u0430\u0432\u0430\u044e\u0449\u0435\u0439 \u0442\u043e\u0447\u043a\u043e\u0439.<\/p>\n<\/li>\n<\/ul>\n<p>\u0427\u0435\u0442\u0432\u0435\u0440\u0442\u044b\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u0437\u0430\u043c\u0435\u043d\u044f\u0435\u0442 \u043f\u0435\u0440\u0432\u044b\u0435 \u0442\u0440\u0438 \u0438, \u043d\u0430 \u043c\u043e\u0439 \u0432\u0437\u0433\u043b\u044f\u0434, \u0441\u0430\u043c\u044b\u0439 \u0443\u0434\u043e\u0431\u043d\u044b\u0439, \u0442\u0430\u043a \u043a\u0430\u043a \u0432 \u043e\u0434\u043d\u043e\u043c \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f, \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u0442\u0435\u043a\u0441\u0442\u043e\u043c.<\/p>\n<pre><code class=\"python\">tpo = {     'tokenizers': [         {             'tokenizer_id': 'Sense',             'separator_type': 'BySense',         }     ],     'dictionaries': [         {             'dictionary_id': 'Word',             'token_level_type': 'Word',             'occurrence_lower_bound': '10'         },         {             'dictionary_id': 'Bigram',             'token_level_type': 'Word',             'gram_order': '2',             'occurrence_lower_bound': '10'         },         {             'dictionary_id': 'Trigram',             'token_level_type': 'Word',             'gram_order': '3',             'occurrence_lower_bound': '10'         },     ],     'feature_processing': {         '0': [             {                 'tokenizers_names': ['Sense'],                 'dictionaries_names': ['Word'],                 'feature_calcers': ['BoW']             },             {                 'tokenizers_names': ['Sense'],                 'dictionaries_names': ['Bigram', 'Trigram'],                 'feature_calcers': ['BoW']             },         ],         '1': [             {                 'tokenizers_names': ['Sense'],                 'dictionaries_names': ['Word'],                 'feature_calcers': ['BoW', 'BM25']             },             {                 'tokenizers_names': ['Sense'],                 'dictionaries_names': ['Bigram', 'Trigram'],                 'feature_calcers': ['BoW']             },         ]     } }<\/code><\/pre>\n<p>\u0417\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435:<\/p>\n<pre><code class=\"python\">model_catboost = fit_model(     train_pool, test_pool,     text_processing = tpo )<\/code><\/pre>\n<figure class=\"full-width\"><figcaption>Accuracy<\/figcaption><\/figure>\n<figure class=\"full-width\"><figcaption>Loss<\/figcaption><\/figure>\n<pre><code class=\"python\">bestTest = 0.6454657601<\/code><\/pre>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0422\u043e\u043b\u044c\u043a\u043e \u0434\u0432\u0435 \u0444\u0438\u0447\u0438 \u0438\u043c\u0435\u044e\u0442 \u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u0432\u043b\u0438\u044f\u043d\u0438\u0435 \u043d\u0430 \u043c\u043e\u0434\u0435\u043b\u044c. \u0421\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0432\u044b\u0441\u0438\u0442\u044c \u0437\u0430 \u0441\u0447\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f <em>summary<\/em>, \u043d\u043e, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443  \u044d\u0442\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0435\u0442 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u0445 iOS, \u0431\u044b\u0441\u0442\u0440\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u043d\u0435 \u0443\u0434\u0430\u0441\u0442\u0441\u044f. \u041c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u044c, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043a\u043e\u0440\u043e\u0442\u043a\u0438\u0439 \u0430\u0431\u0437\u0430\u0446 \u0442\u0435\u043a\u0441\u0442\u0430 \u0438\u0437 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f. \u042f \u043e\u0441\u0442\u0430\u0432\u043b\u044e \u044d\u0442\u043e \u0437\u0430\u0434\u0430\u043d\u0438\u0435 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0434\u043e\u043c\u0430\u0448\u043d\u0435\u0433\u043e \u0437\u0430\u0434\u0430\u043d\u0438\u044f \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044f\u043c.<\/p>\n<p>\u0421\u0443\u0434\u044f \u043f\u043e \u0446\u0438\u0444\u0440\u0430\u043c, \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u0432\u044b\u0441\u043e\u043a\u043e\u0435. \u041e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u043f\u0440\u0438\u0447\u0438\u043d\u0430 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0447\u0430\u0441\u0442\u043e \u0441\u043b\u043e\u0436\u043d\u043e \u043e\u0442\u043d\u0435\u0441\u0442\u0438 \u043a \u043e\u0434\u043d\u043e\u043c\u0443 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u043c\u0443 \u0436\u0430\u043d\u0440\u0443, \u0438 \u043f\u0440\u0438 \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u0438 \u0436\u0430\u043d\u0440\u0430 \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043f\u0440\u0435\u0434\u0432\u0437\u044f\u0442\u043e\u0441\u0442\u044c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430. \u0422\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0431\u043e\u043b\u0435\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u0438\u0432\u043d\u0430\u044f \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0441\u0442\u0438\u043a\u0430, \u043e\u0442\u0440\u0430\u0436\u0430\u044e\u0449\u0430\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0438\u0445 \u0436\u0430\u043d\u0440\u043e\u0432 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0422\u0430\u043a\u0438\u043c \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u043c \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0432\u0435\u043a\u0442\u043e\u0440 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0435\u0439, \u0433\u0434\u0435 \u043a\u0430\u0436\u0434\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0432\u0435\u043a\u0442\u043e\u0440\u0430 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0438 \u043e\u0442\u043d\u0435\u0441\u0435\u043d\u0438\u044f \u043a \u0442\u043e\u043c\u0443 \u0438\u043b\u0438 \u0438\u043d\u043e\u043c\u0443 \u0436\u0430\u043d\u0440\u0443.<\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0442\u0430\u043a\u043e\u0439 \u0432\u0435\u043a\u0442\u043e\u0440, \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0443\u0441\u043b\u043e\u0436\u043d\u0438\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u0438\u044f OOF (Out-of-Fold). \u041d\u0435 \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438; \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e.<\/p>\n<pre><code class=\"python\">def get_oof(n_folds, x_train, y, x_test, text_features, seeds):          ntrain = x_train.shape[0]     ntest = x_test.shape[0]                oof_train = np.zeros((len(seeds), ntrain, 48))     oof_test = np.zeros((ntest, 48))     oof_test_skf = np.empty((len(seeds), n_folds, ntest, 48))     test_pool = Pool(data=x_test, text_features=text_features)      models = {}     for iseed, seed in enumerate(seeds):         kf = StratifiedKFold(             n_splits=n_folds,             shuffle=True,             random_state=seed)                   for i, (tr_i, t_i) in enumerate(kf.split(x_train, y)):             print(f'\\nSeed {seed}, Fold {i}')             x_tr = x_train.iloc[tr_i, :]             y_tr = y[tr_i]             x_te = x_train.iloc[t_i, :]             y_te = y[t_i]             train_pool = Pool(                 data=x_tr, label=y_tr, text_features=text_features)             valid_pool = Pool(                 data=x_te, label=y_te, text_features=text_features)             model = fit_model( <\/code><\/pre>\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-323698","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/323698","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=323698"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/323698\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=323698"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=323698"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=323698"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}