{"id":345944,"date":"2023-02-27T15:04:31","date_gmt":"2023-02-27T15:04:31","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=345944"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=345944","title":{"rendered":"<span>\u041a\u0430\u043a \u0443\u043b\u0443\u0447\u0448\u0438\u0442\u044c \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c ML-\u043c\u043e\u0434\u0435\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0440\u0430\u0437\u0432\u0435\u0434\u043e\u0447\u043d\u044b\u0439 \u0430\u043d\u0430\u043b\u0438\u0437<\/span>"},"content":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041f\u0440\u0438\u0432\u0435\u0442, \u0425\u0430\u0431\u0440! \u041c\u0435\u043d\u044f \u0437\u043e\u0432\u0443\u0442 \u041a\u0438\u0440\u0438\u043b\u043b \u0422\u043e\u0431\u043e\u043b\u0430, \u044f Data Scientist \u0438 \u0443\u0447\u0430\u0441\u0442\u043d\u0438\u043a <a href=\"https:\/\/newtechaudit.ru\/\" rel=\"noopener noreferrer nofollow\"><u>\u043f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u0430 NTA.<\/u><\/a><\/p>\n<p>\u0414\u043e\u0431\u0440\u043e \u043f\u043e\u0436\u0430\u043b\u043e\u0432\u0430\u0442\u044c \u0432\u00a0\u0433\u043e\u0434 2912, \u0433\u0434\u0435 \u0432\u0430\u0448\u0438 DS \u043d\u0430\u0432\u044b\u043a\u0438 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u044f\u0442\u0441\u044f \u0434\u043b\u044f\u00a0\u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043a\u043e\u0441\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0437\u0430\u0433\u0430\u0434\u043a\u0438. \u041c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0441\u00a0\u043a\u043e\u0440\u0430\u0431\u043b\u044f \u043d\u0430\u00a0\u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0438 4\u00a0\u0441\u0432\u0435\u0442\u043e\u0432\u044b\u0445 \u043b\u0435\u0442, \u0438 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043f\u043b\u043e\u0445\u043e.<\/p>\n<p>\u041a\u0440\u0435\u0439\u0441\u0435\u0440 \u0422\u0438\u0442\u0430\u043d\u0438\u043a\u00a0\u2014 \u043c\u0435\u0436\u0433\u0430\u043b\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043f\u0430\u0441\u0441\u0430\u0436\u0438\u0440\u0441\u043a\u0438\u0439 \u043b\u0430\u0439\u043d\u0435\u0440 \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u043b\u0441\u044f \u0432\u00a0\u043f\u0443\u0442\u044c \u043e\u043a\u043e\u043b\u043e \u043c\u0435\u0441\u044f\u0446\u0430 \u043d\u0430\u0437\u0430\u0434. \u041f\u043e\u0447\u0442\u0438 13\u00a0000\u00a0\u043f\u0430\u0441\u0441\u0430\u0436\u0438\u0440\u043e\u0432 \u043d\u0430\u0445\u043e\u0434\u0438\u043b\u0438\u0441\u044c \u043d\u0430\u00a0\u0431\u043e\u0440\u0442\u0443. \u0421\u0443\u0434\u043d\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u043b\u043e\u0441\u044c \u0432\u00a0\u0441\u0432\u043e\u0439 \u043c\u0430\u0440\u0448\u0440\u0443\u0442, \u043f\u0435\u0440\u0435\u0432\u043e\u0437\u044f \u044d\u043c\u0438\u0433\u0440\u0430\u043d\u0442\u043e\u0432 \u0438\u0437\u00a0\u043d\u0430\u0448\u0435\u0439 \u0441\u043e\u043b\u043d\u0435\u0447\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043a\u00a0\u0442\u0440\u0435\u043c \u043d\u043e\u0432\u044b\u043c \u043d\u0435\u0434\u0430\u0432\u043d\u043e \u043e\u0441\u0432\u043e\u0435\u043d\u043d\u044b\u043c \u044d\u043a\u0437\u043e\u043f\u043b\u0430\u043d\u0435\u0442\u0430\u043c.<\/p>\n<p>\u0421\u043b\u0435\u0434\u0443\u044f \u0447\u0435\u0440\u0435\u0437 \u0410\u043b\u044c\u0444\u0430 \u0426\u0435\u043d\u0442\u0430\u0432\u0440\u0443 \u043d\u0430\u00a0\u043f\u0443\u0442\u0438 \u043a\u00a0\u043f\u0435\u0440\u0432\u043e\u043c\u0443 \u043f\u0443\u043d\u043a\u0442\u0443 \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0436\u0430\u0440\u043a\u043e\u0439 55\u00a0\u041a\u0430\u043d\u0441\u0440\u0438 \u0415, \u043a\u0440\u0435\u0439\u0441\u0435\u0440 \u0422\u0438\u0442\u0430\u043d\u0438\u043a \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0441\u044f \u0441\u00a0\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u2011\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0430\u043d\u043e\u043c\u0430\u043b\u0438\u0435\u0439, \u0441\u043a\u0440\u044b\u0432\u0448\u0435\u0439\u0441\u044f \u0437\u0430\u00a0\u043e\u0431\u043b\u0430\u043a\u043e\u043c \u043a\u043e\u0441\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043f\u044b\u043b\u0438. \u041a\u00a0\u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u043a\u0440\u0435\u0439\u0441\u0435\u0440 \u043f\u043e\u0441\u0442\u0438\u0433\u043b\u0430 \u0442\u0430\u00a0\u0436\u0435 \u0443\u0447\u0430\u0441\u0442\u044c, \u0447\u0442\u043e\u00a0\u0438 \u043e\u0434\u043d\u043e\u0438\u043c\u0435\u043d\u043d\u044b\u0439 \u043a\u043e\u0440\u0430\u0431\u043b\u044c \u0440\u043e\u0432\u043d\u043e 1000\u00a0\u043b\u0435\u0442 \u043d\u0430\u0437\u0430\u0434. \u0412\u00a0\u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u0430\u043a\u00a0\u043a\u043e\u0440\u0430\u0431\u043b\u044c \u043d\u0435\u00a0\u043f\u043e\u0441\u0442\u0440\u0430\u0434\u0430\u043b, \u043f\u043e\u0447\u0442\u0438 \u043f\u043e\u043b\u043e\u0432\u0438\u043d\u0430 \u043f\u0430\u0441\u0441\u0430\u0436\u0438\u0440\u043e\u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u043b\u0438\u0441\u044c \u0432\u00a0\u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u043e\u0435 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e.<\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u0441\u043f\u0430\u0441\u0442\u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u0438 \u0432\u0435\u0440\u043d\u0443\u0442\u044c \u043f\u043e\u0442\u0435\u0440\u044f\u043d\u043d\u044b\u0445 \u043f\u0430\u0441\u0441\u0430\u0436\u0438\u0440\u043e\u0432, \u0432\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043f\u0440\u043e\u0433\u043d\u043e\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u0442\u043e \u0438\u0437\u00a0\u043f\u0430\u0441\u0441\u0430\u0436\u0438\u0440\u043e\u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u043b\u0441\u044f \u0432\u00a0\u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u0443\u044e \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437\u00a0\u043f\u043e\u0432\u0440\u0435\u0436\u0434\u0435\u043d\u043d\u043e\u0433\u043e \u0436\u0443\u0440\u043d\u0430\u043b\u0430 \u043a\u043e\u0440\u0430\u0431\u043b\u044f. \u0417\u0430\u0434\u0430\u0447\u0430 \u043f\u043e\u043c\u043e\u0447\u044c \u0438\u043c \u0441\u043f\u0430\u0441\u0442\u0438\u0441\u044c \u0438 \u043d\u0435\u00a0\u0434\u0430\u0442\u044c \u0438\u0441\u0442\u043e\u0440\u0438\u0438 \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c\u0441\u044f \u0432\u043d\u043e\u0432\u044c\u2026 \u0425\u043e\u0442\u044f \u043c\u043e\u0436\u0435\u0442 \u0438 \u043d\u0435\u00a0\u043d\u0443\u0436\u043d\u043e \u0438 \u043f\u043e\u044f\u0432\u0438\u0442\u0441\u044f \u043d\u043e\u0432\u044b\u0439 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043d\u0435\u043f\u043b\u043e\u0445\u043e\u0439 \u0444\u0438\u043b\u044c\u043c.<\/p>\n<p><strong>Spaceship Titanic<\/strong>\u00a0\u2014 \u044d\u0442\u043e \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430 \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f, \u0430\u00a0\u0438\u043c\u0435\u043d\u043d\u043e \u0437\u0430\u0434\u0430\u0447\u0430 \u0431\u0438\u043d\u0430\u0440\u043d\u043e\u0439 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/448\/565\/329\/4485653290b489b83e064d744cd6de8b.jpg\" width=\"1164\" height=\"658\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/448\/565\/329\/4485653290b489b83e064d744cd6de8b.jpg\" data-blurred=\"true\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0421\u0435\u0433\u043e\u0434\u043d\u044f \u044f \u0445\u043e\u0447\u0443 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043e\u0431\u00a0\u043e\u043f\u044b\u0442\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f EDA (Exploratory Data Analysis) \u0434\u043b\u044f\u00a0\u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044f \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438 ML\u2011\u043c\u043e\u0434\u0435\u043b\u0438, \u043d\u0430\u00a0\u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0437\u0430\u0434\u0430\u0447\u0438 \u0438\u0437 <a href=\"https:\/\/www.kaggle.com\/competitions\/spaceship-titanic\/overview\" rel=\"noopener noreferrer nofollow\">\u0441\u043e\u0440\u0435\u0432\u043d\u043e\u0432\u0430\u043d\u0438\u044f Spaceship Titanic<\/a>. EDA (\u0438\u043b\u0438 \u0440\u0430\u0437\u0432\u0435\u0434\u043e\u0447\u043d\u044b\u0439 \u0430\u043d\u0430\u043b\u0438\u0437)\u00a0\u2014 \u0430\u043d\u0430\u043b\u0438\u0437 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u0441\u0432\u043e\u0439\u0441\u0442\u0432 \u0434\u0430\u043d\u043d\u044b\u0445, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0439 \u0434\u043b\u044f\u00a0\u043d\u0430\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u043e\u0431\u0449\u0438\u0445 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439. \u0421\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0435\u043c \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u0432\u0435\u0434\u043e\u0447\u043d\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u0432\u044b\u0448\u0435\u043d\u0438\u0435 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430 \u043c\u043e\u0434\u0435\u043b\u0438 \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f.<\/p>\n<p>\u0414\u043b\u044f\u00a0\u043d\u0430\u0447\u0430\u043b\u0430 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u044e \u043d\u0430\u0431\u043e\u0440 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445:<\/p>\n<ul>\n<li>\n<p>\u0420\u0430\u0437\u043c\u0435\u0440\u043d\u043e\u0441\u0442\u044c \u043e\u0431\u0443\u0447\u0430\u044e\u0449\u0435\u0439 \u0432\u044b\u0431\u043e\u0440\u043a\u0438 (8693\u00a0x 13)<\/p>\n<\/li>\n<li>\n<p>\u0420\u0430\u0437\u043c\u0435\u0440\u043d\u043e\u0441\u0442\u044c \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0439 \u0432\u044b\u0431\u043e\u0440\u043a\u0438 (4277\u00a0x 13)<\/p>\n<\/li>\n<\/ul>\n<p>\u0414\u0430\u043d\u043d\u044b\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0438:<\/p>\n<ul>\n<li>\n<p><strong>PassengerId<\/strong>\u00a0\u2014 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0434\u043b\u044f\u00a0\u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043f\u0430\u0441\u0441\u0430\u0436\u0438\u0440\u0430. \u0421\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437\u00a0\u043d\u043e\u043c\u0435\u0440\u0430 \u0433\u0440\u0443\u043f\u043f\u044b \u0438 \u043d\u043e\u043c\u0435\u0440\u0430 \u0432\u00a0\u044d\u0442\u043e\u0439 \u0433\u0440\u0443\u043f\u043f\u0435.<\/p>\n<\/li>\n<li>\n<p><strong>HomePlanet<\/strong>\u00a0\u2014 \u043f\u043b\u0430\u043d\u0435\u0442\u0430, \u0441\u00a0\u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u043b\u0441\u044f \u043f\u0430\u0441\u0441\u0430\u0436\u0438\u0440.<\/p>\n<\/li>\n<li>\n<p><strong>CryoSleep<\/strong>\u00a0\u2014 \u0438\u043d\u0434\u0438\u043a\u0430\u0442\u043e\u0440 \u043a\u0440\u0438\u043e\u0441\u043d\u0430.<\/p>\n<\/li>\n<li>\n<p><strong>Cabin<\/strong>\u00a0\u2014 \u043d\u043e\u043c\u0435\u0440 \u043a\u0430\u0431\u0438\u043d\u044b. \u0421\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437\u00a0\u043f\u0430\u043b\u0443\u0431\u044b\/\u043d\u043e\u043c\u0435\u0440\u0430\/\u0441\u0442\u043e\u0440\u043e\u043d\u044b.<\/p>\n<\/li>\n<li>\n<p><strong>Destination<\/strong>\u00a0\u2014 \u043f\u043b\u0430\u043d\u0435\u0442\u0430, \u043d\u0430\u00a0\u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043b\u0435\u0442\u0435\u043b \u043f\u0430\u0441\u0441\u0430\u0436\u0438\u0440.<\/p>\n<\/li>\n<li>\n<p><strong>Age<\/strong>\u00a0\u2014 \u0432\u043e\u0437\u0440\u0430\u0441\u0442 \u043f\u0430\u0441\u0441\u0430\u0436\u0438\u0440\u0430.<\/p>\n<\/li>\n<li>\n<p><strong>VIP<\/strong>\u00a0\u2014 \u0438\u043d\u0434\u0438\u043a\u0430\u0442\u043e\u0440, \u0437\u0430\u043f\u043b\u0430\u0442\u0438\u043b\u00a0\u043b\u0438 \u043f\u0430\u0441\u0441\u0430\u0436\u0438\u0440 \u0437\u0430\u00a0\u0412\u0418\u041f \u0441\u0435\u0440\u0432\u0438\u0441\u044b.<\/p>\n<\/li>\n<li>\n<p><strong>RoomService, FoodCourt, ShoppingMall, Spa, VRDeck<\/strong>\u00a0\u2014 \u0441\u0443\u043c\u043c\u0430, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043f\u0430\u0441\u0441\u0430\u0436\u0438\u0440 \u0437\u0430\u043f\u043b\u0430\u0442\u0438\u043b \u0437\u0430\u00a0\u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u043a\u043e\u0441\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043a\u043e\u0440\u0430\u0431\u043b\u044f.<\/p>\n<\/li>\n<li>\n<p><strong>Name<\/strong>\u00a0\u2014 \u0438\u043c\u044f \u0438 \u0444\u0430\u043c\u0438\u043b\u0438\u044f \u043f\u0430\u0441\u0441\u0430\u0436\u0438\u0440\u0430.<\/p>\n<\/li>\n<li>\n<p><strong>Transported<\/strong>\u00a0\u2014 \u0446\u0435\u043b\u0435\u0432\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f.<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u0435\u0440\u0432\u044b\u043c \u0434\u0435\u043b\u043e\u043c \u0434\u0435\u043a\u043e\u043c\u043f\u043e\u0437\u0438\u0440\u0443\u044e \u0441\u043e\u0441\u0442\u0430\u0432\u043d\u044b\u0435 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0438 \u0438 \u0443\u0431\u0435\u0440\u0443 \u043d\u0435\u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0432\u043d\u044b\u0435:<\/p>\n<pre><code class=\"python\">def split_feature(feature: str, new_features: list, sep: str) -> None:     X_train[new_features] = X_train[feature].str.split(sep, expand=True)     X_test[new_features] = X_test[feature].str.split(sep, expand=True)  def drop_features(features: list) -> None:     X_train.drop(features, axis=1, inplace=True)     X_test.drop(features, axis=1, inplace=True)       def cast_feature(feature: str, cast: str) -> None:     X_train[feature] = X_train[feature].astype(cast)     X_test[feature] = X_test[feature].astype(cast)       split_feature('PassengerId', ['GroupId', 'IdWithinGroup'], '_') split_feature('Cabin', ['Deck', 'Num', 'Side'], '\/')  drop_features(['Name', 'PassengerId', 'Cabin', 'IdWithinGroup', 'VIP', 'Num'])  for feature in ['GroupId']:     cast_feature(feature, 'float') <\/code><\/pre>\n<p>\u042f \u0440\u0435\u0448\u0438\u043b \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0438: <\/p>\n<ul>\n<li>\n<p>Name (\u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u0441\u00a0\u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043d\u0435\u0433\u043e \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0438);<\/p>\n<\/li>\n<li>\n<p>IdWithinGroup (\u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0432\u043d\u0443\u0442\u0440\u0438 \u0433\u0440\u0443\u043f\u043f\u044b, \u043d\u0435\u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0432\u043d\u044b\u0439);<\/p>\n<\/li>\n<li>\n<p>Num (\u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u043d\u0438\u043c\u0430\u044e, \u043f\u043e\u00a0\u043a\u0430\u043a\u043e\u043c\u0443 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0443 \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0438).<\/p>\n<\/li>\n<\/ul>\n<p>\u0414\u043b\u044f\u00a0\u043d\u0430\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u043d\u0435\u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0432\u043d\u044b\u0445 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432 \u044f \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0441\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439 <a href=\"https:\/\/shap.readthedocs.io\/en\/latest\/index.html\" rel=\"noopener noreferrer nofollow\">SHAP<\/a>. \u0414\u0430\u043d\u043d\u0430\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u043e\u0446\u0435\u043d\u0438\u0432\u0430\u0435\u0442 \u0432\u0430\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432 \u043f\u0440\u0438\u00a0\u043f\u043e\u043c\u043e\u0449\u0438 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f <a href=\"https:\/\/ru.wikipedia.org\/wiki\/%D0%92%D0%B5%D0%BA%D1%82%D0%BE%D1%80_%D0%A8%D0%B5%D0%BF%D0%BB%D0%B8\" rel=\"noopener noreferrer nofollow\"><em>\u0432\u0435\u043a\u0442\u043e\u0440\u0430 \u0428\u0435\u043f\u043b\u0438<\/em><\/a>. \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043e\u0446\u0435\u043d\u043a\u0438 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432 \u0432\u00a0\u0432\u0438\u0434\u0435 \u0433\u0440\u0430\u0444\u0438\u043a\u0430: <\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/b7a\/852\/deb\/b7a852debd95269f73d4d5202f4ddf1a.png\" width=\"785\" height=\"1219\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b7a\/852\/deb\/b7a852debd95269f73d4d5202f4ddf1a.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u041d\u0430\u00a0\u0434\u0430\u043d\u043d\u043e\u043c \u0433\u0440\u0430\u0444\u0438\u043a\u0435 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0438 \u0443\u043f\u043e\u0440\u044f\u0434\u043e\u0447\u0435\u043d\u044b \u043f\u043e\u00a0\u0432\u0430\u0436\u043d\u043e\u0441\u0442\u0438. \u041c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e\u00a0\u043f\u0440\u0438\u0437\u043d\u0430\u043a VIP \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0435\u00a0\u0432\u043b\u0438\u044f\u0435\u0442 \u043d\u0430\u00a0\u0446\u0435\u043b\u0435\u0432\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0438\u0441\u043a\u043b\u044e\u0447\u0443 \u0435\u0433\u043e.<\/p>\n<p>\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0438:<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td data-colwidth=\"237\" width=\"237\">\n<p align=\"left\">\u00a0<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u041a\u043e\u043b-\u0432\u043e \u043f\u0440\u043e\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439<\/p>\n<\/td>\n<td>\n<p align=\"center\">% \u043f\u0440\u043e\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"237\" width=\"237\">\n<p align=\"left\">HomePlanet<\/p>\n<\/td>\n<td>\n<p align=\"center\">201<\/p>\n<\/td>\n<td>\n<p align=\"center\">2.312205<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"237\" width=\"237\">\n<p align=\"left\">CryoSleep<\/p>\n<\/td>\n<td>\n<p align=\"center\">217<\/p>\n<\/td>\n<td>\n<p align=\"center\">2.496261<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"237\" width=\"237\">\n<p align=\"left\">Destination<\/p>\n<\/td>\n<td>\n<p align=\"center\">182<\/p>\n<\/td>\n<td>\n<p align=\"center\">2.093639<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"237\" width=\"237\">\n<p align=\"left\">Age<\/p>\n<\/td>\n<td>\n<p align=\"center\">179<\/p>\n<\/td>\n<td>\n<p align=\"center\">2.059128<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"237\" width=\"237\">\n<p align=\"left\">RoomService<\/p>\n<\/td>\n<td>\n<p align=\"center\">181<\/p>\n<\/td>\n<td>\n<p align=\"center\">2.082135<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"237\" width=\"237\">\n<p align=\"left\">FoodCourt<\/p>\n<\/td>\n<td>\n<p align=\"center\">183<\/p>\n<\/td>\n<td>\n<p align=\"center\">2.105142<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"237\" width=\"237\">\n<p align=\"left\">ShoppingMall<\/p>\n<\/td>\n<td>\n<p align=\"center\">208<\/p>\n<\/td>\n<td>\n<p align=\"center\">2.392730<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"237\" width=\"237\">\n<p align=\"left\">Spa<\/p>\n<\/td>\n<td>\n<p align=\"center\">183<\/p>\n<\/td>\n<td>\n<p align=\"center\">2.105142<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"237\" width=\"237\">\n<p align=\"left\">VRDeck<\/p>\n<\/td>\n<td>\n<p align=\"center\">188<\/p>\n<\/td>\n<td>\n<p align=\"center\">2.162660<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"237\" width=\"237\">\n<p align=\"left\">GroupId<\/p>\n<\/td>\n<td>\n<p align=\"center\">0<\/p>\n<\/td>\n<td>\n<p align=\"center\">0.000000<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"237\" width=\"237\">\n<p align=\"left\">Deck<\/p>\n<\/td>\n<td>\n<p align=\"center\">199<\/p>\n<\/td>\n<td>\n<p align=\"center\">2.289198<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"237\" width=\"237\">\n<p align=\"left\">Side<\/p>\n<\/td>\n<td>\n<p align=\"center\">199<\/p>\n<\/td>\n<td>\n<p align=\"center\">2.289198<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u0414\u043b\u044f\u00a0\u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u044e \u043d\u0435\u00a0\u043e\u0431\u0440\u0430\u0449\u0430\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u043d\u0430\u00a0\u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0438. \u0412\u00a0\u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u0434\u043b\u044f\u00a0\u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u0447\u0438 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0431\u0443\u0434\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u044c \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u043d\u043e\u0433\u043e \u0431\u0443\u0441\u0442\u0438\u043d\u0433\u0430 <a href=\"https:\/\/catboost.ai\/en\/docs\/\" rel=\"noopener noreferrer nofollow\"><strong>Catboost<\/strong><\/a>. \u042d\u0442\u0430 \u043c\u043e\u0434\u0435\u043b\u044c \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441\u00a0\u0434\u0430\u043d\u043d\u044b\u043c\u0438, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u043c\u0438 \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u043b\u044f\u00a0\u043d\u0430\u0447\u0430\u043b\u0430 \u043c\u043e\u0436\u043d\u043e \u043d\u0435\u00a0\u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u043f\u0440\u043e\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f.<\/p>\n<p>\u0417\u0430\u043a\u043e\u0434\u0438\u0440\u0443\u044e \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0441\u00a0\u043f\u043e\u043c\u043e\u0449\u044c\u044e one\u2011hot \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f:<\/p>\n<pre><code class=\"python\">X_train = pd.get_dummies(X_train) X_test = pd.get_dummies(X_test)<\/code><\/pre>\n<p>\u041e\u0431\u0443\u0447\u0443 \u043c\u043e\u0434\u0435\u043b\u044c \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442: Score = 0.79\u00a0261\u00a0(\u0442\u043e\u043f 1262).<\/p>\n<p>\u0423\u043b\u0443\u0447\u0448\u0438\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043c\u043e\u0436\u043d\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c\u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u043c\u0438. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <\/p>\n<ul>\n<li>\n<p>\u043f\u043e\u0434\u043a\u0440\u0443\u0442\u0438\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043c\u043e\u0434\u0435\u043b\u0438;<\/p>\n<\/li>\n<li>\n<p>\u043f\u0440\u043e\u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0438 \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438. \u0417\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043f\u0443\u0441\u0442\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u0447\u0442\u043e\u0431\u044b \u043d\u0435\u00a0\u043f\u043e\u0442\u0435\u0440\u044f\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e.<\/p>\n<\/li>\n<\/ul>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u044e \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0441\u043f\u043e\u0441\u043e\u0431.<\/p>\n<p>\u0414\u043b\u044f\u00a0\u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u044e \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043f\u0443\u0441\u0442\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u043d\u0435\u00a0\u043f\u0440\u043e\u0432\u043e\u0434\u044f \u0430\u043d\u0430\u043b\u0438\u0437 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432. \u0414\u043b\u044f\u00a0\u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432 \u0437\u0430\u043f\u043e\u043b\u043d\u044e \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0438 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u044e\u0449\u0438\u043c\u0441\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c, \u0430\u00a0\u0434\u043b\u044f\u00a0\u0447\u0438\u0441\u043b\u043e\u0432\u044b\u0445 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432 \u0437\u0430\u043f\u043e\u043b\u043d\u044e \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0438 \u043c\u0435\u0434\u0438\u0430\u043d\u0430\u043c\u0438.<\/p>\n<pre><code class=\"python\">from sklearn.impute import SimpleImputer  numerical_columns = X_train.describe().columns categorical_columns = set(X_train.columns) - set(numerical_columns)  for col in numerical_columns:     si = SimpleImputer(strategy='median')     X_train[col] = si.fit_transform(X_train[col].values.reshape(-1, 1))     X_test[col] = si.fit_transform(X_test[col].values.reshape(-1, 1))      for col in categorical_columns:     si = SimpleImputer(strategy='most_frequent')     X_train[col] = si.fit_transform(X_train[col].values.reshape(-1, 1))     X_test[col] = si.fit_transform(X_test[col].values.reshape(-1, 1))<\/code><\/pre>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u044e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442: Score = 0.79\u00a0401. \u041f\u043e\u00a0\u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044e \u0441\u00a0\u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u043c\u00a0\u2014 \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u0435 \u043c\u0435\u0442\u0440\u0438\u043a\u0438 \u043d\u0430 0.0014.<\/p>\n<p>\u041f\u043e\u043f\u0440\u043e\u0431\u0443\u044e \u0443\u043b\u0443\u0447\u0448\u0438\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442, \u043f\u0440\u043e\u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0432 \u0434\u0430\u043d\u043d\u044b\u0435.<\/p>\n<p>\u0414\u043b\u044f\u00a0\u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u044e \u043d\u0430\u00a0\u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0447\u0438\u0441\u043b\u043e\u0432\u044b\u0445 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/864\/fd3\/106\/864fd31064d29babf9282d3ecc5480a8.png\" width=\"800\" height=\"600\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/864\/fd3\/106\/864fd31064d29babf9282d3ecc5480a8.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0421\u0442\u043e\u0438\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e\u00a0\u043c\u0435\u0442\u043e\u0434\u044b \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u043d\u043e\u0433\u043e \u0431\u0443\u0441\u0442\u0438\u043d\u0433\u0430 \u0441\u043b\u0430\u0431\u043e \u0447\u0443\u0432\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u044b \u043a\u00a0\u0432\u044b\u0431\u0440\u043e\u0441\u0430\u043c, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u043e\u0436\u043d\u043e \u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043a\u0430\u043a\u00a0\u0435\u0441\u0442\u044c.<\/p>\n<p>\u0417\u0430\u0431\u0435\u0433\u0430\u044f \u0432\u043f\u0435\u0440\u0451\u0434, \u0441\u043a\u0430\u0436\u0443, \u0447\u0442\u043e\u00a0\u0434\u043b\u044f\u00a0\u0431\u043e\u0440\u044c\u0431\u044b \u0441\u00a0\u0430\u043d\u043e\u043c\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438 \u044f \u043f\u043e\u043f\u044b\u0442\u0430\u043b\u0441\u044f \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u044b:<\/p>\n<ul>\n<li>\n<p>\u0423\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u0430\u043d\u043e\u043c\u0430\u043b\u044c\u043d\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 (\u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043f\u043e\u0442\u0435\u0440\u044f\u043b \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e, \u0438\u0437\u2011\u0437\u0430 \u0447\u0435\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043c\u0435\u0442\u0440\u0438\u043a\u0438 \u0443\u0445\u0443\u0434\u0448\u0438\u043b\u043e\u0441\u044c);<\/p>\n<\/li>\n<li>\n<p>\u0417\u0430\u043c\u0435\u043d\u0430 \u0430\u043d\u043e\u043c\u0430\u043b\u044c\u043d\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043f\u0440\u0438\u00a0\u043f\u043e\u043c\u043e\u0449\u0438 \u0440\u0430\u0441\u0447\u0451\u0442\u0430 1.5\u00a0\u043c\u0435\u0436\u043a\u0432\u0430\u0440\u0442\u0438\u043b\u044c\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u043c\u0430\u0445\u0430 (IQR) \u0438 \u0437\u0430\u043c\u0435\u043d\u044b \u0430\u043d\u043e\u043c\u0430\u043b\u044c\u043d\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043d\u0430 Q1 \u2013 1.5*IQR \u0438 Q3 + 1.5*IQR. (\u043c\u0435\u0442\u0440\u0438\u043a\u0430 \u0442\u0430\u043a\u0436\u0435 \u0441\u043d\u0438\u0437\u0438\u043b\u0430\u0441\u044c).<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u043e\u00a0\u0433\u0440\u0430\u0444\u0438\u043a\u0430\u043c \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e\u00a0\u0434\u043b\u044f\u00a0\u0432\u0441\u0435\u0445 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0439 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432 \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u043d\u0430 \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0430\u0441\u0438\u043c\u043c\u0435\u0442\u0440\u0438\u044f (\u00ab\u043f\u0435\u0440\u0435\u043a\u043e\u0441\u00bb \u0432\u043b\u0435\u0432\u043e). \u0414\u043b\u044f\u00a0\u0442\u0430\u043a\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u043c\u043e\u0436\u043d\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043c\u0435\u0442\u043e\u0434\u043e\u043c <a href=\"https:\/\/www.ncbi.nlm.nih.gov\/pmc\/articles\/PMC4120293\/\" rel=\"noopener noreferrer nofollow\"><strong>log transform<\/strong><\/a> (\u043b\u043e\u0433\u0430\u0440\u0438\u0444\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f). \u0421\u00a0\u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u0434\u043e\u0441\u0442\u0438\u0447\u044c \u043b\u0443\u0447\u0448\u0435\u0433\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430.<\/p>\n<p>\u041d\u0430\u00a0\u0433\u0440\u0430\u0444\u0438\u043a\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e, \u043a\u0430\u043a\u00a0\u0441\u00a0\u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u043d\u0438\u0432\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u044b\u0431\u0440\u043e\u0441\u044b.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/634\/380\/0ff\/6343800ff033d7faaeebbd7aca136527.png\" width=\"1548\" height=\"525\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/634\/380\/0ff\/6343800ff033d7faaeebbd7aca136527.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u041f\u043e\u0441\u043b\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043b\u043e\u0433\u0430\u0440\u0438\u0444\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432 \u0441\u0442\u0430\u043b\u0438 \u0438\u043c\u0435\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0432\u0438\u0434:   <\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/698\/6ac\/f00\/6986acf00ca43d742dbcfbc4f9c3d0cf.png\" width=\"800\" height=\"1600\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/698\/6ac\/f00\/6986acf00ca43d742dbcfbc4f9c3d0cf.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u044e \u043d\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432 \u043f\u0440\u0438 CryoSleep = True:   <\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td>\n<p align=\"center\">\u00a0<\/p>\n<\/td>\n<td>\n<p align=\"center\">RoomService<\/p>\n<\/td>\n<td>\n<p align=\"center\">FoodCourt<\/p>\n<\/td>\n<td>\n<p align=\"center\">ShoppingMall<\/p>\n<\/td>\n<td>\n<p align=\"center\">Spa<\/p>\n<\/td>\n<td>\n<p align=\"center\">VRDeck<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"center\">count<\/p>\n<\/td>\n<td>\n<p align=\"center\">2969.0<\/p>\n<\/td>\n<td>\n<p align=\"center\">2967.0<\/p>\n<\/td>\n<td>\n<p align=\"center\">2941.0<\/p>\n<\/td>\n<td>\n<p align=\"center\">2972.0<\/p>\n<\/td>\n<td>\n<p align=\"center\">2975.0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"center\">mean<\/p>\n<\/td>\n<td>\n<p align=\"center\"><strong>0.0<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"center\"><strong>0.0<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"center\"><strong>0.0<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"center\"><strong>0.0<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"center\"><strong>0.0<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"center\">std<\/p>\n<\/td>\n<td>\n<p align=\"center\"><strong>0.0<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"center\"><strong>0.0<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"center\"><strong>0.0<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"center\"><strong>0.0<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"center\"><strong>0.0<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"center\">min<\/p>\n<\/td>\n<td>\n<p align=\"center\"><strong>0.0<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"center\"><strong>0.0<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"center\"><strong>0.0<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"center\"><strong>0.0<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"center\"><strong>0.0<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"center\">25%<\/p>\n<\/td>\n<td>\n<p align=\"center\"><strong>0.0<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"center\"><strong>0.0<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"center\"><strong>0.0<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"center\"><strong>0.0<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"center\"><strong>0.0<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"center\">50%<\/p>\n<\/td>\n<td>\n<p align=\"center\"><strong>0.0<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"center\"><strong>0.0<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"center\"><strong>0.0<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"center\"><strong>0.0<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"center\"><strong>0.0<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"center\">75%<\/p>\n<\/td>\n<td>\n<p align=\"center\"><strong>0.0<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"center\"><strong>0.0<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"center\"><strong>0.0<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"center\"><strong>0.0<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"center\"><strong>0.0<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"center\">max<\/p>\n<\/td>\n<td>\n<p align=\"center\"><strong>0.0<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"center\"><strong>0.0<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"center\"><strong>0.0<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"center\"><strong>0.0<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"center\"><strong>0.0<\/strong><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u041c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0432\u044b\u0432\u043e\u0434 \u043e\u00a0\u0442\u043e\u043c, \u0447\u0442\u043e\u00a0\u0435\u0441\u043b\u0438 CryoSleep = True, \u0442\u043e \u0434\u043b\u044f\u00a0\u0432\u0441\u0435\u0445 \u0437\u0430\u043f\u0438\u0441\u0435\u0439 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432 RoomService, FoodCourt, ShoppingMall, Spa, VRDeck = 0. \u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0435\u0441\u043b\u0438 \u0445\u043e\u0442\u044f\u00a0\u0431\u044b \u043e\u0434\u043d\u043e \u0438\u0437\u00a0\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432 RoomService, FoodCourt, ShoppingMall, Spa, VRDeck \u043d\u0435\u00a0\u0440\u0430\u0432\u043d\u043e \u043d\u0443\u043b\u044e, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0447\u0438\u0442\u0430\u0442\u044c, \u0447\u0442\u043e\u00a0CryoSleep = False.<\/p>\n<p>\u041d\u0430\u00a0\u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0438\u0438 \u044d\u0442\u0438\u0445 \u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u0439, \u0437\u0430\u043f\u043e\u043b\u043d\u044e \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0438 \u0432\u00a0\u043f\u043e\u043b\u0435 CryoSleep:<\/p>\n<pre><code class=\"python\">def impute_cryo_sleep(df: pd.DataFrame) -> None:     df.loc[         ((df['RoomService'] == 0.0) | df['RoomService'].isnull()) &amp;          ((df['FoodCourt'] == 0.0) | df['FoodCourt'].isnull()) &amp;          ((df['ShoppingMall'] == 0.0) | df['ShoppingMall'].isnull()) &amp;          ((df['Spa'] == 0.0) | df['Spa'].isnull()) &amp;         ((df['VRDeck'] == 0.0) | df['VRDeck'].isnull()) &amp;         (df['CryoSleep'].isnull()),          'CryoSleep'     ] = True          df.loc[         ((df['RoomService'] > 0.0) |          (df['FoodCourt'] > 0.0) |          (df['ShoppingMall'] > 0.0) |          (df['Spa'] > 0.0) |         (df['VRDeck'] > 0.0)) &amp; (df['CryoSleep'].isnull()),          'CryoSleep'     ] = False  impute_cryo_sleep(X_train) impute_cryo_sleep(X_test) <\/code><\/pre>\n<p>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u044e \u043d\u0430\u00a0\u0434\u0430\u043d\u043d\u044b\u0435 \u0432\u00a0\u0440\u0430\u0437\u0440\u0435\u0437\u0435 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432 HomePlanet\u00a0\u2014 Deck:<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td data-colwidth=\"106\" width=\"106\">\n<p align=\"center\"><strong>Deck<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"center\">A<\/p>\n<\/td>\n<td>\n<p align=\"center\">B<\/p>\n<\/td>\n<td data-colwidth=\"75\" width=\"75\">\n<p align=\"center\">C<\/p>\n<\/td>\n<td>\n<p align=\"center\">D<\/p>\n<\/td>\n<td data-colwidth=\"76\" width=\"76\">\n<p align=\"center\">E<\/p>\n<\/td>\n<td data-colwidth=\"75\" width=\"75\">\n<p align=\"center\">F<\/p>\n<\/td>\n<td data-colwidth=\"72\" width=\"72\">\n<p align=\"center\">G<\/p>\n<\/td>\n<td>\n<p align=\"center\">T<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"106\" width=\"106\">\n<p align=\"center\"><strong>HomePlanet<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"center\">\u00a0<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"75\" width=\"75\">\n<p align=\"center\">\u00a0<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"76\" width=\"76\">\n<p align=\"center\">\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"75\" width=\"75\">\n<p align=\"center\">\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"72\" width=\"72\">\n<p align=\"center\">\u00a0<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u00a0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"106\" width=\"106\">\n<p align=\"center\">Earth<\/p>\n<\/td>\n<td>\n<p align=\"center\">0.0<\/p>\n<\/td>\n<td>\n<p align=\"center\">0.0<\/p>\n<\/td>\n<td data-colwidth=\"75\" width=\"75\">\n<p align=\"center\">0.0<\/p>\n<\/td>\n<td>\n<p align=\"center\">0.0<\/p>\n<\/td>\n<td data-colwidth=\"76\" width=\"76\">\n<p align=\"center\">395.0<\/p>\n<\/td>\n<td data-colwidth=\"75\" width=\"75\">\n<p align=\"center\">1614.0<\/p>\n<\/td>\n<td data-colwidth=\"72\" width=\"72\">\n<p align=\"center\"><strong>2498.0<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"center\">0.0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"106\" width=\"106\">\n<p align=\"center\">Europa<\/p>\n<\/td>\n<td>\n<p align=\"center\"><strong>252.0<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"center\"><strong>766.0<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"75\" width=\"75\">\n<p align=\"center\"><strong>734.0<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"center\">186.0<\/p>\n<\/td>\n<td data-colwidth=\"76\" width=\"76\">\n<p align=\"center\">128.0<\/p>\n<\/td>\n<td data-colwidth=\"75\" width=\"75\">\n<p align=\"center\">0.0<\/p>\n<\/td>\n<td data-colwidth=\"72\" width=\"72\">\n<p align=\"center\">0.0<\/p>\n<\/td>\n<td>\n<p align=\"center\"><strong>4.0<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"106\" width=\"106\">\n<p align=\"center\">Mars<\/p>\n<\/td>\n<td>\n<p align=\"center\">0.0<\/p>\n<\/td>\n<td>\n<p align=\"center\">0.0<\/p>\n<\/td>\n<td data-colwidth=\"75\" width=\"75\">\n<p align=\"center\">0.0<\/p>\n<\/td>\n<td>\n<p align=\"center\">282.0<\/p>\n<\/td>\n<td data-colwidth=\"76\" width=\"76\">\n<p align=\"center\">330.0<\/p>\n<\/td>\n<td data-colwidth=\"75\" width=\"75\">\n<p align=\"center\">1110.0<\/p>\n<\/td>\n<td data-colwidth=\"72\" width=\"72\">\n<p align=\"center\">0.0<\/p>\n<\/td>\n<td>\n<p align=\"center\">0.0<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u041c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e\u00a0\u043d\u0430\u00a0\u043f\u0430\u043b\u0443\u0431\u0430\u0445 (Deck) A, B, C, T \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0430\u0441\u0441\u0430\u0436\u0438\u0440\u044b \u0441\u00a0\u043f\u043b\u0430\u043d\u0435\u0442\u044b \u0415\u0432\u0440\u043e\u043f\u0430. \u0410\u00a0\u043d\u0430\u00a0\u043f\u0430\u043b\u0443\u0431\u0435 G \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0430\u0441\u0441\u0430\u0436\u0438\u0440\u044b \u0441\u00a0\u043f\u043b\u0430\u043d\u0435\u0442\u044b \u0417\u0435\u043c\u043b\u044f. \u0414\u043b\u044f\u00a0\u043f\u0430\u0441\u0441\u0430\u0436\u0438\u0440\u043e\u0432 \u0441\u00a0\u041c\u0430\u0440\u0441\u0430 \u043d\u0435\u043b\u044c\u0437\u044f \u043e\u0434\u043d\u043e\u0437\u043d\u0430\u0447\u043d\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u043d\u0430\u00a0\u043a\u0430\u043a\u043e\u0439 \u043f\u0430\u043b\u0443\u0431\u0435 \u043e\u043d\u0438 \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u044b.<\/p>\n<p>\u041d\u0430\u00a0\u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0438\u0438 \u044d\u0442\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0437\u0430\u043f\u043e\u043b\u043d\u044e \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0438 \u0434\u043b\u044f\u00a0\u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0430 HomePlanet:<\/p>\n<pre><code class=\"python\">def impute_home_planet_by_deck(df: pd.DataFrame) -> None:     df.loc[         (df['Deck'] == 'G') &amp; (df['HomePlanet'].isnull()),          'HomePlanet'     ] = 'Earth'          europa_decks = ['A', 'B', 'C', 'T']     df.loc[         (df['Deck'].isin(europa_decks)) &amp; (df['HomePlanet'].isnull()),          'HomePlanet'     ] = 'Europa'           impute_home_planet_by_deck(X_train) impute_home_planet_by_deck(X_test) <\/code><\/pre>\n<p>\u0418\u0441\u0445\u043e\u0434\u044f \u0438\u0437 \u0440\u0430\u043d\u0435\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0432 \u0440\u0430\u0437\u0440\u0435\u0437\u0435 HomePlanet \u2013 Deck, \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f Deck \u043f\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e HomePlanet, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u043d\u043e\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435:<\/p>\n<pre><code class=\"python\">home_planet_deck = X_train.groupby(     ['HomePlanet', 'Deck'] ).size().unstack().fillna(0)  earth = home_planet_deck.loc['Earth'] earth_proba = list(earth \/ sum(earth))  europa = home_planet_deck.loc['Europa'] europa_proba = list(europa \/ sum(europa))  mars = home_planet_deck.loc['Mars'] mars_proba = list(mars \/ sum(mars))  decks = X_train['Deck'].unique() deck_values = sorted(decks[~pd.isnull(decks)]) planet_proba = dict(     zip(['Earth', 'Mars', 'Europa'], [earth_proba, mars_proba, europa_proba]) )  # Idempotence np.random.seed(0)  def impute_deck_by_home_planet(df: pd.DataFrame) -> None:     for planet in planet_proba.keys():         planet_null_decks_shape = df.loc[             (df['HomePlanet'] == planet) &amp; (df['Deck'].isnull()),              'Deck'         ].shape[0]          df.loc[             (df['HomePlanet'] == planet) &amp; (df['Deck'].isnull()),              'Deck'         ] = np.random.choice(             deck_values,             planet_null_decks_shape,             p=planet_proba[planet]         )                   impute_deck_by_home_planet(X_train) impute_deck_by_home_planet(X_test) <\/code><\/pre>\n<p>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u044e \u043d\u0430 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0432\u043e\u0437\u0440\u0430\u0441\u0442\u043e\u0432 \u043d\u0430 \u043f\u043b\u0430\u043d\u0435\u0442\u0430\u0445:   <\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/496\/0b8\/903\/4960b8903a1cf131db8b0364db66bc7b.png\" width=\"774\" height=\"525\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/496\/0b8\/903\/4960b8903a1cf131db8b0364db66bc7b.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0417\u0430\u043f\u043e\u043b\u043d\u044e \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\u0430 Age \u043c\u0435\u0434\u0438\u0430\u043d\u043d\u044b\u043c\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438 \u043f\u043e \u043f\u043b\u0430\u043d\u0435\u0442\u0430\u043c:<\/p>\n<pre><code class=\"python\">def impute_age_by_planet(df: pd.DataFrame) -> None:     for planet in ['Europa', 'Earth', 'Mars']:         planet_median = df[df['HomePlanet'] == planet]['Age'].median()         df.loc[             (df['Age'].isnull()) &amp; (df['HomePlanet'] == planet),             'Age'         ] = planet_median   impute_age_by_planet(X_train) impute_age_by_planet(X_test) <\/code><\/pre>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u044e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442: Score = 0.79 775. \u0412\u00a0\u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0438 \u0441\u00a0\u043f\u0435\u0440\u0432\u043e\u0439 \u043f\u043e\u043f\u044b\u0442\u043a\u043e\u0439\u00a0\u2014 \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u0435 \u043d\u0430 0.5\u00a0\u043f\u0440\u043e\u0446\u0435\u043d\u0442\u0430.<\/p>\n<p>\u0412\u00a0\u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438\u00a0\u043f\u043e\u043c\u043e\u0449\u0438 \u0440\u0430\u0437\u0432\u0435\u0434\u043e\u0447\u043d\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0438 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043f\u0443\u0441\u0442\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043d\u0430\u00a0\u0435\u0433\u043e \u043e\u0441\u043d\u043e\u0432\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044f \u043d\u0430\u00a0\u043f\u043e\u043b\u043e\u0432\u0438\u043d\u0443 \u043f\u0440\u043e\u0446\u0435\u043d\u0442\u0430. \u0427\u0442\u043e, \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e, \u043d\u0435\u043f\u043b\u043e\u0445\u043e, \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u044f \u0442\u043e\u0442 \u0444\u0430\u043a\u0442, \u0447\u0442\u043e\u00a0\u0432\u00a0\u0442\u0430\u043a\u0438\u0445 \u0441\u043e\u0440\u0435\u0432\u043d\u043e\u0432\u0430\u043d\u0438\u044f\u0445 \u043a\u0430\u0436\u0434\u0430\u044f \u0434\u0435\u0441\u044f\u0442\u0430\u044f \u043f\u0440\u043e\u0446\u0435\u043d\u0442\u0430 \u043c\u0435\u0442\u0440\u0438\u043a\u0438 \u043c\u043e\u0436\u0435\u0442 \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u043e\u0432\u044b\u0441\u0438\u0442\u044c \u043c\u0435\u0441\u0442\u043e \u0432\u00a0\u0440\u0435\u0439\u0442\u0438\u043d\u0433\u0435.<\/p>\n<p>\u041f\u043e\u043f\u0440\u043e\u0431\u0443\u044e \u0443\u043b\u0443\u0447\u0448\u0438\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u044c \u043f\u0440\u0438\u00a0\u043f\u043e\u043c\u043e\u0449\u0438 \u043f\u043e\u0434\u0431\u043e\u0440\u0430 \u0433\u0438\u043f\u0435\u0440\u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u043c\u043e\u0434\u0435\u043b\u0438. \u0414\u043b\u044f\u00a0\u044d\u0442\u043e\u0433\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0441\u044c \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u043e\u043c <a href=\"https:\/\/optuna.readthedocs.io\/en\/stable\/index.html\" rel=\"noopener noreferrer nofollow\">Optuna<\/a>.<\/p>\n<p>Optuna \u043f\u043e\u0434\u043e\u0431\u0440\u0430\u043b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b:<\/p>\n<ul>\n<li>\n<p>objective (\u0424\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u043e\u0448\u0438\u0431\u043a\u0438): Logloss <\/p>\n<\/li>\n<li>\n<p>colsample_bylevel (\u041f\u0440\u043e\u0446\u0435\u043d\u0442 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0445 \u043f\u0440\u0438\u00a0\u043a\u0430\u0436\u0434\u043e\u043c \u0432\u044b\u0431\u043e\u0440\u0435 \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u044f): 0.089 <\/p>\n<\/li>\n<li>\n<p>depth (\u0433\u043b\u0443\u0431\u0438\u043d\u0430 \u0434\u0435\u0440\u0435\u0432\u0430): 11 <\/p>\n<\/li>\n<li>\n<p>boosting_type (\u0441\u0445\u0435\u043c\u0430 \u0431\u0443\u0441\u0442\u0438\u043d\u0433\u0430): Ordered <\/p>\n<\/li>\n<li>\n<p>bootstrap_type (\u0442\u0438\u043f \u0431\u0443\u0441\u0442\u0440\u0430\u043f\u0430): Bernoulli <\/p>\n<\/li>\n<\/ul>\n<p>\u041e\u0431\u0443\u0447\u0443 \u043c\u043e\u0434\u0435\u043b\u044c \u0441\u00a0\u043f\u043e\u0434\u043e\u0431\u0440\u0430\u043d\u043d\u044b\u043c\u0438 \u0433\u0438\u043f\u0435\u0440\u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438 \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442: Score = 0.80\u00a0804\u00a0(\u0442\u043e\u043f 190). <\/p>\n<p>\u0412\u00a0\u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043f\u0440\u0438\u00a0\u043f\u043e\u043c\u043e\u0449\u0438 \u043f\u043e\u0434\u0431\u043e\u0440\u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u0443\u043b\u0443\u0447\u0448\u0438\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043c\u0435\u0442\u0440\u0438\u043a\u0438 \u0431\u043e\u043b\u0435\u0435 \u0447\u0435\u043c \u043d\u0430\u00a0\u043e\u0434\u0438\u043d \u043f\u0440\u043e\u0446\u0435\u043d\u0442 \u0438 \u043f\u0435\u0440\u0435\u0448\u0430\u0433\u043d\u0443\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0438\u0442\u043e\u0433\u043e\u0432\u043e\u0433\u043e Score \u0432 0.80.<\/p>\n<p>\u041a\u0430\u043a\u0438\u0435 \u0438\u0434\u0435\u0438 \u0434\u043b\u044f\u00a0\u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u044f \u043d\u0430\u00a0\u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0432\u0438\u0436\u0443:<\/p>\n<ul>\n<li>\n<p>\u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0432\u044b\u0434\u0435\u043b\u0438\u0442\u044c \u043d\u043e\u0432\u044b\u0435 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0438 \u043d\u0430\u00a0\u043e\u0441\u043d\u043e\u0432\u0435 \u0438\u043c\u0435\u044e\u0449\u0438\u0445\u0441\u044f;<\/p>\n<\/li>\n<li>\n<p>\u043f\u043e\u043f\u044b\u0442\u0430\u0442\u044c\u0441\u044f \u043d\u0430\u0439\u0442\u0438 \u0437\u0430\u043a\u043e\u043d\u043e\u043c\u0435\u0440\u043d\u043e\u0441\u0442\u0438 \u0432\u00a0\u0434\u0440\u0443\u0433\u0438\u0445 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0430\u0445;<\/p>\n<\/li>\n<li>\n<p>\u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0434\u0440\u0443\u0433\u0438\u0435 ML\u2011\u043c\u043e\u0434\u0435\u043b\u0438.<\/p>\n<\/li>\n<\/ul>\n<p>\u0415\u0441\u043b\u0438 \u0443\u00a0\u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u0438\u0434\u0435\u0438 \u043f\u043e\u00a0\u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044e, \u043f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u0435\u0441\u044c \u0438\u043c\u0438 \u0432\u00a0\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445.<\/p>\n<p>\u0421\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 <a href=\"https:\/\/www.kaggle.com\/code\/kirilltobola\/space-titanic-ru\/\" rel=\"noopener noreferrer nofollow\">kaggle<\/a>.<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p> <!----> <!----><\/div>\n<p> <!----> <!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/719206\/\"> https:\/\/habr.com\/ru\/post\/719206\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041f\u0440\u0438\u0432\u0435\u0442, \u0425\u0430\u0431\u0440! \u041c\u0435\u043d\u044f \u0437\u043e\u0432\u0443\u0442 \u041a\u0438\u0440\u0438\u043b\u043b \u0422\u043e\u0431\u043e\u043b\u0430, \u044f Data Scientist \u0438 \u0443\u0447\u0430\u0441\u0442\u043d\u0438\u043a <a href=\"https:\/\/newtechaudit.ru\/\" rel=\"noopener noreferrer nofollow\"><u>\u043f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u0430 NTA.<\/u><\/a><\/p>\n<p>\u0414\u043e\u0431\u0440\u043e \u043f\u043e\u0436\u0430\u043b\u043e\u0432\u0430\u0442\u044c \u0432\u00a0\u0433\u043e\u0434 2912, \u0433\u0434\u0435 \u0432\u0430\u0448\u0438 DS \u043d\u0430\u0432\u044b\u043a\u0438 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u044f\u0442\u0441\u044f \u0434\u043b\u044f\u00a0\u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043a\u043e\u0441\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0437\u0430\u0433\u0430\u0434\u043a\u0438. \u041c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0441\u00a0\u043a\u043e\u0440\u0430\u0431\u043b\u044f \u043d\u0430\u00a0\u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0438 4\u00a0\u0441\u0432\u0435\u0442\u043e\u0432\u044b\u0445 \u043b\u0435\u0442, \u0438 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043f\u043b\u043e\u0445\u043e.<\/p>\n<p>\u041a\u0440\u0435\u0439\u0441\u0435\u0440 \u0422\u0438\u0442\u0430\u043d\u0438\u043a\u00a0\u2014 \u043c\u0435\u0436\u0433\u0430\u043b\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043f\u0430\u0441\u0441\u0430\u0436\u0438\u0440\u0441\u043a\u0438\u0439 \u043b\u0430\u0439\u043d\u0435\u0440 \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u043b\u0441\u044f \u0432\u00a0\u043f\u0443\u0442\u044c \u043e\u043a\u043e\u043b\u043e \u043c\u0435\u0441\u044f\u0446\u0430 \u043d\u0430\u0437\u0430\u0434. \u041f\u043e\u0447\u0442\u0438 13\u00a0000\u00a0\u043f\u0430\u0441\u0441\u0430\u0436\u0438\u0440\u043e\u0432 \u043d\u0430\u0445\u043e\u0434\u0438\u043b\u0438\u0441\u044c \u043d\u0430\u00a0\u0431\u043e\u0440\u0442\u0443. \u0421\u0443\u0434\u043d\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u043b\u043e\u0441\u044c \u0432\u00a0\u0441\u0432\u043e\u0439 \u043c\u0430\u0440\u0448\u0440\u0443\u0442, \u043f\u0435\u0440\u0435\u0432\u043e\u0437\u044f \u044d\u043c\u0438\u0433\u0440\u0430\u043d\u0442\u043e\u0432 \u0438\u0437\u00a0\u043d\u0430\u0448\u0435\u0439 \u0441\u043e\u043b\u043d\u0435\u0447\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043a\u00a0\u0442\u0440\u0435\u043c \u043d\u043e\u0432\u044b\u043c \u043d\u0435\u0434\u0430\u0432\u043d\u043e \u043e\u0441\u0432\u043e\u0435\u043d\u043d\u044b\u043c \u044d\u043a\u0437\u043e\u043f\u043b\u0430\u043d\u0435\u0442\u0430\u043c.<\/p>\n<p>\u0421\u043b\u0435\u0434\u0443\u044f \u0447\u0435\u0440\u0435\u0437 \u0410\u043b\u044c\u0444\u0430 \u0426\u0435\u043d\u0442\u0430\u0432\u0440\u0443 \u043d\u0430\u00a0\u043f\u0443\u0442\u0438 \u043a\u00a0\u043f\u0435\u0440\u0432\u043e\u043c\u0443 \u043f\u0443\u043d\u043a\u0442\u0443 \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0436\u0430\u0440\u043a\u043e\u0439 55\u00a0\u041a\u0430\u043d\u0441\u0440\u0438 \u0415, \u043a\u0440\u0435\u0439\u0441\u0435\u0440 \u0422\u0438\u0442\u0430\u043d\u0438\u043a \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0441\u044f \u0441\u00a0\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u2011\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0430\u043d\u043e\u043c\u0430\u043b\u0438\u0435\u0439, \u0441\u043a\u0440\u044b\u0432\u0448\u0435\u0439\u0441\u044f \u0437\u0430\u00a0\u043e\u0431\u043b\u0430\u043a\u043e\u043c \u043a\u043e\u0441\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043f\u044b\u043b\u0438. \u041a\u00a0\u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u043a\u0440\u0435\u0439\u0441\u0435\u0440 \u043f\u043e\u0441\u0442\u0438\u0433\u043b\u0430 \u0442\u0430\u00a0\u0436\u0435 \u0443\u0447\u0430\u0441\u0442\u044c, \u0447\u0442\u043e\u00a0\u0438 \u043e\u0434\u043d\u043e\u0438\u043c\u0435\u043d\u043d\u044b\u0439 \u043a\u043e\u0440\u0430\u0431\u043b\u044c \u0440\u043e\u0432\u043d\u043e 1000\u00a0\u043b\u0435\u0442 \u043d\u0430\u0437\u0430\u0434. \u0412\u00a0\u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u0430\u043a\u00a0\u043a\u043e\u0440\u0430\u0431\u043b\u044c \u043d\u0435\u00a0\u043f\u043e\u0441\u0442\u0440\u0430\u0434\u0430\u043b, \u043f\u043e\u0447\u0442\u0438 \u043f\u043e\u043b\u043e\u0432\u0438\u043d\u0430 \u043f\u0430\u0441\u0441\u0430\u0436\u0438\u0440\u043e\u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u043b\u0438\u0441\u044c \u0432\u00a0\u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u043e\u0435 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e.<\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u0441\u043f\u0430\u0441\u0442\u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u0438 \u0432\u0435\u0440\u043d\u0443\u0442\u044c \u043f\u043e\u0442\u0435\u0440\u044f\u043d\u043d\u044b\u0445 \u043f\u0430\u0441\u0441\u0430\u0436\u0438\u0440\u043e\u0432, \u0432\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043f\u0440\u043e\u0433\u043d\u043e\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u0442\u043e \u0438\u0437\u00a0\u043f\u0430\u0441\u0441\u0430\u0436\u0438\u0440\u043e\u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u043b\u0441\u044f \u0432\u00a0\u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u0443\u044e \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437\u00a0\u043f\u043e\u0432\u0440\u0435\u0436\u0434\u0435\u043d\u043d\u043e\u0433\u043e \u0436\u0443\u0440\u043d\u0430\u043b\u0430 \u043a\u043e\u0440\u0430\u0431\u043b\u044f. \u0417\u0430\u0434\u0430\u0447\u0430 \u043f\u043e\u043c\u043e\u0447\u044c \u0438\u043c \u0441\u043f\u0430\u0441\u0442\u0438\u0441\u044c \u0438 \u043d\u0435\u00a0\u0434\u0430\u0442\u044c \u0438\u0441\u0442\u043e\u0440\u0438\u0438 \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c\u0441\u044f \u0432\u043d\u043e\u0432\u044c\u2026 \u0425\u043e\u0442\u044f \u043c\u043e\u0436\u0435\u0442 \u0438 \u043d\u0435\u00a0\u043d\u0443\u0436\u043d\u043e \u0438 \u043f\u043e\u044f\u0432\u0438\u0442\u0441\u044f \u043d\u043e\u0432\u044b\u0439 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043d\u0435\u043f\u043b\u043e\u0445\u043e\u0439 \u0444\u0438\u043b\u044c\u043c.<\/p>\n<p><strong>Spaceship Titanic<\/strong>\u00a0\u2014 \u044d\u0442\u043e \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430 \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f, \u0430\u00a0\u0438\u043c\u0435\u043d\u043d\u043e \u0437\u0430\u0434\u0430\u0447\u0430 \u0431\u0438\u043d\u0430\u0440\u043d\u043e\u0439 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438.<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0421\u0435\u0433\u043e\u0434\u043d\u044f \u044f \u0445\u043e\u0447\u0443 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043e\u0431\u00a0\u043e\u043f\u044b\u0442\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f EDA (Exploratory Data Analysis) \u0434\u043b\u044f\u00a0\u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044f \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438 ML\u2011\u043c\u043e\u0434\u0435\u043b\u0438, \u043d\u0430\u00a0\u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0437\u0430\u0434\u0430\u0447\u0438 \u0438\u0437 <a href=\"https:\/\/www.kaggle.com\/competitions\/spaceship-titanic\/overview\" rel=\"noopener noreferrer nofollow\">\u0441\u043e\u0440\u0435\u0432\u043d\u043e\u0432\u0430\u043d\u0438\u044f Spaceship Titanic<\/a>. EDA (\u0438\u043b\u0438 \u0440\u0430\u0437\u0432\u0435\u0434\u043e\u0447\u043d\u044b\u0439 \u0430\u043d\u0430\u043b\u0438\u0437)\u00a0\u2014 \u0430\u043d\u0430\u043b\u0438\u0437 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u0441\u0432\u043e\u0439\u0441\u0442\u0432 \u0434\u0430\u043d\u043d\u044b\u0445, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0439 \u0434\u043b\u044f\u00a0\u043d\u0430\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u043e\u0431\u0449\u0438\u0445 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439. \u0421\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0435\u043c \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u0432\u0435\u0434\u043e\u0447\u043d\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u0432\u044b\u0448\u0435\u043d\u0438\u0435 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430 \u043c\u043e\u0434\u0435\u043b\u0438 \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f.<\/p>\n<p>\u0414\u043b\u044f\u00a0\u043d\u0430\u0447\u0430\u043b\u0430 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u044e \u043d\u0430\u0431\u043e\u0440 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445:<\/p>\n<ul>\n<li>\n<p>\u0420\u0430\u0437\u043c\u0435\u0440\u043d\u043e\u0441\u0442\u044c \u043e\u0431\u0443\u0447\u0430\u044e\u0449\u0435\u0439 \u0432\u044b\u0431\u043e\u0440\u043a\u0438 (8693\u00a0x 13)<\/p>\n<\/li>\n<li>\n<p>\u0420\u0430\u0437\u043c\u0435\u0440\u043d\u043e\u0441\u0442\u044c \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0439 \u0432\u044b\u0431\u043e\u0440\u043a\u0438 (4277\u00a0x 13)<\/p>\n<\/li>\n<\/ul>\n<p>\u0414\u0430\u043d\u043d\u044b\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0438:<\/p>\n<ul>\n<li>\n<p><strong>PassengerId<\/strong>\u00a0\u2014 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0434\u043b\u044f\u00a0\u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043f\u0430\u0441\u0441\u0430\u0436\u0438\u0440\u0430. \u0421\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437\u00a0\u043d\u043e\u043c\u0435\u0440\u0430 \u0433\u0440\u0443\u043f\u043f\u044b \u0438 \u043d\u043e\u043c\u0435\u0440\u0430 \u0432\u00a0\u044d\u0442\u043e\u0439 \u0433\u0440\u0443\u043f\u043f\u0435.<\/p>\n<\/li>\n<li>\n<p><strong>HomePlanet<\/strong>\u00a0\u2014 \u043f\u043b\u0430\u043d\u0435\u0442\u0430, \u0441\u00a0\u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u043b\u0441\u044f \u043f\u0430\u0441\u0441\u0430\u0436\u0438\u0440.<\/p>\n<\/li>\n<li>\n<p><strong>CryoSleep<\/strong>\u00a0\u2014 \u0438\u043d\u0434\u0438\u043a\u0430\u0442\u043e\u0440 \u043a\u0440\u0438\u043e\u0441\u043d\u0430.<\/p>\n<\/li>\n<li>\n<p><strong>Cabin<\/strong>\u00a0\u2014 \u043d\u043e\u043c\u0435\u0440 \u043a\u0430\u0431\u0438\u043d\u044b. \u0421\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437\u00a0\u043f\u0430\u043b\u0443\u0431\u044b\/\u043d\u043e\u043c\u0435\u0440\u0430\/\u0441\u0442\u043e\u0440\u043e\u043d\u044b.<\/p>\n<\/li>\n<li>\n<p><strong>Destination<\/strong>\u00a0\u2014 \u043f\u043b\u0430\u043d\u0435\u0442\u0430, \u043d\u0430\u00a0\u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043b\u0435\u0442\u0435\u043b \u043f\u0430\u0441\u0441\u0430\u0436\u0438\u0440.<\/p>\n<\/li>\n<li>\n<p><strong>Age<\/strong>\u00a0\u2014 \u0432\u043e\u0437\u0440\u0430\u0441\u0442 \u043f\u0430\u0441\u0441\u0430\u0436\u0438\u0440\u0430.<\/p>\n<\/li>\n<li>\n<p><strong>VIP<\/strong>\u00a0\u2014 \u0438\u043d\u0434\u0438\u043a\u0430\u0442\u043e\u0440, \u0437\u0430\u043f\u043b\u0430\u0442\u0438\u043b\u00a0\u043b\u0438 \u043f\u0430\u0441\u0441\u0430\u0436\u0438\u0440 \u0437\u0430\u00a0\u0412\u0418\u041f \u0441\u0435\u0440\u0432\u0438\u0441\u044b.<\/p>\n<\/li>\n<li>\n<p><strong>RoomService, FoodCourt, ShoppingMall, Spa, VRDeck<\/strong>\u00a0\u2014 \u0441\u0443\u043c\u043c\u0430, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043f\u0430\u0441\u0441\u0430\u0436\u0438\u0440 \u0437\u0430\u043f\u043b\u0430\u0442\u0438\u043b \u0437\u0430\u00a0\u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u043a\u043e\u0441\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043a\u043e\u0440\u0430\u0431\u043b\u044f.<\/p>\n<\/li>\n<li>\n<p><strong>Name<\/strong>\u00a0\u2014 \u0438\u043c\u044f \u0438 \u0444\u0430\u043c\u0438\u043b\u0438\u044f \u043f\u0430\u0441\u0441\u0430\u0436\u0438\u0440\u0430.<\/p>\n<\/li>\n<li>\n<p><strong>Transported<\/strong>\u00a0\u2014 \u0446\u0435\u043b\u0435\u0432\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f.<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u0435\u0440\u0432\u044b\u043c \u0434\u0435\u043b\u043e\u043c \u0434\u0435\u043a\u043e\u043c\u043f\u043e\u0437\u0438\u0440\u0443\u044e \u0441\u043e\u0441\u0442\u0430\u0432\u043d\u044b\u0435 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0438 \u0438 \u0443\u0431\u0435\u0440\u0443 \u043d\u0435\u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0432\u043d\u044b\u0435:<\/p>\n<pre><code class=\"python\">def split_feature(feature: str, new_features: list, sep: str) -> None:     X_train[new_features] = X_train[feature].str.split(sep, expand=True)     X_test[new_features] = X_test[feature].str.split(sep, expand=True)  def drop_features(features: list) -> None:     X_train.drop(features, axis=1, inplace=True)     X_test.drop(features, axis=1, inplace=True)       def cast_feature(feature: str, cast: str) -> None:     X_train[feature] = X_train[feature].astype(cast)     X_test[feature] = X_test[feature].astype(cast)       split_feature('PassengerId', ['GroupId', 'IdWithinGroup'], '_') split_feature('Cabin', ['Deck', 'Num', 'Side'], '\/')  drop_features(['Name', 'PassengerId', 'Cabin', 'IdWithinGroup', 'VIP', 'Num'])  for feature in ['GroupId']:     cast_feature(feature, 'float') <\/code><\/pre>\n<p>\u042f \u0440\u0435\u0448\u0438\u043b \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0438: <\/p>\n<ul>\n<li>\n<p>Name (\u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u0441\u00a0\u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043d\u0435\u0433\u043e \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0438);<\/p>\n<\/li>\n<li>\n<p>IdWithinGroup (\u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0432\u043d\u0443\u0442\u0440\u0438 \u0433\u0440\u0443\u043f\u043f\u044b, \u043d\u0435\u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0432\u043d\u044b\u0439);<\/p>\n<\/li>\n<li>\n<p>Num (\u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u043d\u0438\u043c\u0430\u044e, \u043f\u043e\u00a0\u043a\u0430\u043a\u043e\u043c\u0443 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0443 \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0438).<\/p>\n<\/li>\n<\/ul>\n<p>\u0414\u043b\u044f\u00a0\u043d\u0430\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u043d\u0435\u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0432\u043d\u044b\u0445 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432 \u044f \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0441\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439 <a href=\"https:\/\/shap.readthedocs.io\/en\/latest\/index.html\" rel=\"noopener noreferrer nofollow\">SHAP<\/a>. \u0414\u0430\u043d\u043d\u0430\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u043e\u0446\u0435\u043d\u0438\u0432\u0430\u0435\u0442 \u0432\u0430\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432 \u043f\u0440\u0438\u00a0\u043f\u043e\u043c\u043e\u0449\u0438 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f <a href=\"https:\/\/ru.wikipedia.org\/wiki\/%D0%92%D0%B5%D0%BA%D1%82%D0%BE%D1%80_%D0%A8%D0%B5%D0%BF%D0%BB%D0%B8\" rel=\"noopener noreferrer nofollow\"><em>\u0432\u0435\u043a\u0442\u043e\u0440\u0430 \u0428\u0435\u043f\u043b\u0438<\/em><\/a>. \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043e\u0446\u0435\u043d\u043a\u0438 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432 \u0432\u00a0\u0432\u0438\u0434\u0435 \u0433\u0440\u0430\u0444\u0438\u043a\u0430: <\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u041d\u0430\u00a0\u0434\u0430\u043d\u043d\u043e\u043c \u0433\u0440\u0430\u0444\u0438\u043a\u0435 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0438 \u0443\u043f\u043e\u0440\u044f\u0434\u043e\u0447\u0435\u043d\u044b \u043f\u043e\u00a0\u0432\u0430\u0436\u043d\u043e\u0441\u0442\u0438. \u041c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e\u00a0\u043f\u0440\u0438\u0437\u043d\u0430\u043a VIP \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0435\u00a0\u0432\u043b\u0438\u044f\u0435\u0442 \u043d\u0430\u00a0\u0446\u0435\u043b\u0435\u0432\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0438\u0441\u043a\u043b\u044e\u0447\u0443 \u0435\u0433\u043e.<\/p>\n<p>\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0438:<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td data-colwidth=\"237\" width=\"237\">\n<p align=\"left\">\u00a0<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u041a\u043e\u043b-\u0432\u043e \u043f\u0440\u043e\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439<\/p>\n<\/td>\n<td>\n<p align=\"center\">% \u043f\u0440\u043e\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"237\" width=\"237\">\n<p align=\"left\">HomePlanet<\/p>\n<\/td>\n<td>\n<p align=\"center\">201<\/p>\n<\/td>\n<td>\n<p align=\"center\">2.312205<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"237\" width=\"237\">\n<p align=\"left\">CryoSleep<\/p>\n<\/td>\n<td>\n<p align=\"center\">217<\/p>\n<\/td>\n<td>\n<p align=\"center\">2.496261<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"237\" width=\"237\">\n<p align=\"left\">Destination<\/p>\n<\/td>\n<td>\n<p align=\"center\">182<\/p>\n<\/td>\n<td>\n<p align=\"center\">2.093639<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"237\" width=\"237\">\n<p align=\"left\">Age<\/p>\n<\/td>\n<td>\n<p align=\"center\">179<\/p>\n<\/td>\n<td>\n<p align=\"center\">2.059128<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"237\" width=\"237\">\n<p align=\"left\">RoomService<\/p>\n<\/td>\n<td>\n<p align=\"center\">181<\/p>\n<\/td>\n<td>\n<p align=\"center\">2.082135<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"237\" width=\"237\">\n<p align=\"left\">FoodCourt<\/p>\n<\/td>\n<td>\n<p align=\"center\">183<\/p>\n<\/td>\n<td>\n<p align=\"center\">2.105142<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"237\" width=\"237\">\n<p align=\"left\">ShoppingMall<\/p>\n<\/td>\n<td>\n<p align=\"center\">208<\/p>\n<\/td>\n<td>\n<p align=\"center\">2.392730<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"237\" width=\"237\">\n<p align=\"left\">Spa<\/p>\n<\/td>\n<td>\n<p align=\"center\">183<\/p>\n<\/td>\n<td>\n<p align=\"center\">2.105142<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"237\" width=\"237\">\n<p align=\"left\">VRDeck<\/p>\n<\/td>\n<td>\n<p align=\"center\">188<\/p>\n<\/td>\n<td>\n<p align=\"center\">2.162660<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"237\" width=\"237\">\n<p align=\"left\">GroupId<\/p>\n<\/td>\n<td>\n<p align=\"center\">0<\/p>\n<\/td>\n<td>\n<p align=\"center\">0.000000<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"237\" width=\"237\">\n<p align=\"left\">Deck<\/p>\n<\/td>\n<td>\n<p align=\"center\">199<\/p>\n<\/td>\n<td>\n<p align=\"center\">2.289198<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"237\" width=\"237\">\n<p align=\"left\">Side<\/p>\n<\/td>\n<td>\n<p align=\"center\">199<\/p>\n<\/td>\n<td>\n<p align=\"center\">2.289198<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u0414\u043b\u044f\u00a0\u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u044e \u043d\u0435\u00a0\u043e\u0431\u0440\u0430\u0449\u0430\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u043d\u0430\u00a0\u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0438. \u0412\u00a0\u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u0434\u043b\u044f\u00a0\u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u0447\u0438 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0431\u0443\u0434\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u044c \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u043d\u043e\u0433\u043e \u0431\u0443\u0441\u0442\u0438\u043d\u0433\u0430 <a href=\"https:\/\/catboost.ai\/en\/docs\/\" rel=\"noopener noreferrer nofollow\"><strong>Catboost<\/strong><\/a>. \u042d\u0442\u0430 \u043c\u043e\u0434\u0435\u043b\u044c \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441\u00a0\u0434\u0430\u043d\u043d\u044b\u043c\u0438, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u043c\u0438 \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u043b\u044f\u00a0\u043d\u0430\u0447\u0430\u043b\u0430 \u043c\u043e\u0436\u043d\u043e \u043d\u0435\u00a0\u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u043f\u0440\u043e\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f.<\/p>\n<p>\u0417\u0430\u043a\u043e\u0434\u0438\u0440\u0443\u044e \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0441\u00a0\u043f\u043e\u043c\u043e\u0449\u044c\u044e one\u2011hot \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f:<\/p>\n<pre><code class=\"python\">X_train = pd.get_dummies(X_train) X_test = pd.get_dummies(X_test)<\/code><\/pre>\n<p>\u041e\u0431\u0443\u0447\u0443 \u043c\u043e\u0434\u0435\u043b\u044c \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442: Score = 0.79\u00a0261\u00a0(\u0442\u043e\u043f 1262).<\/p>\n<p>\u0423\u043b\u0443\u0447\u0448\u0438\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043c\u043e\u0436\u043d\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c\u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u043c\u0438. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <\/p>\n<ul>\n<li>\n<p>\u043f\u043e\u0434\u043a\u0440\u0443\u0442\u0438\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043c\u043e\u0434\u0435\u043b\u0438;<\/p>\n<\/li>\n<li>\n<p>\u043f\u0440\u043e\u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0438 \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438. \u0417\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043f\u0443\u0441\u0442\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u0447\u0442\u043e\u0431\u044b \u043d\u0435\u00a0\u043f\u043e\u0442\u0435\u0440\u044f\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e.<\/p>\n<\/li>\n<\/ul>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u044e \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0441\u043f\u043e\u0441\u043e\u0431.<\/p>\n<p>\u0414\u043b\u044f\u00a0\u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u044e \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043f\u0443\u0441\u0442\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u043d\u0435\u00a0\u043f\u0440\u043e\u0432\u043e\u0434\u044f \u0430\u043d\u0430\u043b\u0438\u0437 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432. \u0414\u043b\u044f\u00a0\u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432 \u0437\u0430\u043f\u043e\u043b\u043d\u044e \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0438 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u044e\u0449\u0438\u043c\u0441\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c, \u0430\u00a0\u0434\u043b\u044f\u00a0\u0447\u0438\u0441\u043b\u043e\u0432\u044b\u0445 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432 \u0437\u0430\u043f\u043e\u043b\u043d\u044e \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0438 \u043c\u0435\u0434\u0438\u0430\u043d\u0430\u043c\u0438.<\/p>\n<pre><code class=\"python\">from sklearn.impute import SimpleImputer  numerical_columns = X_train.describe().columns categorical_columns = set(X_train.columns) - set(numerical_columns)  for col in numerical_columns:     si = SimpleImputer(strategy='median')     X_train[col] = si.fit_transform(X_train[col].values.reshape(-1, 1))     X_test[col] = si.fit_transform(X_test[col].values.reshape(-1, 1))      for col in categorical_columns:     si = SimpleImputer(strategy='most_frequent')     X_train[col] = si.fit_transform(X_train[col].values.reshape(-1, 1))     X_test[col] = si.fit_transform(X_test[col].values.reshape(-1, 1))<\/code><\/pre>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u044e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442: Score = 0.79\u00a0401. \u041f\u043e\u00a0\u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044e \u0441\u00a0\u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u043c\u00a0\u2014 \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u0435 \u043c\u0435\u0442\u0440\u0438\u043a\u0438 \u043d\u0430 0.0014.<\/p>\n<p>\u041f\u043e\u043f\u0440\u043e\u0431\u0443\u044e \u0443\u043b\u0443\u0447\u0448\u0438\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442, \u043f\u0440\u043e\u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0432 \u0434\u0430\u043d\u043d\u044b\u0435.<\/p>\n<p>\u0414\u043b\u044f\u00a0\u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u044e \u043d\u0430\u00a0\u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0447\u0438\u0441\u043b\u043e\u0432\u044b\u0445 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432:<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0421\u0442\u043e\u0438\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e\u00a0\u043c\u0435\u0442\u043e\u0434\u044b \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u043d\u043e\u0433\u043e \u0431\u0443\u0441\u0442\u0438\u043d\u0433\u0430 \u0441\u043b\u0430\u0431\u043e \u0447\u0443\u0432\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u044b \u043a\u00a0\u0432\u044b\u0431\u0440\u043e\u0441\u0430\u043c, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u043e\u0436\u043d\u043e \u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043a\u0430\u043a\u00a0\u0435\u0441\u0442\u044c.<\/p>\n<p>\u0417\u0430\u0431\u0435\u0433\u0430\u044f \u0432\u043f\u0435\u0440\u0451\u0434, \u0441\u043a\u0430\u0436\u0443, \u0447\u0442\u043e\u00a0\u0434\u043b\u044f\u00a0\u0431\u043e\u0440\u044c\u0431\u044b \u0441\u00a0\u0430\u043d\u043e\u043c\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438 \u044f \u043f\u043e\u043f\u044b\u0442\u0430\u043b\u0441\u044f \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u044b:<\/p>\n<ul>\n<li>\n<p>\u0423\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u0430\u043d\u043e\u043c\u0430\u043b\u044c\u043d\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 (\u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043f\u043e\u0442\u0435\u0440\u044f\u043b \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e, \u0438\u0437\u2011\u0437\u0430 \u0447\u0435\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043c\u0435\u0442\u0440\u0438\u043a\u0438 \u0443\u0445\u0443\u0434\u0448\u0438\u043b\u043e\u0441\u044c);<\/p>\n<\/li>\n<li>\n<p>\u0417\u0430\u043c\u0435\u043d\u0430 \u0430\u043d\u043e\u043c\u0430\u043b\u044c\u043d\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043f\u0440\u0438\u00a0\u043f\u043e\u043c\u043e\u0449\u0438 \u0440\u0430\u0441\u0447\u0451\u0442\u0430 1.5\u00a0\u043c\u0435\u0436\u043a\u0432\u0430\u0440\u0442\u0438\u043b\u044c\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u043c\u0430\u0445\u0430 (IQR) \u0438 \u0437\u0430\u043c\u0435\u043d\u044b \u0430\u043d\u043e\u043c\u0430\u043b\u044c\u043d\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043d\u0430 Q1 \u2013 1.5*IQR \u0438 Q3 + 1.5*IQR. (\u043c\u0435\u0442\u0440\u0438\u043a\u0430 \u0442\u0430\u043a\u0436\u0435 \u0441\u043d\u0438\u0437\u0438\u043b\u0430\u0441\u044c).<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u043e\u00a0\u0433\u0440\u0430\u0444\u0438\u043a\u0430\u043c \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e\u00a0\u0434\u043b\u044f\u00a0\u0432\u0441\u0435\u0445 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0439 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432 \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u043d\u0430 \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0430\u0441\u0438\u043c\u043c\u0435\u0442\u0440\u0438\u044f (\u00ab\u043f\u0435\u0440\u0435\u043a\u043e\u0441\u00bb \u0432\u043b\u0435\u0432\u043e). \u0414\u043b\u044f\u00a0\u0442\u0430\u043a\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u043c\u043e\u0436\u043d\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043c\u0435\u0442\u043e\u0434\u043e\u043c <a href=\"https:\/\/www.ncbi.nlm.nih.gov\/pmc\/articles\/PMC4120293\/\" rel=\"noopener noreferrer nofollow\"><strong>log transform<\/strong><\/a> (\u043b\u043e\u0433\u0430\u0440\u0438\u0444\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f). \u0421\u00a0\u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u0434\u043e\u0441\u0442\u0438\u0447\u044c \u043b\u0443\u0447\u0448\u0435\u0433\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430.<\/p>\n<p>\u041d\u0430\u00a0\u0433\u0440\u0430\u0444\u0438\u043a\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e, \u043a\u0430\u043a\u00a0\u0441\u00a0\u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u043d\u0438\u0432\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u044b\u0431\u0440\u043e\u0441\u044b.<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u041f\u043e\u0441\u043b\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043b\u043e\u0433\u0430\u0440\u0438\u0444\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432 \u0441\u0442\u0430\u043b\u0438 \u0438\u043c\u0435\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0432\u0438\u0434:   <\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u044e \u043d\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432 \u043f\u0440\u0438 CryoSleep = True:   <\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td>\n<p align=\"center\">\u00a0<\/p>\n<\/td>\n<td>\n<p align=\"center\">RoomService<\/p>\n<\/td>\n<td>\n<p align=\"center\">FoodCourt<\/p>\n<\/td>\n<td>\n<p align=\"center\">ShoppingMall<\/p>\n<\/td>\n<td>\n<p align=\"center\">Spa<\/p>\n<\/td>\n<td>\n<p align=\"center\">VRDeck<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"center\">count<\/p>\n<\/td>\n<td>\n<p align=\"center\">2969.0<\/p>\n<\/td>\n<td>\n<p align=\"center\">2967.0<\/p>\n<\/td>\n<td>\n<p align=\"center\">2941.0<\/p>\n<\/td>\n<td>\n<p align=\"center\">2972.0<\/p>\n<\/td>\n<td>\n<p align=\"center\">2975.0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"center\">mean<\/p>\n<\/td>\n<td>\n<p align=\"center\"><strong>0.0<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"center\"><strong>0.0<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"center\"><strong>0.0<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"center\"><strong>0.0<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"center\"><strong>0.0<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"center\">std<\/p>\n<\/td>\n<td>\n<p align=\"center\"><strong>0.0<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"center\"><strong>0.0<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"center\"><strong>0.0<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"center\"><strong>0.0<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"center\"><strong>0.0<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"center\">min<\/p>\n<\/td>\n<td>\n<p align=\"center\"><strong>0.0<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"center\"><strong>0.0<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"center\"><strong>0.0<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"center\"><strong>0.0<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"center\"><strong>0.0<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"center\">25%<\/p>\n<\/td>\n<td>\n<p align=\"center\"><strong>0.0<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"center\"><strong>0.0<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"center\"><strong>0.0<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"center\"><strong>0.0<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"center\"><strong>0.0<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"center\">50%<\/p>\n<\/td>\n<td>\n<p align=\"center\"><strong>0.0<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"center\"><strong>0.0<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"center\"><strong>0.0<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"center\"><strong>0.0<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"center\"><strong>0.0<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"center\">75%<\/p>\n<\/td>\n<td>\n<p align=\"center\"><strong>0.0<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"center\"><strong>0.0<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"center\"><strong>0.0<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"center\"><strong>0.0<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"center\"><strong>0.0<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"center\">max<\/p>\n<\/td>\n<td>\n<p align=\"center\"><strong>0.0<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"center\"><strong>0.0<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"center\"><strong>0.0<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"center\"><strong>0.0<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"center\"><strong>0.0<\/strong><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u041c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0432\u044b\u0432\u043e\u0434 \u043e\u00a0\u0442\u043e\u043c, \u0447\u0442\u043e\u00a0\u0435\u0441\u043b\u0438 CryoSleep = True, \u0442\u043e \u0434\u043b\u044f\u00a0\u0432\u0441\u0435\u0445 \u0437\u0430\u043f\u0438\u0441\u0435\u0439 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432 RoomService, FoodCourt, ShoppingMall, Spa, VRDeck = 0. \u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0435\u0441\u043b\u0438 \u0445\u043e\u0442\u044f\u00a0\u0431\u044b \u043e\u0434\u043d\u043e \u0438\u0437\u00a0\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432 RoomService, FoodCourt, ShoppingMall, Spa, VRDeck \u043d\u0435\u00a0\u0440\u0430\u0432\u043d\u043e \u043d\u0443\u043b\u044e, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0447\u0438\u0442\u0430\u0442\u044c, \u0447\u0442\u043e\u00a0CryoSleep = False.<\/p>\n<p>\u041d\u0430\u00a0\u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0438\u0438 \u044d\u0442\u0438\u0445 \u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u0439, \u0437\u0430\u043f\u043e\u043b\u043d\u044e \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0438 \u0432\u00a0\u043f\u043e\u043b\u0435 CryoSleep:<\/p>\n<pre><code class=\"python\">def impute_cryo_sleep(df: pd.DataFrame) -> None:     df.loc[         ((df['RoomService'] == 0.0) | df['RoomService'].isnull()) &amp;          ((df['FoodCourt'] == 0.0) | df['FoodCourt'].isnull()) &amp;          ((df['ShoppingMall'] == 0.0) | df['ShoppingMall'].isnull()) &amp;          ((df['Spa'] == 0.0) | df['Spa'].isnull()) &amp;         ((df['VRDeck'] == 0.0) | df['VRDeck'].isnull()) &amp;         (df['CryoSleep'].isnull()),          'CryoSleep'     ] = True          df.loc[         ((df['RoomService'] > 0.0) |          (df['FoodCourt'] > 0.0) |          (df['ShoppingMall'] > 0.0) |          (df['Spa'] > 0.0) |         (df['VRDeck'] > 0.0)) &amp; (df['CryoSleep'].isnull()),          'CryoSleep'     ] = False  impute_cryo_sleep(X_train) impute_cryo_sleep(X_test) <\/code><\/pre>\n<p>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u044e \u043d\u0430\u00a0\u0434\u0430\u043d\u043d\u044b\u0435 \u0432\u00a0\u0440\u0430\u0437\u0440\u0435\u0437\u0435 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432 HomePlanet\u00a0\u2014 Deck:<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td data-colwidth=\"106\" width=\"106\">\n<p align=\"center\"><strong>Deck<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"center\">A<\/p>\n<\/td>\n<td>\n<p align=\"center\">B<\/p>\n<\/td>\n<td data-colwidth=\"75\" width=\"75\">\n<p align=\"center\">C<\/p>\n<\/td>\n<td>\n<p align=\"center\">D<\/p>\n<\/td>\n<td data-colwidth=\"76\" width=\"76\">\n<p align=\"center\">E<\/p>\n<\/td>\n<td data-colwidth=\"75\" width=\"75\">\n<p align=\"center\">F<\/p>\n<\/td>\n<td data-colwidth=\"72\" width=\"72\">\n<p align=\"center\">G<\/p>\n<\/td>\n<td>\n<p align=\"center\">T<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"106\" width=\"106\">\n<p align=\"center\"><strong>HomePlanet<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"center\">\u00a0<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"75\" width=\"75\">\n<p align=\"center\">\u00a0<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"76\" width=\"76\">\n<p align=\"center\">\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"75\" width=\"75\">\n<p align=\"center\">\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"72\" width=\"72\">\n<p align=\"center\">\u00a0<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u00a0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"106\" width=\"106\">\n<p align=\"center\">Earth<\/p>\n<\/td>\n<td>\n<p align=\"center\">0.0<\/p>\n<\/td>\n<td>\n<p align=\"center\">0.0<\/p>\n<\/td>\n<td data-colwidth=\"75\" width=\"75\">\n<p align=\"center\">0.0<\/p>\n<\/td>\n<td>\n<p align=\"center\">0.0<\/p>\n<\/td>\n<td data-colwidth=\"76\" width=\"76\">\n<p align=\"center\">395.0<\/p>\n<\/td>\n<td data-colwidth=\"75\" width=\"75\">\n<p align=\"center\">1614.0<\/p>\n<\/td>\n<td data-colwidth=\"72\" width=\"72\">\n<p align=\"center\"><strong>2498.0<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"center\">0.0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"106\" width=\"106\">\n<p align=\"center\">Europa<\/p>\n<\/td>\n<td>\n<p align=\"center\"><strong>252.0<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"center\"><strong>766.0<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"75\" width=\"75\">\n<p align=\"center\"><strong>734.0<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"center\">186.0<\/p>\n<\/td>\n<td data-colwidth=\"76\" width=\"76\">\n<p align=\"center\">128.0<\/p>\n<\/td>\n<td data-colwidth=\"75\" width=\"75\">\n<p align=\"center\">0.0<\/p>\n<\/td>\n<td data-colwidth=\"72\" width=\"72\">\n<p align=\"center\">0.0<\/p>\n<\/td>\n<td>\n<p align=\"center\"><strong>4.0<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"106\" width=\"106\">\n<p align=\"center\">Mars<\/p>\n<\/td>\n<td>\n<p align=\"center\">0.0<\/p>\n<\/td>\n<td>\n<p align=\"center\">0.0<\/p>\n<\/td>\n<td data-colwidth=\"75\" width=\"75\">\n<p align=\"center\">0.0<\/p>\n<\/td>\n<td>\n<p align=\"center\">282.0<\/p>\n<\/td>\n<td data-colwidth=\"76\" width=\"76\">\n<p align=\"center\">330.0<\/p>\n<\/td>\n<td data-colwidth=\"75\" width=\"75\">\n<p align=\"center\">1110.0<\/p>\n<\/td>\n<td data-colwidth=\"72\" width=\"72\">\n<p align=\"center\">0.0<\/p>\n<\/td>\n<td>\n<p align=\"center\">0.0<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u041c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e\u00a0\u043d\u0430\u00a0\u043f\u0430\u043b\u0443\u0431\u0430\u0445 (Deck) A, B, C, T \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0430\u0441\u0441\u0430\u0436\u0438\u0440\u044b \u0441\u00a0\u043f\u043b\u0430\u043d\u0435\u0442\u044b \u0415\u0432\u0440\u043e\u043f\u0430. \u0410\u00a0\u043d\u0430\u00a0\u043f\u0430\u043b\u0443\u0431\u0435 G \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0430\u0441\u0441\u0430\u0436\u0438\u0440\u044b \u0441\u00a0\u043f\u043b\u0430\u043d\u0435\u0442\u044b \u0417\u0435\u043c\u043b\u044f. \u0414\u043b\u044f\u00a0\u043f\u0430\u0441\u0441\u0430\u0436\u0438\u0440\u043e\u0432 \u0441\u00a0\u041c\u0430\u0440\u0441\u0430 \u043d\u0435\u043b\u044c\u0437\u044f \u043e\u0434\u043d\u043e\u0437\u043d\u0430\u0447\u043d\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u043d\u0430\u00a0\u043a\u0430\u043a\u043e\u0439 \u043f\u0430\u043b\u0443\u0431\u0435 \u043e\u043d\u0438 \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u044b.<\/p>\n<p>\u041d\u0430\u00a0\u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0438\u0438 \u044d\u0442\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0437\u0430\u043f\u043e\u043b\u043d\u044e \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0438 \u0434\u043b\u044f\u00a0\u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0430 HomePlanet:<\/p>\n<pre><code class=\"python\">def impute_home_planet_by_deck(df: pd.DataFrame) -> None:     df.loc[         (df['Deck'] == 'G') &amp; (df['HomePlanet'].isnull()),          'HomePlanet'     ] = 'Earth'          europa_decks = ['A', 'B', 'C', 'T']     df.loc[         (df['Deck'].isin(europa_decks)) &amp; (df['HomePlanet'].isnull()),          'HomePlanet'     ] = 'Europa'           impute_home_planet_by_deck(X_train) impute_home_planet_by_deck(X_test) <\/code><\/pre>\n<p>\u0418\u0441\u0445\u043e\u0434\u044f \u0438\u0437 \u0440\u0430\u043d\u0435\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0432 \u0440\u0430\u0437\u0440\u0435\u0437\u0435 HomePlanet \u2013 Deck, \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f Deck \u043f\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e HomePlanet, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u043d\u043e\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435:<\/p>\n<pre><code class=\"python\">home_planet_deck = X_train.groupby(     ['HomePlanet', 'Deck'] ).size().unstack().fillna(0)  earth = home_planet_deck.loc['Earth'] earth_proba = list(earth \/ sum(earth))  europa = home_planet_deck.loc['Europa'] europa_proba = list(europa \/ sum(europa))  mars = home_planet_deck.loc['Mars'] mars_proba = list(mars \/ sum(mars))  decks = X_train['Deck'].unique() deck_values = sorted(decks[~pd.isnull(decks)]) planet_proba = dict(     zip(['Earth', 'Mars', 'Europa'], [earth_proba, mars_proba, europa_proba]) )  # Idempotence np.random.seed(0)  def impute_deck_by_home_planet(df: pd.DataFrame) -> None:     for planet in planet_proba.keys():         planet_null_decks_shape = df.loc[             (df['HomePlanet'] == planet) &amp;<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-345944","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/345944","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=345944"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/345944\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=345944"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=345944"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=345944"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}