{"id":271308,"date":"2015-12-28T19:19:02","date_gmt":"2015-12-28T16:19:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=271308"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=271308","title":{"rendered":"Kaggle \u0438 Titanic \u2014 \u0435\u0449\u0435 \u043e\u0434\u043d\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0437\u0430\u0434\u0430\u0447\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Python"},"content":{"rendered":"<p>       \u0425\u043e\u0447\u0443 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u043e\u043f\u044b\u0442\u043e\u043c \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0437\u0430\u0434\u0430\u0447\u0435\u0439 <a href=\"https:\/\/www.kaggle.com\/c\/titanic\">\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e\u0433\u043e \u043a\u043e\u043d\u043a\u0443\u0440\u0441\u0430<\/a> \u043f\u043e \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u043c\u0443 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044e \u043e\u0442 Kaggle. \u042d\u0442\u043e\u0442 \u043a\u043e\u043d\u043a\u0443\u0440\u0441 \u043f\u043e\u0437\u0438\u0446\u0438\u043e\u043d\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043a\u0430\u043a \u043a\u043e\u043d\u043a\u0443\u0440\u0441 \u0434\u043b\u044f \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u0445, \u0430 \u0443 \u043c\u0435\u043d\u044f \u043a\u0430\u043a \u0440\u0430\u0437 \u043d\u0435 \u0431\u044b\u043b\u043e \u043f\u043e\u0447\u0442\u0438 \u043d\u0438\u043a\u0430\u043a\u043e\u0433\u043e \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043e\u043f\u044b\u0442\u0430 \u0432 \u044d\u0442\u043e\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u0438. \u042f \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0437\u043d\u0430\u043b \u0442\u0435\u043e\u0440\u0438\u044e, \u043d\u043e \u0441 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0434\u0435\u043b\u0430 \u043f\u043e\u0447\u0442\u0438 \u043d\u0435 \u0438\u043c\u0435\u043b \u0438 \u0441 \u043f\u0438\u0442\u043e\u043d\u043e\u043c \u043f\u043b\u043e\u0442\u043d\u043e \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u043b. \u0412 \u0438\u0442\u043e\u0433\u0435, \u043f\u043e\u0442\u0440\u0430\u0442\u0438\u0432 \u043f\u0430\u0440\u0443 \u043f\u0440\u0435\u0434\u043d\u043e\u0432\u043e\u0433\u043e\u0434\u043d\u0438\u0445 \u0432\u0435\u0447\u0435\u0440\u043e\u0432, \u043d\u0430\u0431\u0440\u0430\u043b 0.80383 (\u043f\u0435\u0440\u0432\u0430\u044f \u0447\u0435\u0442\u0432\u0435\u0440\u0442\u044c \u0440\u0435\u0439\u0442\u0438\u043d\u0433\u0430).<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/fb4\/856\/19f\/fb485619f6a24cd791db6792433c1bf0.jpeg\"\/><\/p>\n<p>  \u0412 \u043e\u0431\u0449\u0435\u043c \u044d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u0434\u043b\u044f \u0435\u0449\u0435 \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u0445 \u043e\u0442 \u0443\u0436\u0435 \u043d\u0430\u0447\u0430\u0432\u0448\u0435\u0433\u043e.<\/p>\n<p>  <a name=\"habracut\"><\/a><\/p>\n<h1>\u0422\u0438\u0442\u0430\u043d\u0438\u043a<\/h1>\n<p>  \u0412\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0443\u044e \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u043c\u0443\u0437\u044b\u043a\u0443 \u0438 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u043c \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435.<\/p>\n<p>  <iframe loading=\"lazy\" width=\"420\" height=\"315\" src=\"https:\/\/www.youtube.com\/embed\/nXOE6EQtKcU?feature=oembed\" frameborder=\"0\" allowfullscreen><\/iframe><\/p>\n<p>  \u041a\u043e\u043d\u043a\u0443\u0440\u0441 \u00ab\u043f\u043e \u0442\u0438\u0442\u0430\u043d\u0438\u043a\u0443\u00bb \u0431\u044b\u043b \u0443\u0436\u0435 \u043d\u0435\u043e\u0434\u043d\u043e\u043a\u0440\u0430\u0442\u043d\u043e \u043e\u0442\u043c\u0435\u0447\u0435\u043d \u043d\u0430 \u0425\u0430\u0431\u0440\u0435. \u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u044e\u044e \u0441\u0442\u0430\u0442\u044c\u044e \u0438\u0437 \u0441\u043f\u0438\u0441\u043a\u0430 \u2014 \u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435 \u0438\u043d\u0442\u0440\u0438\u0433\u0443\u044e\u0449\u0438\u043c \u0447\u0435\u043c \u0445\u043e\u0440\u043e\u0448\u0438\u0439 \u0434\u0435\u0442\u0435\u043a\u0442\u0438\u0432\u043d\u044b\u0439 \u0440\u043e\u043c\u0430\u043d, \u0430 \u043e\u0442\u043b\u0438\u0447\u043d\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 (0.81340) \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e Random Forest \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u043e\u043c.<\/p>\n<ul>\n<li><a href=\"http:\/\/habrahabr.ru\/company\/microsoft\/blog\/268039\/\">habrahabr.ru\/company\/microsoft\/blog\/268039<\/a> \u2014 \u041f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u0438\u0435 \u0432\u044b\u0436\u0438\u0432\u0430\u043d\u0438\u044f \u043f\u0430\u0441\u0441\u0430\u0436\u0438\u0440\u043e\u0432 \u0422\u0438\u0442\u0430\u043d\u0438\u043a\u0430 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 Azure Machine Learning<\/li>\n<li><a href=\"http:\/\/habrahabr.ru\/post\/165001\/\">habrahabr.ru\/post\/165001<\/a> \u2014 Data Mining: \u041f\u0435\u0440\u0432\u0438\u0447\u043d\u0430\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0421\u0423\u0411\u0414<\/li>\n<li><a href=\"http:\/\/habrahabr.ru\/company\/mlclass\/blog\/248779\/\">habrahabr.ru\/company\/mlclass\/blog\/248779<\/a> \u2014 \u041a\u043e\u0433\u0434\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043c\u043d\u043e\u0433\u043e: Vowpal Wabbit<\/li>\n<li><a href=\"http:\/\/habrahabr.ru\/post\/272201\/\">habrahabr.ru\/post\/272201<\/a> \u2014 \u0423\u0441\u0442\u043e\u0439\u0447\u0438\u0432\u0430\u044f \u043a\u0440\u0430\u0441\u043e\u0442\u0430 \u043d\u0435\u043f\u0440\u0438\u043b\u0438\u0447\u043d\u044b\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439<\/li>\n<li><a href=\"http:\/\/habrahabr.ru\/post\/202090\/\">habrahabr.ru\/post\/202090<\/a> \u2014 \u041e\u0441\u043d\u043e\u0432\u044b \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 python \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c pandas+sklearn<\/li>\n<li><a href=\"http:\/\/habrahabr.ru\/company\/mlclass\/blog\/270973\/\">habrahabr.ru\/company\/mlclass\/blog\/270973<\/a> \u2014 \u0422\u0438\u0442\u0430\u043d\u0438\u043a \u043d\u0430 Kaggle: \u0432\u044b \u043d\u0435 \u0434\u043e\u0447\u0438\u0442\u0430\u0435\u0442\u0435 \u044d\u0442\u043e\u0442 \u043f\u043e\u0441\u0442 \u0434\u043e \u043a\u043e\u043d\u0446\u0430<\/li>\n<\/ul>\n<p>  \u0422\u0430\u043a\u0436\u0435 \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c \u0441\u0442\u0430\u0442\u044c\u044e \u043e \u0434\u0440\u0443\u0433\u043e\u043c \u043a\u043e\u043d\u043a\u0443\u0440\u0441\u0435. \u0418\u0437 \u043d\u0435\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043d\u044f\u0442\u044c \u043a\u0430\u043a\u0438\u043c \u0438\u043c\u0435\u043d\u043d\u043e \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0434\u043e\u043b\u0436\u0435\u043d \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043c\u043e\u0437\u0433 \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438 \u0447\u0442\u043e \u0431\u043e\u043b\u044c\u0448\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u0443\u0434\u0435\u043b\u0435\u043d\u0430 \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u043c\u0443 \u0430\u043d\u0430\u043b\u0438\u0437\u0443 \u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0434\u0430\u043d\u043d\u044b\u0445. <\/p>\n<ul>\n<li><a href=\"http:\/\/habrahabr.ru\/post\/270367\/\">habrahabr.ru\/post\/270367<\/a> \u2014 \u041a\u0430\u043a \u044f \u043f\u043e\u0431\u0435\u0434\u0438\u043b \u0432 \u043a\u043e\u043d\u043a\u0443\u0440\u0441\u0435 BigData \u043e\u0442 Beeline<\/li>\n<\/ul>\n<h1>\u0418\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439<\/h1>\n<p>  \u0414\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u0447\u0438 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e Python-\u0441\u0442\u0435\u043a \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0439. \u042d\u0442\u043e\u0442 \u043f\u043e\u0434\u0445\u043e\u0434 \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u043c: \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 R, Matlab, Mathematica, Azure Machine Learning, Apache Weka, Java-ML \u0438 \u044f \u0434\u0443\u043c\u0430\u044e \u0441\u043f\u0438\u0441\u043e\u043a \u043c\u043e\u0436\u043d\u043e \u0435\u0449\u0435 \u0434\u043e\u043b\u0433\u043e \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0442\u044c. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 Python \u0438\u043c\u0435\u0435\u0442 \u0440\u044f\u0434 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432: \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043c\u043d\u043e\u0433\u043e \u0438 \u043e\u043d\u0438 \u043e\u0442\u043b\u0438\u0447\u043d\u043e\u0433\u043e \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430, \u0430 \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u0438\u0437 \u043d\u0438\u0445 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0441\u043e\u0431\u043e\u0439 \u043e\u0431\u0435\u0440\u0442\u043a\u0438 \u043d\u0430\u0434 C-\u043a\u043e\u0434\u043e\u043c \u043e\u043d\u0438 \u0435\u0449\u0435 \u0438 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u044b\u0435. \u041a \u0442\u043e\u043c\u0443 \u0436\u0435 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043b\u0435\u0433\u043a\u043e \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u0430 \u0432 \u044d\u043a\u0441\u043f\u043b\u0443\u0430\u0442\u0430\u0446\u0438\u044e.<\/p>\n<p>  \u0414\u043e\u043b\u0436\u0435\u043d \u043f\u0440\u0438\u0437\u043d\u0430\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u044f \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043f\u043e\u043a\u043b\u043e\u043d\u043d\u0438\u043a \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432\u044b\u0445 \u043d\u0435\u0441\u0442\u0440\u043e\u0433\u043e-\u0442\u0438\u043f\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u044f\u0437\u044b\u043a\u043e\u0432, \u043d\u043e \u0431\u043e\u0433\u0430\u0442\u0441\u0442\u0432\u043e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u0434\u043b\u044f python \u043d\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0435\u0433\u043e \u043a\u0430\u043a-\u043b\u0438\u0431\u043e \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c. <\/p>\n<p>  \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0432\u0441\u0435 \u0431\u0443\u0434\u0435\u043c \u043f\u043e\u0434 Linux (Ubuntu 14.04). \u041f\u043e\u043d\u0430\u0434\u043e\u0431\u044f\u0442\u0441\u044f: python 2.7, seaborn, matplotlib, sklearn, xgboost, pandas. \u0412\u043e\u043e\u0431\u0449\u0435 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b \u0442\u043e\u043b\u044c\u043a\u043e pandas \u0438 sklearn, \u0430 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u043d\u0443\u0436\u043d\u044b \u0434\u043b\u044f \u0438\u043b\u043b\u044e\u0441\u0442\u0440\u0430\u0446\u0438\u0438. <\/p>\n<p>  \u041f\u043e\u0434 Linux \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0434\u043b\u044f Python \u043c\u043e\u0436\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u0434\u0432\u0443\u043c\u044f \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u043c\u0438: \u0448\u0442\u0430\u0442\u043d\u044b\u043c \u043f\u0430\u043a\u0435\u0442\u043d\u044b\u043c (deb) \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u043e\u043c \u0438\u043b\u0438 \u0447\u0435\u0440\u0435\u0437 \u043f\u0438\u0442\u043e\u043d\u043e\u0432\u0441\u043a\u0443\u044e \u0443\u0442\u0438\u043b\u0438\u0442\u0443 pip. <\/p>\n<p>  \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 deb-\u043f\u0430\u043a\u0435\u0442\u0430\u043c\u0438 \u043f\u0440\u043e\u0449\u0435 \u0438 \u0431\u044b\u0441\u0442\u0440\u0435\u0435, \u043d\u043e \u0437\u0430\u0447\u0430\u0441\u0442\u0443\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0442\u0430\u043c \u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0448\u0438\u0435 (\u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u0435\u0432\u044b\u0448\u0435 \u0432\u0441\u0435\u0433\u043e). <\/p>\n<pre><code class=\"bash\"># \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0430 \u0432 \/usr\/lib\/python2.7\/dist-packages\/ $ sudo apt-get install python-matplotlib <\/code><\/pre>\n<p>  \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u0447\u0435\u0440\u0435\u0437 pip \u0434\u043e\u043b\u044c\u0448\u0435 (\u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0430 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044f), \u043d\u043e \u0441 \u043d\u0435\u0439 \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u043d\u0430 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0441\u0432\u0435\u0436\u0438\u0445 \u0432\u0435\u0440\u0441\u0438\u0439 \u043f\u0430\u043a\u0435\u0442\u043e\u0432. <\/p>\n<pre><code class=\"bash\"># \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0430 \u0432 \/usr\/local\/lib\/python2.7\/dist-packages\/ $ sudo pip install matplotlib <\/code><\/pre>\n<p>  \u0422\u0430\u043a \u043a\u0430\u043a\u0438\u043c \u0438\u043c\u0435\u043d\u043d\u043e \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043b\u0443\u0447\u0448\u0435 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u043f\u0430\u043a\u0435\u0442\u044b? \u042f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u043a\u043e\u043c\u043f\u0440\u043e\u043c\u0438\u0441\u0441: \u043c\u0430\u0441\u0441\u0438\u0432\u043d\u044b\u0435 \u0438 \u0442\u0440\u0435\u0431\u0443\u044e\u0449\u0438\u0435 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0430 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 NumPy \u0438 SciPy \u0441\u0442\u0430\u0432\u043b\u044e \u0438\u0437 DEB-\u043f\u0430\u043a\u0435\u0442\u043e\u0432.<\/p>\n<pre><code class=\"bash\">$ sudo apt-get install python  $ sudo apt-get install python-pip $ sudo apt-get install python-numpy $ sudo apt-get install python-scipy $ sudo apt-get install ipython <\/code><\/pre>\n<p>  \u0410 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435, \u0431\u043e\u043b\u0435\u0435 \u043b\u0435\u0433\u043a\u0438\u0435 \u043f\u0430\u043a\u0435\u0442\u044b, \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u044e \u0447\u0435\u0440\u0435\u0437 pip.<\/p>\n<pre><code class=\"bash\">$ sudo pip install pandas  $ sudo pip install matplotlib==1.4.3 $ sudo pip install skimage $ sudo pip install sklearn $ sudo pip install seaborn $ sudo pip install statsmodels $ sudo pip install xgboost <\/code><\/pre>\n<p>  \u0415\u0441\u043b\u0438 \u044f \u0447\u0442\u043e-\u0442\u043e \u0437\u0430\u0431\u044b\u043b \u2014 \u0442\u043e \u0432\u0441\u0435 \u043d\u0443\u0436\u043d\u044b\u0435 \u043f\u0430\u043a\u0435\u0442\u044b \u043a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u043b\u0435\u0433\u043a\u043e \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u044e\u0442\u0441\u044f \u0438 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c.<\/p>\n<p>  \u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c \u0434\u0440\u0443\u0433\u0438\u0445 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0440\u0435\u0434\u043f\u0440\u0438\u043d\u044f\u0442\u044c \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043f\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 \u043f\u0430\u043a\u0435\u0442\u043e\u0432. \u041d\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0433\u043e\u0440\u0430\u0437\u0434\u043d\u043e \u043f\u0440\u043e\u0449\u0435: \u0443\u0436\u0435 \u0435\u0441\u0442\u044c \u043f\u0440\u0435\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0434\u0438\u0441\u0442\u0440\u0438\u0431\u0443\u0442\u0438\u0432\u044b \u0441 \u043f\u0438\u0442\u043e\u043d\u043e\u043c \u0438 \u043f\u043e\u0447\u0442\u0438 \u0432\u0441\u0435\u043c\u0438 \u043d\u0443\u0436\u043d\u044b\u043c\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430\u043c\u0438. C\u0430\u043c \u044f \u0438\u0445 \u043d\u0435 \u043f\u0440\u043e\u0431\u043e\u0432\u0430\u043b, \u043d\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u044f\u0442 \u043e\u043d\u0438 \u043e\u0431\u0435\u0449\u0430\u044e\u0449\u0435.<\/p>\n<ul>\n<li><a href=\"https:\/\/www.continuum.io\/downloads\">www.continuum.io\/downloads<\/a> \u2014 Anaconda<\/li>\n<li><a href=\"https:\/\/www.enthought.com\/products\/canopy\/\">www.enthought.com\/products\/canopy<\/a> \u2014 Canopy<\/li>\n<\/ul>\n<h1>\u0414\u0430\u043d\u043d\u044b\u0435<\/h1>\n<p>  \u0421\u043a\u0430\u0447\u0430\u0435\u043c <a href=\"https:\/\/www.kaggle.com\/c\/titanic\/data\">\u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435<\/a> \u0434\u043b\u044f \u0437\u0430\u0434\u0430\u0447\u0438 \u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0447\u0442\u043e \u0436\u0435 \u043d\u0430\u043c \u0432\u044b\u0434\u0430\u043b\u0438. <\/p>\n<pre><code class=\"bash\">$ wc -l train.csv test.csv    892 train.csv   419 test.csv  1311 total <\/code><\/pre>\n<p>  \u0414\u0430\u043d\u043d\u044b\u0445 \u043f\u0440\u044f\u043c\u043e \u0441\u043a\u0430\u0436\u0435\u043c \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u043c\u043d\u043e\u0433\u043e \u2014 \u0432\u0441\u0435\u0433\u043e 891 \u043f\u0430\u0441\u0441\u0430\u0436\u0438\u0440 \u0432 train-\u0432\u044b\u0431\u043e\u0440\u043a\u0435, \u0438 418 \u0432 test-\u0432\u044b\u0431\u043e\u0440\u043a\u0435 (\u043e\u0434\u043d\u0430 \u0441\u0442\u0440\u043e\u0447\u043a\u0430 \u0438\u0434\u0435\u0442 \u043d\u0430 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u0441\u043e \u0441\u043f\u0438\u0441\u043a\u043e\u043c \u043f\u043e\u043b\u0435\u0439).<\/p>\n<p>  \u041e\u0442\u043a\u0440\u043e\u0435\u043c train.csv \u0432 \u043b\u044e\u0431\u043e\u043c \u0442\u0430\u0431\u043b\u0438\u0447\u043d\u043e\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0435 (\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e LibreOffice Calc) \u0447\u0442\u043e\u0431\u044b \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435.<\/p>\n<pre><code class=\"bash\">$ libreoffice --calc train.csv <\/code><\/pre>\n<p>  \u0412\u0438\u0434\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:  <\/p>\n<ul>\n<li>\u0412\u043e\u0437\u0440\u0430\u0441\u0442 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d \u043d\u0435 \u0443 \u0432\u0441\u0435\u0445<\/li>\n<li>\u0411\u0438\u043b\u0435\u0442\u044b \u0438\u043c\u0435\u044e\u0442 \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u0441\u0442\u0440\u0430\u043d\u043d\u044b\u0439 \u0438 \u043d\u0435\u043a\u043e\u043d\u0441\u0438\u0441\u0442\u0435\u043d\u0442\u043d\u044b\u0439 \u0444\u043e\u0440\u043c\u0430\u0442<\/li>\n<li>\u0412 \u0438\u043c\u0435\u043d\u0430\u0445 \u0435\u0441\u0442\u044c \u0442\u0438\u0442\u0443\u043b (\u043c\u0438\u0441\u0441, \u043c\u0438\u0441\u0442\u0435\u0440, \u043c\u0438\u0441\u0441\u0438\u0441 \u0438 \u0442.\u0434.)<\/li>\n<li>\u041d\u043e\u043c\u0435\u0440\u0430 \u043a\u0430\u044e\u0442 \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u043d\u044b \u043c\u0430\u043b\u043e \u0443 \u043a\u043e\u0433\u043e (<a href=\"http:\/\/habrahabr.ru\/company\/mlclass\/blog\/270973\/\">\u0442\u0443\u0442<\/a> \u0435\u0441\u0442\u044c \u043b\u0435\u0434\u0435\u043d\u044f\u0449\u0430\u044f \u0434\u0443\u0448\u0443 \u0438\u0441\u0442\u043e\u0440\u0438\u044f \u043f\u043e\u0447\u0435\u043c\u0443)<\/li>\n<li>\u0412 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u043d\u043e\u043c\u0435\u0440\u0430\u0445 \u043a\u0430\u044e\u0442 \u0432\u0438\u0434\u0438\u043c\u043e \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u043d \u043a\u043e\u0434 \u043f\u0430\u043b\u0443\u0431\u044b (\u0442\u0430\u043a \u0438 \u0435\u0441\u0442\u044c, \u043a\u0430\u043a <a href=\"http:\/\/habrahabr.ru\/company\/mlclass\/blog\/270973\/\">\u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c<\/a>)<\/li>\n<li>\u0422\u0430\u043a\u0436\u0435, \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u043e <a href=\"http:\/\/habrahabr.ru\/company\/mlclass\/blog\/270973\/\">\u0441\u0442\u0430\u0442\u044c\u0435<\/a>, \u0432 \u043d\u043e\u043c\u0435\u0440\u0435 \u043a\u0430\u044e\u0442\u044b \u0437\u0430\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0430<\/li>\n<li>\u0421\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u043f\u043e \u0438\u043c\u0435\u043d\u0438. \u0412\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u043c\u043d\u043e\u0433\u0438\u0435 \u043f\u0443\u0442\u0435\u0448\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u043b\u0438 \u0441\u0435\u043c\u044c\u044f\u043c\u0438, \u0438 \u0432\u0438\u0434\u0435\u043d \u043c\u0430\u0441\u0448\u0442\u0430\u0431 \u0442\u0440\u0430\u0433\u0435\u0434\u0438\u0438 \u2014 \u0447\u0430\u0441\u0442\u043e \u0441\u0435\u043c\u044c\u0438 \u043e\u043a\u0430\u0437\u0430\u043b\u0438\u0441\u044c \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u044b, \u0432\u044b\u0436\u0438\u043b\u0430 \u043b\u0438\u0448\u044c \u0447\u0430\u0441\u0442\u044c<\/li>\n<li>\u0421\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u043f\u043e \u0431\u0438\u043b\u0435\u0442\u0443. \u0412\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u043f\u043e \u043e\u0434\u043d\u043e\u043c\u0443 \u043a\u043e\u0434\u0443 \u0431\u0438\u043b\u0435\u0442\u0430 \u043f\u0443\u0442\u0435\u0448\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u043b\u043e \u0441\u0440\u0430\u0437\u0443 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043b\u044e\u0434\u0435\u0439, \u043f\u0440\u0438\u0447\u0435\u043c \u0447\u0430\u0441\u0442\u043e \u2014 \u0441 \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u0444\u0430\u043c\u0438\u043b\u0438\u044f\u043c\u0438. \u0411\u0435\u0433\u043b\u044b\u0439 \u0432\u0437\u0433\u043b\u044f\u0434 \u0432\u0440\u043e\u0434\u0435 \u0431\u044b \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u0447\u0442\u043e \u043b\u044e\u0434\u0438 \u0441 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u043c \u043d\u043e\u043c\u0435\u0440\u043e\u043c \u0431\u0438\u043b\u0435\u0442\u0430 \u0447\u0430\u0441\u0442\u043e \u0440\u0430\u0437\u0434\u0435\u043b\u044f\u044e\u0442 \u043e\u0434\u043d\u0443 \u0438 \u0442\u0443 \u0436\u0435 \u0443\u0447\u0430\u0441\u0442\u044c.<\/li>\n<li>\u0423 \u0447\u0430\u0441\u0442\u0438 \u043f\u0430\u0441\u0441\u0430\u0436\u0438\u0440\u043e\u0432 \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d \u043f\u043e\u0440\u0442 \u043f\u043e\u0441\u0430\u0434\u043a\u0438<\/li>\n<\/ul>\n<p>  \u0412\u0440\u043e\u0434\u0435 \u043f\u0440\u0438\u0431\u043b\u0438\u0437\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0432\u0441\u0435 \u044f\u0441\u043d\u043e, \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043d\u0435\u043f\u043e\u0441\u0442\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043a \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438.<\/p>\n<h1>\u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445<\/h1>\n<p>  \u0427\u0442\u043e\u0431\u044b \u043d\u0435 \u0437\u0430\u0448\u0443\u043c\u043b\u044f\u0442\u044c \u0434\u0430\u043b\u044c\u0448\u0435\u0439\u0448\u0438\u0439 \u043a\u043e\u0434 \u0441\u0440\u0430\u0437\u0443 \u043f\u0440\u0438\u0432\u0435\u0434\u0443 \u0432\u0441\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0435 \u0438\u043c\u043f\u043e\u0440\u0442\u044b:  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0428\u0430\u043f\u043a\u0430 \u0441\u043a\u0440\u0438\u043f\u0442\u0430<\/b><\/p>\n<div class=\"spoiler_text\"># coding=utf8<\/p>\n<p>  import pandas as pd<br \/>  import numpy as np<br \/>  import matplotlib.pyplot as plt<br \/>  import xgboost as xgb<br \/>  import re<br \/>  import seaborn as sns<br \/>  from sklearn.linear_model import LinearRegression<br \/>  from sklearn.linear_model import LogisticRegression<br \/>  from sklearn.linear_model import SGDClassifier<br \/>  from sklearn.ensemble import RandomForestClassifier<br \/>  from sklearn.grid_search import GridSearchCV<br \/>  from sklearn.neighbors import KNeighborsClassifier<br \/>  from sklearn.naive_bayes import GaussianNB<br \/>  from sklearn.svm import SVC<br \/>  from sklearn.feature_selection import SelectKBest, f_classif<br \/>  from sklearn.cross_validation import StratifiedKFold<br \/>  from sklearn.cross_validation import KFold<br \/>  from sklearn.cross_validation import cross_val_score<br \/>  from sklearn.preprocessing import StandardScaler<br \/>  from sklearn import metrics<\/p>\n<p>  pd.set_option(&#8216;display.width&#8217;, 256)  <\/div>\n<\/div>\n<p>  \u041d\u0430\u0432\u0435\u0440\u043d\u043e\u0435 \u0431\u043e\u043b\u044c\u0448\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u043c\u043e\u0435\u0439 \u043c\u043e\u0442\u0438\u0432\u0430\u0446\u0438\u0438 \u043a \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044e \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u0432\u044b\u0437\u0432\u0430\u043d\u0430 \u0432\u043e\u0441\u0442\u043e\u0440\u0433\u043e\u043c \u043e\u0442 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043f\u0430\u043a\u0435\u0442\u043e\u043c <a href=\"http:\/\/pandas.pydata.org\/\">pandas<\/a>. \u042f \u0437\u043d\u0430\u043b \u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u0438\u0438 \u044d\u0442\u043e\u0439 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0438, \u043d\u043e \u043d\u0435 \u043c\u043e\u0433 \u0434\u0430\u0436\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438\u044f\u0442\u043d\u043e \u0441 \u043d\u0435\u0439 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c. Pandas \u2014 \u044d\u0442\u043e Excel \u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u0441 \u0443\u0434\u043e\u0431\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c\u044e \u043f\u043e \u0432\u0432\u043e\u0434\u0443\/\u0432\u044b\u0432\u043e\u0434\u0443 \u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0442\u0430\u0431\u043b\u0438\u0447\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<p>  \u0417\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c \u043e\u0431\u0435 \u0432\u044b\u0431\u043e\u0440\u043a\u0438.<\/p>\n<pre><code class=\"python\">train_data = pd.read_csv(&quot;data\/train.csv&quot;) test_data = pd.read_csv(&quot;data\/test.csv&quot;) <\/code><\/pre>\n<p>  \u0421\u043e\u0431\u0438\u0440\u0430\u0435\u043c \u043e\u0431\u0435 \u0432\u044b\u0431\u043e\u0440\u043a\u0438 (train-\u0432\u044b\u0431\u043e\u0440\u043a\u0443 \u0438 test-\u0432\u044b\u0431\u043e\u0440\u043a\u0443) \u0432 \u043e\u0434\u043d\u0443 \u0441\u0443\u043c\u043c\u0430\u0440\u043d\u0443\u044e all-\u0432\u044b\u0431\u043e\u0440\u043a\u0443.<\/p>\n<pre><code class=\"python\">all_data = pd.concat([train_data, test_data]) <\/code><\/pre>\n<p>  \u0417\u0430\u0447\u0435\u043c \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c, \u0432\u0435\u0434\u044c \u0432 test-\u0432\u044b\u0431\u043e\u0440\u043a\u0435 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043f\u043e\u043b\u0435 \u0441 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0438\u0440\u0443\u044e\u0449\u0438\u043c \u0444\u043b\u0430\u0433\u043e\u043c \u0432\u044b\u0436\u0438\u0432\u0430\u0435\u043c\u043e\u0441\u0442\u0438? \u041f\u043e\u043b\u043d\u0430\u044f \u0432\u044b\u0431\u043e\u0440\u043a\u0430 \u043f\u043e\u043b\u0435\u0437\u043d\u0430 \u0434\u043b\u044f \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0438 \u043f\u043e \u0432\u0441\u0435\u043c \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u043c \u043f\u043e\u043b\u044f\u043c (\u0441\u0440\u0435\u0434\u043d\u0438\u0435, \u043c\u0435\u0434\u0438\u0430\u043d\u044b, \u043a\u0432\u0430\u043d\u0442\u0438\u043b\u0438, \u043c\u0438\u043d\u0438\u043c\u0443\u043c\u044b \u0438 \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c\u044b), \u0430 \u0442\u0430\u043a\u0436\u0435 \u0441\u0432\u044f\u0437\u0438 \u043c\u0435\u0436\u0434\u0443 \u044d\u0442\u0438\u043c\u0438 \u043f\u043e\u043b\u044f\u043c\u0438. \u0422\u043e \u0435\u0441\u0442\u044c, \u0441\u0447\u0438\u0442\u0430\u044f \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0443 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e train-\u0432\u044b\u0431\u043e\u0440\u043a\u0435, \u043c\u044b \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u0443\u0435\u043c \u0447\u0430\u0441\u0442\u044c \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0439 \u0434\u043b\u044f \u043d\u0430\u0441 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438.<\/p>\n<h1>\u0410\u043d\u0430\u043b\u0438\u0437 \u0434\u0430\u043d\u043d\u044b\u0445<\/h1>\n<p>  \u0410\u043d\u0430\u043b\u0438\u0437 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 Python \u043c\u043e\u0436\u043d\u043e \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0442\u044c \u0441\u0440\u0430\u0437\u0443 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c\u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u043c\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<ul>\n<li>\u0412\u0440\u0443\u0447\u043d\u0443\u044e \u0433\u043e\u0442\u043e\u0432\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0438 \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c \u0447\u0435\u0440\u0435\u0437 <a href=\"http:\/\/matplotlib.org\/\">matplotlib<\/a><\/li>\n<li>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u0433\u043e\u0442\u043e\u0432\u043e\u0435 \u0432 <a href=\"http:\/\/stanford.edu\/~mwaskom\/software\/seaborn\/\">seaborn<\/a><\/li>\n<li>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0439 \u0432\u044b\u0432\u043e\u0434 \u0441 \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u043a\u043e\u0439 \u0432 <a href=\"http:\/\/pandas.pydata.org\/\">pandas<\/a><\/li>\n<\/ul>\n<p>  \u041c\u044b \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0432\u0441\u0435 \u0442\u0440\u0438, \u043d\u043e \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u0441\u0430\u043c\u044b\u0439 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442. \u0412\u044b\u0432\u0435\u0434\u0435\u043c \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0443 \u0432\u044b\u0436\u0438\u0432\u0430\u0435\u043c\u043e\u0441\u0442\u0438 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043a\u043b\u0430\u0441\u0441\u0430 \u0438 \u043f\u043e\u043b\u0430.<\/p>\n<pre><code class=\"python\">print(&quot;===== survived by class and sex&quot;) print(train_data.groupby([&quot;Pclass&quot;, &quot;Sex&quot;])[&quot;Survived&quot;].value_counts(normalize=True)) <\/code><\/pre>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre> ===== survived by class and sex Pclass  Sex     Survived 1       female  1           0.968085                 0           0.031915         male    0           0.631148                 1           0.368852 2       female  1           0.921053                 0           0.078947         male    0           0.842593                 1           0.157407 3       female  0           0.500000                 1           0.500000         male    0           0.864553                 1           0.135447 dtype: float64 <\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0412\u0438\u0434\u0438\u043c, \u0447\u0442\u043e \u0432 \u0448\u043b\u044e\u043f\u043a\u0438 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u0430\u0436\u0430\u043b\u0438 \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0436\u0435\u043d\u0449\u0438\u043d \u2014 \u0448\u0430\u043d\u0441 \u0436\u0435\u043d\u0449\u0438\u043d\u044b \u043d\u0430 \u0432\u044b\u0436\u0438\u0432\u0430\u0435\u043c\u043e\u0441\u0442\u044c \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 96.8%, 92.1% \u0438 50% \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043a\u043b\u0430\u0441\u0441\u0430 \u0431\u0438\u043b\u0435\u0442\u0430. \u0428\u0430\u043d\u0441 \u043d\u0430 \u0432\u044b\u0436\u0438\u0432\u0430\u043d\u0438\u0435 \u043c\u0443\u0436\u0447\u0438\u043d\u044b \u0433\u043e\u0440\u0430\u0437\u0434\u043d\u043e \u043d\u0438\u0436\u0435 \u0438 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e 36.9%, 15.7% \u0438 13.5%.<\/p>\n<p>  \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e pandas \u0431\u044b\u0441\u0442\u0440\u043e \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u0435\u043c \u0441\u0432\u043e\u0434\u043a\u0443 \u043f\u043e \u0432\u0441\u0435\u043c \u0447\u0438\u0441\u043b\u043e\u0432\u044b\u043c \u043f\u043e\u043b\u044f\u043c \u043e\u0431\u0435\u0438\u0445 \u0432\u044b\u0431\u043e\u0440\u043e\u043a \u2014 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u043f\u043e \u043c\u0443\u0436\u0447\u0438\u043d\u0430\u043c \u0438 \u043f\u043e \u0436\u0435\u043d\u0449\u0438\u043d\u0430\u043c.<\/p>\n<pre><code class=\"python\">describe_fields = [&quot;Age&quot;, &quot;Fare&quot;, &quot;Pclass&quot;, &quot;SibSp&quot;, &quot;Parch&quot;]  print(&quot;===== train: males&quot;) print(train_data[train_data[&quot;Sex&quot;] == &quot;male&quot;][describe_fields].describe())  print(&quot;===== test: males&quot;) print(test_data[test_data[&quot;Sex&quot;] == &quot;male&quot;][describe_fields].describe())  print(&quot;===== train: females&quot;) print(train_data[train_data[&quot;Sex&quot;] == &quot;female&quot;][describe_fields].describe())  print(&quot;===== test: females&quot;) print(test_data[test_data[&quot;Sex&quot;] == &quot;female&quot;][describe_fields].describe()) <\/code><\/pre>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre> ===== train: males               Age        Fare      Pclass       SibSp       Parch count  453.000000  577.000000  577.000000  577.000000  577.000000 mean    30.726645   25.523893    2.389948    0.429809    0.235702 std     14.678201   43.138263    0.813580    1.061811    0.612294 min      0.420000    0.000000    1.000000    0.000000    0.000000 25%     21.000000    7.895800    2.000000    0.000000    0.000000 50%     29.000000   10.500000    3.000000    0.000000    0.000000 75%     39.000000   26.550000    3.000000    0.000000    0.000000 max     80.000000  512.329200    3.000000    8.000000    5.000000 ===== test: males               Age        Fare      Pclass       SibSp       Parch count  205.000000  265.000000  266.000000  266.000000  266.000000 mean    30.272732   27.527877    2.334586    0.379699    0.274436 std     13.389528   41.079423    0.808497    0.843735    0.883745 min      0.330000    0.000000    1.000000    0.000000    0.000000 25%     22.000000    7.854200    2.000000    0.000000    0.000000 50%     27.000000   13.000000    3.000000    0.000000    0.000000 75%     40.000000   26.550000    3.000000    1.000000    0.000000 max     67.000000  262.375000    3.000000    8.000000    9.000000 ===== train: females               Age        Fare      Pclass       SibSp       Parch count  261.000000  314.000000  314.000000  314.000000  314.000000 mean    27.915709   44.479818    2.159236    0.694268    0.649682 std     14.110146   57.997698    0.857290    1.156520    1.022846 min      0.750000    6.750000    1.000000    0.000000    0.000000 25%     18.000000   12.071875    1.000000    0.000000    0.000000 50%     27.000000   23.000000    2.000000    0.000000    0.000000 75%     37.000000   55.000000    3.000000    1.000000    1.000000 max     63.000000  512.329200    3.000000    8.000000    6.000000 ===== test: females               Age        Fare      Pclass       SibSp       Parch count  127.000000  152.000000  152.000000  152.000000  152.000000 mean    30.272362   49.747699    2.144737    0.565789    0.598684 std     15.428613   73.108716    0.887051    0.974313    1.105434 min      0.170000    6.950000    1.000000    0.000000    0.000000 25%     20.500000    8.626050    1.000000    0.000000    0.000000 50%     27.000000   21.512500    2.000000    0.000000    0.000000 75%     38.500000   55.441700    3.000000    1.000000    1.000000 max     76.000000  512.329200    3.000000    8.000000    9.000000 <\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0412\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u043f\u043e \u0441\u0440\u0435\u0434\u043d\u0438\u043c \u0438 \u043f\u0435\u0440\u0446\u0435\u043d\u0442\u0438\u043b\u044f\u043c \u0432\u0441\u0435 \u0432 \u0446\u0435\u043b\u043e\u043c \u0440\u043e\u0432\u043d\u0435\u043d\u044c\u043a\u043e. \u041d\u043e \u0443 \u043c\u0443\u0436\u0447\u0438\u043d \u043f\u043e \u0432\u044b\u0431\u043e\u0440\u043a\u0430\u043c \u043e\u0442\u043b\u0438\u0447\u0430\u044e\u0442\u0441\u044f \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c\u044b \u043f\u043e \u0432\u043e\u0437\u0440\u0430\u0441\u0442\u0443 \u0438 \u043f\u043e \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u0438 \u0431\u0438\u043b\u0435\u0442\u0430. \u0423 \u0436\u0435\u043d\u0449\u0438\u043d \u0432 \u043e\u0431\u0435\u0438\u0445 \u0432\u044b\u0431\u043e\u0440\u043a\u0430\u0445 \u0442\u0430\u043a\u0436\u0435 \u0435\u0441\u0442\u044c \u0440\u0430\u0437\u043b\u0438\u0447\u0438\u0435 \u0432 \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c\u0435 \u0432\u043e\u0437\u0440\u0430\u0441\u0442\u0430.<\/p>\n<h1>\u0421\u0431\u043e\u0440\u043a\u0430 \u0434\u0430\u0439\u0434\u0436\u0435\u0441\u0442\u0430 \u043f\u043e \u0434\u0430\u043d\u043d\u044b\u043c<\/h1>\n<p>  \u0421\u043e\u0431\u0435\u0440\u0435\u043c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0434\u0430\u0439\u0434\u0436\u0435\u0441\u0442 \u043f\u043e \u043f\u043e\u043b\u043d\u043e\u0439 \u0432\u044b\u0431\u043e\u0440\u043a\u0435 \u2014 \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u043d\u0443\u0436\u0435\u043d \u0434\u043b\u044f \u0434\u0430\u043b\u044c\u0448\u0435\u0439\u0448\u0435\u0433\u043e \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0432\u044b\u0431\u043e\u0440\u043e\u043a. \u0412 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u044b \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u043f\u043e\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b \u0432\u043c\u0435\u0441\u0442\u043e \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0441\u043f\u0440\u0430\u0432\u043e\u0447\u043d\u0438\u043a\u0438 \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0430 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432 \u0447\u0438\u0441\u043b\u043e\u0432\u044b\u0435. \u0414\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043c\u043d\u043e\u0433\u0438\u0435 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u044b \u043c\u043e\u0433\u0443\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0441 \u0447\u0438\u0441\u043b\u0430\u043c\u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043a\u0430\u043a\u0438\u043c-\u0442\u043e \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u043f\u0435\u0440\u0435\u0432\u0435\u0441\u0442\u0438 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0438 \u0432 \u0447\u0438\u0441\u043b\u043e\u0432\u044b\u0435, \u043d\u043e \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e \u043e\u0442 \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043d\u0430\u043c \u0431\u0443\u0434\u0443\u0442 \u043d\u0443\u0436\u043d\u044b \u0441\u043f\u0440\u0430\u0432\u043e\u0447\u043d\u0438\u043a\u0438 \u044d\u0442\u0438\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439. <\/p>\n<pre><code class=\"python\">class DataDigest:      def __init__(self):         self.ages = None         self.fares = None         self.titles = None         self.cabins = None         self.families = None         self.tickets = None  def get_title(name):     if pd.isnull(name):         return &quot;Null&quot;      title_search = re.search(' ([A-Za-z]+)\\.', name)     if title_search:         return title_search.group(1).lower()     else:         return &quot;None&quot;   def get_family(row):     last_name = row[&quot;Name&quot;].split(&quot;,&quot;)[0]     if last_name:         family_size = 1 + row[&quot;Parch&quot;] + row[&quot;SibSp&quot;]         if family_size &gt; 3:             return &quot;{0}_{1}&quot;.format(last_name.lower(), family_size)         else:             return &quot;nofamily&quot;     else:         return &quot;unknown&quot;   data_digest = DataDigest() data_digest.ages = all_data.groupby(&quot;Sex&quot;)[&quot;Age&quot;].median() data_digest.fares = all_data.groupby(&quot;Pclass&quot;)[&quot;Fare&quot;].median() data_digest.titles = pd.Index(test_data[&quot;Name&quot;].apply(get_title).unique()) data_digest.families = pd.Index(test_data.apply(get_family, axis=1).unique()) data_digest.cabins = pd.Index(test_data[&quot;Cabin&quot;].fillna(&quot;unknown&quot;).unique()) data_digest.tickets = pd.Index(test_data[&quot;Ticket&quot;].fillna(&quot;unknown&quot;).unique()) <\/code><\/pre>\n<p>  \u041d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u0435 \u043f\u043e \u043f\u043e\u043b\u044f\u043c \u0434\u0430\u0439\u0434\u0436\u0435\u0441\u0442\u0430:  <\/p>\n<ul>\n<li>ages \u2014 \u0441\u043f\u0440\u0430\u0432\u043e\u0447\u043d\u0438\u043a \u043c\u0435\u0434\u0438\u0430\u043d \u0432\u043e\u0437\u0440\u0430\u0441\u0442\u043e\u0432 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043f\u043e\u043b\u0430;<\/li>\n<li>fares \u2014 \u0441\u043f\u0440\u0430\u0432\u043e\u0447\u043d\u0438\u043a \u043c\u0435\u0434\u0438\u0430\u043d \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u0438 \u0431\u0438\u043b\u0435\u0442\u043e\u0432 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043a\u043b\u0430\u0441\u0441\u0430 \u0431\u0438\u043b\u0435\u0442\u0430;<\/li>\n<li>titles \u2014 \u0441\u043f\u0440\u0430\u0432\u043e\u0447\u043d\u0438\u043a \u0442\u0438\u0442\u0443\u043b\u043e\u0432;<\/li>\n<li>families \u2014 \u0441\u043f\u0440\u0430\u0432\u043e\u0447\u043d\u0438\u043a \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u043e\u0432 \u0441\u0435\u043c\u0435\u0439\u0441\u0442\u0432 (\u0444\u0430\u043c\u0438\u043b\u0438\u044f + \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0447\u043b\u0435\u043d\u043e\u0432 \u0441\u0435\u043c\u044c\u0438);<\/li>\n<li>cabins \u2014 \u0441\u043f\u0440\u0430\u0432\u043e\u0447\u043d\u0438\u043a \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u043e\u0432 \u043a\u0430\u044e\u0442;<\/li>\n<li>tickets \u2014 \u0441\u043f\u0440\u0430\u0432\u043e\u0447\u043d\u0438\u043a \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u043e\u0432 \u0431\u0438\u043b\u0435\u0442\u043e\u0432.<\/li>\n<\/ul>\n<p>  \u0421\u043f\u0440\u0430\u0432\u043e\u0447\u043d\u0438\u043a\u0438 \u0434\u043b\u044f \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 (\u043c\u0435\u0434\u0438\u0430\u043d\u044b) \u043c\u044b \u0441\u0442\u0440\u043e\u0438\u043c \u043f\u043e \u043a\u043e\u043c\u0431\u0438\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u0432\u044b\u0431\u043e\u0440\u043a\u0435. \u0410 \u0432\u043e\u0442 \u0441\u043f\u0440\u0430\u0432\u043e\u0447\u043d\u0438\u043a\u0438 \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0430 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432 \u2014 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u043c \u0434\u0430\u043d\u043d\u044b\u043c. \u0418\u0434\u0435\u044f \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u043b\u0430\u0441\u044c \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c: \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c \u0432 train-\u043d\u0430\u0431\u043e\u0440\u0435 \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0444\u0430\u043c\u0438\u043b\u0438\u044f \u00ab\u0418\u0432\u0430\u043d\u043e\u0432\u00bb, \u0430 \u0432 test-\u043d\u0430\u0431\u043e\u0440\u0435 \u044d\u0442\u043e\u0439 \u0444\u0430\u043c\u0438\u043b\u0438\u0438 \u043d\u0435\u0442. \u0417\u043d\u0430\u043d\u0438\u0435 \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0430 \u043e \u0442\u043e\u043c \u0447\u0442\u043e \u00ab\u0418\u0432\u0430\u043d\u043e\u0432\u00bb \u0432\u044b\u0436\u0438\u043b (\u0438\u043b\u0438 \u043d\u0435 \u0432\u044b\u0436\u0438\u043b) \u043d\u0438\u043a\u0430\u043a \u043d\u0435 \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u0432 \u043e\u0446\u0435\u043d\u043a\u0435 test-\u043d\u0430\u0431\u043e\u0440\u0430, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0432 test-\u043d\u0430\u0431\u043e\u0440\u0435 \u044d\u0442\u043e\u0439 \u0444\u0430\u043c\u0438\u043b\u0438\u0438 \u0432\u0441\u0435 \u0440\u0430\u0432\u043d\u043e \u043d\u0435\u0442. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432 \u0441\u043f\u0440\u0430\u0432\u043e\u0447\u043d\u0438\u043a \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0435 \u0444\u0430\u043c\u0438\u043b\u0438\u0438 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0435\u0441\u0442\u044c \u0432 test-\u043d\u0430\u0431\u043e\u0440\u0435. \u0415\u0449\u0435 \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u0432 \u0441\u043f\u0440\u0430\u0432\u043e\u0447\u043d\u0438\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0435\u0440\u0435c\u0435\u0447\u0435\u043d\u0438\u0435 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432 (\u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0435 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0438 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0435\u0441\u0442\u044c \u0432 \u043e\u0431\u043e\u0438\u0445 \u043d\u0430\u0431\u043e\u0440\u0430\u0445) \u2014 \u044f \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u043b, \u043d\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u0435\u0440\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0443\u0445\u0443\u0434\u0448\u0438\u043b\u0441\u044f \u043d\u0430 3 \u043f\u0440\u043e\u0446\u0435\u043d\u0442\u0430.<\/p>\n<h1>\u0412\u044b\u0434\u0435\u043b\u044f\u0435\u043c \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0438<\/h1>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u0434\u0435\u043b\u0438\u0442\u044c \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0438. \u041a\u0430\u043a \u0443\u0436\u0435 \u0431\u044b\u043b\u043e \u0441\u043a\u0430\u0437\u0430\u043d\u043e \u2014 \u043c\u043d\u043e\u0433\u0438\u0435 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u044b \u0443\u043c\u0435\u044e\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0441 \u0447\u0438\u0441\u043b\u0430\u043c\u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e:<\/p>\n<ul>\n<li>\u041f\u0435\u0440\u0435\u0432\u0435\u0441\u0442\u0438 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0438 \u0432 \u0447\u0438\u0441\u043b\u043e\u0432\u043e\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435<\/li>\n<li>\u0412\u044b\u0434\u0435\u043b\u0438\u0442\u044c \u043d\u0435\u044f\u0432\u043d\u044b\u0435 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0438, \u0442\u043e \u0435\u0441\u0442\u044c \u0442\u0435 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044f\u0432\u043d\u043e \u043d\u0435 \u0437\u0430\u0434\u0430\u043d\u044b (\u0442\u0438\u0442\u0443\u043b, \u043f\u0430\u043b\u0443\u0431\u0430)<\/li>\n<li>\u0427\u0442\u043e-\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438<\/li>\n<\/ul>\n<p>  \u0415\u0441\u0442\u044c \u0434\u0432\u0430 \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0430 \u0432 \u0447\u0438\u0441\u043b\u043e\u0432\u043e\u0439. \u041c\u043e\u0436\u0435\u043c \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0437\u0430\u0434\u0430\u0447\u0443 \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043f\u043e\u043b\u0430 \u043f\u0430\u0441\u0441\u0430\u0436\u0438\u0440\u0430.<\/p>\n<p>  \u0412 \u043f\u0435\u0440\u0432\u043e\u043c \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0435 \u043c\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u043c\u0435\u043d\u044f\u0435\u043c \u043f\u043e\u043b \u043d\u0430 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0447\u0438\u0441\u043b\u043e, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c female \u043d\u0430 0, \u0430 male \u043d\u0430 1 (<em>\u043a\u0440\u0443\u0433\u043b\u044f\u0448\u043e\u043a \u0438 \u043f\u0430\u043b\u043e\u0447\u043a\u0430 \u2014 \u043e\u0447\u0435\u043d\u044c \u0443\u0434\u043e\u0431\u043d\u043e \u0437\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u0442\u044c<\/em>). \u0422\u0430\u043a\u043e\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043d\u0435 \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0435\u0442 \u0447\u0438\u0441\u043b\u043e \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432, \u043e\u0434\u043d\u0430\u043a\u043e \u0432\u043d\u0443\u0442\u0440\u0438 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0430 \u0434\u043b\u044f \u0435\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u0435 \u00ab\u0431\u043e\u043b\u044c\u0448\u0435\u00bb \u0438 \u00ab\u043c\u0435\u043d\u044c\u0448\u0435\u00bb. \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u043a\u043e\u0433\u0434\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043c\u043d\u043e\u0433\u043e, \u0442\u0430\u043a\u043e\u0435 \u043d\u0435\u043e\u0436\u0438\u0434\u0430\u043d\u043d\u043e\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0430 \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u0436\u0435\u043b\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0438 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043a \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u043c \u0432 \u0433\u0435\u043e\u043c\u0435\u0442\u0440\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0430\u0445. <\/p>\n<p>  \u0412\u0442\u043e\u0440\u043e\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u2014 \u0437\u0430\u0432\u0435\u0441\u0442\u0438 \u0434\u0432\u0435 \u043a\u043e\u043b\u043e\u043d\u043a\u0438 \u00absex_male\u00bb \u0438 \u00absex_female\u00bb. \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u0443\u0436\u0441\u043a\u043e\u0433\u043e \u043f\u043e\u043b\u0430 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0442\u044c sex_male=1, sex_female=0. \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0436\u0435\u043d\u0441\u043a\u043e\u0433\u043e \u043f\u043e\u043b\u0430 \u043d\u0430\u043e\u0431\u043e\u0440\u043e\u0442: sex_male=0, sex_female=1. \u041e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u0439 \u00ab\u0431\u043e\u043b\u044c\u0448\u0435\u00bb\/\u00ab\u043c\u0435\u043d\u044c\u0448\u0435\u00bb \u043c\u044b \u0442\u0435\u043f\u0435\u0440\u044c \u0438\u0437\u0431\u0435\u0433\u0430\u0435\u043c, \u043e\u0434\u043d\u0430\u043a\u043e \u0442\u0435\u043f\u0435\u0440\u044c \u0443 \u043d\u0430\u0441 \u0441\u0442\u0430\u043b\u043e \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432, \u0430 \u0447\u0435\u043c \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432 \u0442\u0435\u043c \u0431\u043e\u043b\u044c\u0448\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043b\u044f \u0442\u0440\u0435\u043d\u0438\u0440\u043e\u0432\u043a\u0438 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0430 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u2014 \u044d\u0442\u0430 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u0430 \u043a\u0430\u043a <a href=\"https:\/\/ru.wikipedia.org\/wiki\/%D0%9F%D1%80%D0%BE%D0%BA%D0%BB%D1%8F%D1%82%D0%B8%D0%B5_%D1%80%D0%B0%D0%B7%D0%BC%D0%B5%D1%80%D0%BD%D0%BE%D1%81%D1%82%D0%B8\">\u00ab\u043f\u0440\u043e\u043a\u043b\u044f\u0442\u0438\u0435 \u0440\u0430\u0437\u043c\u0435\u0440\u043d\u043e\u0441\u0442\u0438\u00bb<\/a>. \u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0441\u043b\u043e\u0436\u043d\u043e\u0439 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f \u043a\u043e\u0433\u0434\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432 \u043e\u0447\u0435\u043d\u044c \u043c\u043d\u043e\u0433\u043e, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u044b \u0431\u0438\u043b\u0435\u0442\u043e\u0432, \u0432 \u0442\u0430\u043a\u0438\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u043e\u0442\u043a\u0438\u043d\u0443\u0442\u044c \u0440\u0435\u0434\u043a\u043e \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u044e\u0449\u0438\u0435\u0441\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u043e\u0434\u0441\u0442\u0430\u0432\u0438\u0432 \u0432\u043c\u0435\u0441\u0442\u043e \u043d\u0438\u0445 \u043a\u0430\u043a\u043e\u0439-\u043d\u0438\u0431\u0443\u0434\u044c \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u0442\u0435\u0433 \u2014 \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0443\u043c\u0435\u043d\u044c\u0448\u0438\u0432 \u0438\u0442\u043e\u0433\u043e\u0432\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432 \u043f\u043e\u0441\u043b\u0435 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f.<\/p>\n<p>  \u041d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0441\u043f\u043e\u0439\u043b\u0435\u0440: \u043c\u044b \u0434\u0435\u043b\u0430\u0435\u043c \u0441\u0442\u0430\u0432\u043a\u0438 \u0432 \u043f\u0435\u0440\u0432\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u043d\u0430 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 Random Forest. \u0412\u043e-\u043f\u0435\u0440\u0432\u044b\u0445 <em>\u0432\u0441\u0435 \u0442\u0430\u043a \u0434\u0435\u043b\u0430\u044e\u0442<\/em>, \u0430 \u0432\u043e-\u0432\u0442\u043e\u0440\u044b\u0445 \u043e\u043d \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432, \u0443\u0441\u0442\u043e\u0439\u0447\u0438\u0432 \u043a \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0443 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432 \u0438 \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0431\u044b\u0441\u0442\u0440\u043e. \u041d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u044d\u0442\u043e, \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0438 \u043c\u044b \u0433\u043e\u0442\u043e\u0432\u0438\u043c \u0432 \u043e\u0431\u0449\u0435\u043c \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u043e\u043c \u0432\u0438\u0434\u0435 \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0433\u043b\u0430\u0432\u043d\u0430\u044f \u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u0430\u044f \u043f\u0435\u0440\u0435\u0434 \u0441\u043e\u0431\u043e\u0439 \u0446\u0435\u043b\u044c \u2014 \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u044b \u0440\u0430\u0431\u043e\u0442\u044b \u0441 sklearn \u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438. <\/p>\n<p>  \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0438 \u043c\u044b \u0437\u0430\u043c\u0435\u043d\u044f\u0435\u043c \u043d\u0430 \u0447\u0438\u0441\u043b\u0430, \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0435\u043c, \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u0438 \u0437\u0430\u043c\u0435\u043d\u044f\u0435\u043c \u0438 \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0435\u043c. \u041c\u044b \u043d\u0435 \u044d\u043a\u043e\u043d\u043e\u043c\u0438\u043c \u043d\u0430 \u0447\u0438\u0441\u043b\u0435 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0432 \u0434\u0430\u043b\u044c\u0448\u0435\u0439\u0448\u0435\u043c \u043c\u044b \u0432\u0441\u0435\u0433\u0434\u0430 \u043c\u043e\u0436\u0435\u043c \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u043a\u0430\u043a\u0438\u0435 \u0438\u043c\u0435\u043d\u043d\u043e \u0438\u0437 \u043d\u0438\u0445 \u0431\u0443\u0434\u0443\u0442 \u0443\u0447\u0430\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0432 \u0440\u0430\u0431\u043e\u0442\u0435. <\/p>\n<p>  \u0412 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0435 \u043f\u043e\u0441\u043e\u0431\u0438\u0439 \u0438 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u0438\u0437 \u0441\u0435\u0442\u0438 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0435 \u043d\u0430\u0431\u043e\u0440\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u043e\u0447\u0435\u043d\u044c \u0432\u043e\u043b\u044c\u043d\u043e \u043c\u043e\u0434\u0438\u0444\u0438\u0446\u0438\u0440\u0443\u044e\u0442\u0441\u044f: \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0435 \u043a\u043e\u043b\u043e\u043d\u043a\u0438 \u0437\u0430\u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f \u043d\u043e\u0432\u044b\u043c\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438, \u043d\u0435\u043d\u0443\u0436\u043d\u044b\u0435 \u043a\u043e\u043b\u043e\u043d\u043a\u0438 \u0443\u0434\u0430\u043b\u044f\u044e\u0442\u0441\u044f \u0438 \u0442.\u0434. \u0412 \u044d\u0442\u043e\u043c \u043d\u0435\u0442 \u043d\u0438\u043a\u0430\u043a\u043e\u0439 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u043f\u043e\u043a\u0430 \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438: \u0432\u0441\u0435\u0433\u0434\u0430 \u043b\u0443\u0447\u0448\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u043d\u043e\u0432\u044b\u0435 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0438 \u043a \u043d\u0430\u0431\u043e\u0440\u0443 \u043d\u0438\u043a\u0430\u043a \u043d\u0435 \u0438\u0437\u043c\u0435\u043d\u044f\u044f \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 pandas \u0432\u043f\u043e\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0438 \u0432\u0441\u0435\u0433\u0434\u0430 \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u043d\u0430\u043c \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0443\u0436\u043d\u044b\u0435. <\/p>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043c\u0435\u0442\u043e\u0434 \u0434\u043b\u044f \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043d\u0430\u0431\u043e\u0440\u043e\u0432 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<pre><code class=\"python\">def get_index(item, index):     if pd.isnull(item):         return -1      try:         return index.get_loc(item)     except KeyError:         return -1   def munge_data(data, digest):     # Age - \u0437\u0430\u043c\u0435\u043d\u0430 \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u043e\u0432 \u043d\u0430 \u043c\u0435\u0434\u0438\u0430\u043d\u0443 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043f\u043e\u043b\u0430     data[&quot;AgeF&quot;] = data.apply(lambda r: digest.ages[r[&quot;Sex&quot;]] if pd.isnull(r[&quot;Age&quot;]) else r[&quot;Age&quot;], axis=1)      # Fare - \u0437\u0430\u043c\u0435\u043d\u0430 \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u043e\u0432 \u043d\u0430 \u043c\u0435\u0434\u0438\u0430\u043d\u0443 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043a\u043b\u0430\u0441\u0441\u0430     data[&quot;FareF&quot;] = data.apply(lambda r: digest.fares[r[&quot;Pclass&quot;]] if pd.isnull(r[&quot;Fare&quot;]) else r[&quot;Fare&quot;], axis=1)      # Gender - \u0437\u0430\u043c\u0435\u043d\u0430     genders = {&quot;male&quot;: 1, &quot;female&quot;: 0}     data[&quot;SexF&quot;] = data[&quot;Sex&quot;].apply(lambda s: genders.get(s))      # Gender - \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435     gender_dummies = pd.get_dummies(data[&quot;Sex&quot;], prefix=&quot;SexD&quot;, dummy_na=False)     data = pd.concat([data, gender_dummies], axis=1)      # Embarkment - \u0437\u0430\u043c\u0435\u043d\u0430     embarkments = {&quot;U&quot;: 0, &quot;S&quot;: 1, &quot;C&quot;: 2, &quot;Q&quot;: 3}     data[&quot;EmbarkedF&quot;] = data[&quot;Embarked&quot;].fillna(&quot;U&quot;).apply(lambda e: embarkments.get(e))      # Embarkment - \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435     embarkment_dummies = pd.get_dummies(data[&quot;Embarked&quot;], prefix=&quot;EmbarkedD&quot;, dummy_na=False)     data = pd.concat([data, embarkment_dummies], axis=1)      # \u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0440\u043e\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u0438\u043a\u043e\u0432 \u043d\u0430 \u0431\u043e\u0440\u0442\u0443     data[&quot;RelativesF&quot;] = data[&quot;Parch&quot;] + data[&quot;SibSp&quot;]      # \u0427\u0435\u043b\u043e\u0432\u0435\u043a-\u043e\u0434\u0438\u043d\u043e\u0447\u043a\u0430?     data[&quot;SingleF&quot;] = data[&quot;RelativesF&quot;].apply(lambda r: 1 if r == 0 else 0)      # Deck - \u0437\u0430\u043c\u0435\u043d\u0430     decks = {&quot;U&quot;: 0, &quot;A&quot;: 1, &quot;B&quot;: 2, &quot;C&quot;: 3, &quot;D&quot;: 4, &quot;E&quot;: 5, &quot;F&quot;: 6, &quot;G&quot;: 7, &quot;T&quot;: 8}     data[&quot;DeckF&quot;] = data[&quot;Cabin&quot;].fillna(&quot;U&quot;).apply(lambda c: decks.get(c[0], -1))      # Deck - \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435     deck_dummies = pd.get_dummies(data[&quot;Cabin&quot;].fillna(&quot;U&quot;).apply(lambda c: c[0]), prefix=&quot;DeckD&quot;, dummy_na=False)     data = pd.concat([data, deck_dummies], axis=1)      # Titles - \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435     title_dummies = pd.get_dummies(data[&quot;Name&quot;].apply(lambda n: get_title(n)), prefix=&quot;TitleD&quot;, dummy_na=False)     data = pd.concat([data, title_dummies], axis=1)      # \u0430\u043c\u0435\u043d\u0430 \u0442\u0435\u043a\u0441\u0442\u043e\u0432 \u043d\u0430 \u0438\u043d\u0434\u0435\u043a\u0441 \u0438\u0437 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0433\u043e \u0441\u043f\u0440\u0430\u0432\u043e\u0447\u043d\u0438\u043a\u0430 \u0438\u043b\u0438 -1 \u0435\u0441\u043b\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432 \u0441\u043f\u0440\u0430\u0432\u043e\u0447\u043d\u0438\u043a\u0435 \u043d\u0435\u0442 (\u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0442\u044c \u043d\u0435 \u0431\u0443\u0434\u0435\u043c)     data[&quot;CabinF&quot;] = data[&quot;Cabin&quot;].fillna(&quot;unknown&quot;).apply(lambda c: get_index(c, digest.cabins))      data[&quot;TitleF&quot;] = data[&quot;Name&quot;].apply(lambda n: get_index(get_title(n), digest.titles))      data[&quot;TicketF&quot;] = data[&quot;Ticket&quot;].apply(lambda t: get_index(t, digest.tickets))      data[&quot;FamilyF&quot;] = data.apply(lambda r: get_index(get_family(r), digest.families), axis=1)      # \u0434\u043b\u044f \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0438     age_bins = [0, 5, 10, 15, 20, 25, 30, 40, 50, 60, 70, 80, 90]     data[&quot;AgeR&quot;] = pd.cut(data[&quot;Age&quot;].fillna(-1), bins=age_bins).astype(object)      return data <\/code><\/pre>\n<p>  \u041d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u0435 \u043f\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044e \u043d\u043e\u0432\u044b\u0445 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432:  <\/p>\n<ul>\n<li>\u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0438\u043d\u0434\u0435\u043a\u0441 \u043a\u0430\u044e\u0442\u044b<\/li>\n<li>\u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0438\u043d\u0434\u0435\u043a\u0441 \u043f\u0430\u043b\u0443\u0431\u044b (\u0432\u044b\u0440\u0435\u0437\u0430\u0435\u043c \u0438\u0437 \u043d\u043e\u043c\u0435\u0440\u0430 \u043a\u0430\u044e\u0442\u044b)<\/li>\n<li>\u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0438\u043d\u0434\u0435\u043a\u0441 \u0431\u0438\u043b\u0435\u0442\u0430<\/li>\n<li>\u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0438\u043d\u0434\u0435\u043a\u0441 \u0442\u0438\u0442\u0443\u043b\u0430 (\u0432\u044b\u0440\u0435\u0437\u0430\u0435\u043c \u0438\u0437 \u0438\u043c\u0435\u043d\u0438)<\/li>\n<li>\u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0438\u043d\u0434\u0435\u043a\u0441 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0430 \u0441\u0435\u043c\u044c\u0438 (\u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u043c \u0438\u0437 \u0444\u0430\u043c\u0438\u043b\u0438\u0438 \u0438 \u0447\u0438\u0441\u043b\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0441\u0435\u043c\u0435\u0439\u0441\u0442\u0432\u0430)<\/li>\n<\/ul>\n<p>  \u0412 \u043e\u0431\u0449\u0435\u043c, \u043c\u044b \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0432 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0438 \u0432\u043e\u043e\u0431\u0449\u0435 \u0432\u0441\u0435 \u0447\u0442\u043e \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u0432 \u0433\u043e\u043b\u043e\u0432\u0443. \u0412\u0438\u0434\u043d\u043e \u0447\u0442\u043e \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0438 \u0434\u0443\u0431\u043b\u0438\u0440\u0443\u044e\u0442 \u0434\u0440\u0443\u0433 \u0434\u0440\u0443\u0433\u0430 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 \u0438 \u0437\u0430\u043c\u0435\u043d\u0430 \u043f\u043e\u043b\u0430), \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044f\u0432\u043d\u043e \u043a\u043e\u0440\u0440\u0435\u043b\u0438\u0440\u0443\u044e\u0442 \u0434\u0440\u0443\u0433 \u0441 \u0434\u0440\u0443\u0433\u043e\u043c (\u043a\u043b\u0430\u0441\u0441 \u0431\u0438\u043b\u0435\u0442\u0430 \u0438 \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c \u0431\u0438\u043b\u0435\u0442\u0430), \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044f\u0432\u043d\u043e \u0431\u0435\u0441\u0441\u043c\u044b\u0441\u043b\u0435\u043d\u043d\u044b (\u0432\u0440\u044f\u0434 \u043b\u0438 \u043f\u043e\u0440\u0442 \u043f\u043e\u0441\u0430\u0434\u043a\u0438 \u0432\u043b\u0438\u044f\u0435\u0442 \u043d\u0430 \u0432\u044b\u0436\u0438\u0432\u0430\u0435\u043c\u043e\u0441\u0442\u044c). \u0420\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c\u0441\u044f \u0441\u043e \u0432\u0441\u0435\u043c \u044d\u0442\u0438\u043c \u0431\u0443\u0434\u0435\u043c \u043f\u043e\u0437\u0436\u0435 \u2014 \u043a\u043e\u0433\u0434\u0430 \u0431\u0443\u0434\u0435\u043c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u044c \u043e\u0442\u0431\u043e\u0440 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432 \u0434\u043b\u044f \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f.<\/p>\n<p>  \u041f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u043c \u043e\u0431\u0430 \u0438\u043c\u0435\u044e\u0449\u0438\u0445\u0441\u044f \u043d\u0430\u0431\u043e\u0440\u0430 \u0438 \u0442\u0430\u043a\u0436\u0435 \u043e\u043f\u044f\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u043d\u044b\u0439 \u043d\u0430\u0431\u043e\u0440.<\/p>\n<pre><code class=\"python\">train_data_munged = munge_data(train_data, data_digest) test_data_munged = munge_data(test_data, data_digest) all_data_munged = pd.concat([train_data_munged, test_data_munged]) <\/code><\/pre>\n<p>  \u0425\u043e\u0442\u044f \u043c\u044b \u043d\u0430\u0446\u0435\u043b\u0438\u043b\u0438\u0441\u044c \u043d\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 Random Forest \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u044b. \u0410 \u0441 \u043d\u0438\u043c\u0438 \u0435\u0441\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0430\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430: \u043c\u043d\u043e\u0433\u0438\u0435 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u044b \u0447\u0443\u0432\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u044b \u043a \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0443 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432. \u0414\u0440\u0443\u0433\u0438\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438 \u0435\u0441\u043b\u0438 \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043e\u0434\u0438\u043d \u043f\u0440\u0438\u0437\u043d\u0430\u043a \u0441\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438 \u043e\u0442 [-10,5] \u0438 \u0432\u0442\u043e\u0440\u043e\u0439 \u043f\u0440\u0438\u0437\u043d\u0430\u043a \u0441\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438 [0,10000] \u0442\u043e \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u0430\u044f \u0432 \u043f\u0440\u043e\u0446\u0435\u043d\u0442\u043d\u043e\u043c \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u0438 \u043e\u0448\u0438\u0431\u043a\u0430 \u043d\u0430 \u043e\u0431\u043e\u0438\u0445 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0430\u0445 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442\u044c \u043a \u0431\u043e\u043b\u044c\u0448\u043e\u043c\u0443 \u043e\u0442\u043b\u0438\u0447\u0438\u044e \u0432 \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0438 \u0438 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0431\u0443\u0434\u0435\u0442 \u0442\u0440\u0430\u043a\u0442\u043e\u0432\u0430\u0442\u044c \u0432\u0442\u043e\u0440\u043e\u0439 \u043f\u0440\u0438\u0437\u043d\u0430\u043a \u043a\u0430\u043a \u0431\u043e\u043b\u0435\u0435 \u0432\u0430\u0436\u043d\u044b\u0439.<\/p>\n<p>  \u0427\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u044d\u0442\u043e\u0433\u043e \u043c\u044b \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u043c \u0432\u0441\u0435 \u0447\u0438\u0441\u043b\u043e\u0432\u044b\u0435 (\u0430 \u0434\u0440\u0443\u0433\u0438\u0445 \u0443 \u043d\u0430\u0441 \u0443\u0436\u0435 \u043d\u0435\u0442) \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0438 \u043a \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e\u0439 \u0448\u043a\u0430\u043b\u0435 [-1,1] \u0438 \u043d\u0443\u043b\u0435\u0432\u043e\u043c\u0443 \u0441\u0440\u0435\u0434\u043d\u0435\u043c\u0443 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e. \u0421\u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u0432 sklearn \u043c\u043e\u0436\u043d\u043e \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e.<\/p>\n<pre><code class=\"python\">scaler = StandardScaler() scaler.fit(all_data_munged[predictors])  train_data_scaled = scaler.transform(train_data_munged[predictors]) test_data_scaled = scaler.transform(test_data_munged[predictors]) <\/code><\/pre>\n<p>  \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043c\u044b \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u043c \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u044b \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f (\u0441\u043d\u043e\u0432\u0430 \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u043b\u0441\u044f \u043f\u043e\u043b\u043d\u044b\u0439 \u043d\u0430\u0431\u043e\u0440), \u0430 \u0437\u0430\u0442\u0435\u043c \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u0443\u0435\u043c \u043e\u0431\u0430 \u043d\u0430\u0431\u043e\u0440\u0430 \u0438\u043d\u0434\u0438\u0432\u0438\u0434\u0443\u0430\u043b\u044c\u043d\u043e.<\/p>\n<h1>\u0412\u044b\u0431\u043e\u0440 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432<\/h1>\n<p>  \u041d\u0443 \u0438 \u043f\u0440\u0438\u0448\u0435\u043b \u043c\u043e\u043c\u0435\u043d\u0442 \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043e\u0442\u043e\u0431\u0440\u0430\u0442\u044c \u0442\u0435 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0438, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u0431\u0443\u0434\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0434\u0430\u043b\u044c\u0448\u0435.<\/p>\n<pre><code class=\"python\">predictors = [&quot;Pclass&quot;,               &quot;AgeF&quot;,               &quot;TitleF&quot;,               &quot;TitleD_mr&quot;, &quot;TitleD_mrs&quot;, &quot;TitleD_miss&quot;, &quot;TitleD_master&quot;, &quot;TitleD_ms&quot;,                &quot;TitleD_col&quot;, &quot;TitleD_rev&quot;, &quot;TitleD_dr&quot;,               &quot;CabinF&quot;,               &quot;DeckF&quot;,               &quot;DeckD_U&quot;, &quot;DeckD_A&quot;, &quot;DeckD_B&quot;, &quot;DeckD_C&quot;, &quot;DeckD_D&quot;, &quot;DeckD_E&quot;, &quot;DeckD_F&quot;, &quot;DeckD_G&quot;,               &quot;FamilyF&quot;,               &quot;TicketF&quot;,               &quot;SexF&quot;,               &quot;SexD_male&quot;, &quot;SexD_female&quot;,               &quot;EmbarkedF&quot;,               &quot;EmbarkedD_S&quot;, &quot;EmbarkedD_C&quot;, &quot;EmbarkedD_Q&quot;,               &quot;FareF&quot;,               &quot;SibSp&quot;, &quot;Parch&quot;,               &quot;RelativesF&quot;,               &quot;SingleF&quot;] <\/code><\/pre>\n<p>  \u041f\u0440\u043e\u0441\u0442\u043e \u0441\u0442\u0430\u0432\u0438\u043c \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439 \u043d\u0430 \u043d\u0435\u043d\u0443\u0436\u043d\u044b\u0445 \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435. \u041a\u0430\u043a\u0438\u0435 \u0438\u043c\u0435\u043d\u043d\u043e \u043d\u0435 \u043d\u0443\u0436\u043d\u044b \u2014 <em>\u0440\u0435\u0448\u0430\u0442\u044c \u0432\u0430\u043c<\/em>.<\/p>\n<h1>\u0415\u0449\u0435 \u0440\u0430\u0437 \u0430\u043d\u0430\u043b\u0438\u0437<\/h1>\n<p>  \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0442\u0435\u043f\u0435\u0440\u044c \u0443 \u043d\u0430\u0441 \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u043a\u043e\u043b\u043e\u043d\u043a\u0430 \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u043d \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u043f\u0430\u0434\u0430\u0435\u0442 \u0432\u043e\u0437\u0440\u0430\u0441\u0442 \u043f\u0430\u0441\u0441\u0430\u0436\u0438\u0440\u0430 \u2014 \u043e\u0446\u0435\u043d\u0438\u043c \u0432\u044b\u0436\u0438\u0432\u0430\u0435\u043c\u043e\u0441\u0442\u044c \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0432\u043e\u0437\u0440\u0430\u0441\u0442\u0430 (\u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0430). <\/p>\n<pre><code class=\"python\">print(&quot;===== survived by age&quot;) print(train_data.groupby([&quot;AgeR&quot;])[&quot;Survived&quot;].value_counts(normalize=True))  print(&quot;===== survived by gender and age&quot;) print(train_data.groupby([&quot;Sex&quot;, &quot;AgeR&quot;])[&quot;Survived&quot;].value_counts(normalize=True))  print(&quot;===== survived by class and age&quot;) print(train_data.groupby([&quot;Pclass&quot;, &quot;AgeR&quot;])[&quot;Survived&quot;].value_counts(normalize=True)) <\/code><\/pre>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre> ===== survived by age AgeR      Survived (0, 5]    1           0.704545           0           0.295455 (10, 15]  1           0.578947           0           0.421053 (15, 20]  0           0.656250           1           0.343750 (20, 25]  0           0.655738           1           0.344262 (25, 30]  0           0.611111           1           0.388889 (30, 40]  0           0.554839           1           0.445161 (40, 50]  0           0.616279           1           0.383721 (5, 10]   0           0.650000           1           0.350000 (50, 60]  0           0.595238           1           0.404762 (60, 70]  0           0.764706           1           0.235294 (70, 80]  0           0.800000           1           0.200000 dtype: float64 ===== survived by gender and age Sex     AgeR      Survived female  (0, 5]    1           0.761905                   0           0.238095         (10, 15]  1           0.750000                   0           0.250000         (15, 20]  1           0.735294                   0           0.264706         (20, 25]  1           0.755556                   0           0.244444         (25, 30]  1           0.750000                   0           0.250000         (30, 40]  1           0.836364                   0           0.163636         (40, 50]  1           0.677419                   0           0.322581         (5, 10]   0           0.700000                   1           0.300000         (50, 60]  1           0.928571                   0           0.071429         (60, 70]  1           1.000000 male    (0, 5]    1           0.652174                   0           0.347826         (10, 15]  0           0.714286                   1           0.285714         (15, 20]  0           0.870968                   1           0.129032         (20, 25]  0           0.896104                   1           0.103896         (25, 30]  0           0.791667                   1           0.208333         (30, 40]  0           0.770000                   1           0.230000         (40, 50]  0           0.781818                   1           0.218182         (5, 10]   0           0.600000                   1           0.400000         (50, 60]  0           0.857143                   1           0.142857         (60, 70]  0           0.928571                   1           0.071429         (70, 80]  0           0.800000                   1           0.200000 dtype: float64 ===== survived by class and age Pclass  AgeR      Survived 1       (0, 5]    1           0.666667                   0           0.333333         (10, 15]  1           1.000000         (15, 20]  1           0.800000                   0           0.200000         (20, 25]  1           0.761905                   0           0.238095         (25, 30]  1           0.684211                   0           0.315789         (30, 40]  1           0.755102                   0           0.244898         (40, 50]  1           0.567568                   0           0.432432         (50, 60]  1           0.600000                   0           0.400000         (60, 70]  0           0.818182                   1           0.181818         (70, 80]  0           0.666667                   1           0.333333 2       (0, 5]    1           1.000000         (10, 15]  1           1.000000         (15, 20]  0           0.562500                   1           0.437500         (20, 25]  0           0.600000                   1           0.400000         (25, 30]  0           0.580645                   1           0.419355         (30, 40]  0           0.558140                   1           0.441860         (40, 50]  1           0.526316                   0           0.473684         (5, 10]   1           1.000000         (50, 60]  0           0.833333                   1           0.166667         (60, 70]  0           0.666667                   1           0.333333 3       (0, 5]    1           0.571429                   0           0.428571         (10, 15]  0           0.571429                   1           0.428571         (15, 20]  0           0.784615                   1           0.215385         (20, 25]  0           0.802817                   1           0.197183         (25, 30]  0           0.724138                   1           0.275862         (30, 40]  0           0.793651                   1           0.206349         (40, 50]  0           0.933333                   1           0.066667         (5, 10]   0           0.812500                   1           0.187500         (50, 60]  0           1.000000         (60, 70]  0           0.666667                   1           0.333333         (70, 80]  0           1.000000 dtype: float64 <\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0412\u0438\u0434\u0438\u043c, \u0447\u0442\u043e \u0448\u0430\u043d\u0441\u044b \u043d\u0430 \u0432\u044b\u0436\u0438\u0432\u0430\u043d\u0438\u0435 \u0432\u0435\u043b\u0438\u043a\u0438 \u0443 \u0434\u0435\u0442\u0435\u0439 \u0434\u043e 5 \u043b\u0435\u0442, \u0430 \u0443\u0436\u0435 \u0432 \u043f\u043e\u0436\u0438\u043b\u043e\u043c \u0432\u043e\u0437\u0440\u0430\u0441\u0442\u0435 \u0448\u0430\u043d\u0441 \u0432\u044b\u0436\u0438\u0442\u044c \u043f\u0430\u0434\u0430\u0435\u0442 \u0441 \u0432\u043e\u0437\u0440\u0430\u0441\u0442\u043e\u043c. \u041d\u043e \u044d\u0442\u043e \u043d\u0435 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u043a \u0436\u0435\u043d\u0449\u0438\u043d\u0430\u043c \u2014 \u0443 \u0436\u0435\u043d\u0449\u0438\u043d\u044b \u0448\u0430\u043d\u0441 \u043d\u0430 \u0432\u044b\u0436\u0438\u0432\u0430\u0435\u043c\u043e\u0441\u0442\u044c \u0432\u0435\u043b\u0438\u043a \u0432 \u043b\u044e\u0431\u043e\u043c \u0432\u043e\u0437\u0440\u0430\u0441\u0442\u0435. <\/p>\n<p>  \u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u043e\u0442 <a href=\"http:\/\/stanford.edu\/~mwaskom\/software\/seaborn\/\">seaborn<\/a> \u2014 \u0443\u0436 \u043e\u0447\u0435\u043d\u044c \u043a\u0440\u0430\u0441\u0438\u0432\u044b\u0435 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438 \u043e\u043d\u0430 \u0434\u0430\u0435\u0442, \u0445\u043e\u0442\u044f \u044f \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u0440\u0438\u0432\u044b\u043a \u043a \u0442\u0435\u043a\u0441\u0442\u0443.<\/p>\n<pre><code class=\"python\">sns.pairplot(train_data_munged, vars=[&quot;AgeF&quot;, &quot;Pclass&quot;, &quot;SexF&quot;], hue=&quot;Survived&quot;, dropna=True) sns.plt.show() <\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/418\/edf\/72a\/418edf72a3aa44eb97b9fdfb39c307c6.png\"\/><\/p>\n<p>  \u041a\u0440\u0430\u0441\u0438\u0432\u043e, \u043d\u043e \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u044f \u0432 \u043f\u0430\u0440\u0435 \u00ab\u043a\u043b\u0430\u0441\u0441-\u043f\u043e\u043b\u00bb \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u0430.<\/p>\n<p>  \u041e\u0446\u0435\u043d\u0438\u043c \u0432\u0430\u0436\u043d\u043e\u0441\u0442\u044c \u043d\u0430\u0448\u0438\u0445 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u043c <a href=\"http:\/\/scikit-learn.org\/stable\/modules\/generated\/sklearn.feature_selection.SelectKBest.html\">SelectKBest<\/a>. <\/p>\n<pre><code class=\"python\">selector = SelectKBest(f_classif, k=5) selector.fit(train_data_munged[predictors], train_data_munged[&quot;Survived&quot;])  scores = -np.log10(selector.pvalues_)  plt.bar(range(len(predictors)), scores) plt.xticks(range(len(predictors)), predictors, rotation='vertical') plt.show() <\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/3bf\/0ba\/24e\/3bf0ba24e88d47ecb44c01c218aac755.png\"\/><\/p>\n<p>  \u0412\u043e\u0442 \u0432\u0430\u043c <a href=\"https:\/\/ru.wikipedia.org\/wiki\/F-%D1%82%D0%B5%D1%81%D1%82\">\u0441\u0442\u0430\u0442\u044c\u044f<\/a> \u0441 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435\u043c \u0442\u043e\u0433\u043e \u043a\u0430\u043a \u0438\u043c\u0435\u043d\u043d\u043e \u043e\u043d \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442. \u0412 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u0445 SelectKBest \u043c\u043e\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0438.<\/p>\n<p>  \u0412 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435, \u043c\u044b \u0438 \u0442\u0430\u043a \u0443\u0436\u0435 \u0432\u0441\u0435 \u0437\u043d\u0430\u0435\u043c \u2014 \u043e\u0447\u0435\u043d\u044c \u0432\u0430\u0436\u0435\u043d \u043f\u043e\u043b. \u0422\u0438\u0442\u0443\u043b\u044b \u0432\u0430\u0436\u043d\u044b \u2014 \u043d\u043e \u0443 \u043d\u0438\u0445 \u0441\u0438\u043b\u044c\u043d\u0430\u044f \u043a\u043e\u0440\u0440\u0435\u043b\u043b\u044f\u0446\u0438\u044f \u0441 \u043f\u043e\u043b\u043e\u043c. \u0412\u0430\u0436\u0435\u043d \u043a\u043b\u0430\u0441\u0441 \u0431\u0438\u043b\u0435\u0442\u0430 \u0438 \u043a\u0430\u043a\u0438\u043c-\u0442\u043e \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043f\u0430\u043b\u0443\u0431\u0430 \u00abF\u00bb.<\/p>\n<h1>\u041e\u0446\u0435\u043d\u043a\u0430 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438<\/h1>\n<p>  \u041f\u0435\u0440\u0435\u0434 \u0442\u0435\u043c \u043a\u0430\u043a \u043d\u0430\u0447\u0438\u043d\u0430\u0442\u044c \u0437\u0430\u043f\u0443\u0441\u043a \u043a\u0430\u043a\u043e\u0439-\u043b\u0438\u0431\u043e \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438, \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043d\u044f\u0442\u044c \u043a\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0435\u0435 \u043e\u0446\u0435\u043d\u0438\u0432\u0430\u0442\u044c. \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441 \u043a\u043e\u043d\u043a\u0443\u0440\u0441\u0430\u043c\u0438 Kaggle \u0432\u0441\u0435 \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e: \u043c\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u0447\u0438\u0442\u0430\u0435\u043c \u0438\u0445 \u043f\u0440\u0430\u0432\u0438\u043b\u0430. \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0422\u0438\u0442\u0430\u043d\u0438\u043a\u0430 \u043e\u0446\u0435\u043d\u043a\u043e\u0439 \u0431\u0443\u0434\u0435\u0442 \u0441\u043b\u0443\u0436\u0438\u0442\u044c \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0445 \u043e\u0446\u0435\u043d\u043e\u043a \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0430 \u043a \u043e\u0431\u0449\u0435\u043c\u0443 \u0447\u0438\u0441\u043b\u0443 \u043f\u0430\u0441\u0441\u0430\u0436\u0438\u0440\u043e\u0432. \u0418\u043d\u044b\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438 \u044d\u0442\u0430 \u043e\u0446\u0435\u043d\u043a\u0430 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f <a href=\"https:\/\/en.wikipedia.org\/wiki\/Accuracy_and_precision#In_binary_classification\">accuracy<\/a>. <\/p>\n<p>  \u041d\u043e \u043f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043f\u043e test-\u0432\u044b\u0431\u043e\u0440\u043a\u0435 \u043d\u0430 \u043e\u0446\u0435\u043d\u043a\u0443 \u0432 Kaggle, \u043d\u0430\u043c \u043d\u0435\u043f\u043b\u043e\u0445\u043e \u0431\u044b \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u0430\u043c\u0438\u043c \u043f\u043e\u043d\u044f\u0442\u044c \u0445\u043e\u0442\u044f \u0431\u044b \u043f\u0440\u0438\u0431\u043b\u0438\u0437\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e \u0440\u0430\u0431\u043e\u0442\u044b \u043d\u0430\u0448\u0435\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0430. \u041f\u043e\u043d\u044f\u0442\u044c \u044d\u0442\u043e \u043c\u044b \u0441\u043c\u043e\u0436\u0435\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f train-\u0432\u044b\u0431\u043e\u0440\u043a\u0443, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u043d\u0430 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043f\u0440\u043e\u043c\u0430\u0440\u043a\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435. \u041d\u043e \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0432\u043e\u043f\u0440\u043e\u0441 \u2014 \u043a\u0430\u043a \u0438\u043c\u0435\u043d\u043d\u043e?<\/p>\n<p>  \u0427\u0430\u0441\u0442\u043e \u0432 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445 \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u043d\u0435\u0447\u0442\u043e \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0435:<\/p>\n<pre><code class=\"python\">classifier.fit(train_X, train_y) predict_y = classifier.predict(train_X) return metrics.accuracy_score(train_y, predict_y) <\/code><\/pre>\n<p>  \u0422\u043e \u0435\u0441\u0442\u044c \u043c\u044b \u043e\u0431\u0443\u0447\u0430\u0435\u043c \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u043d\u0430 train-\u043d\u0430\u0431\u043e\u0440\u0435, \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u043d\u0430 \u043d\u0435\u043c \u0436\u0435 \u0435\u0433\u043e \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c. \u041d\u0435\u0441\u043e\u043c\u043d\u0435\u043d\u043d\u043e \u0432 \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u0441\u0442\u0435\u043f\u0435\u043d\u0438 \u044d\u0442\u043e \u0434\u0430\u0435\u0442 \u043d\u0435\u043a\u0443\u044e \u043e\u0446\u0435\u043d\u043a\u0443 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430 \u0440\u0430\u0431\u043e\u0442\u044b \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0430, \u043d\u043e \u0432 \u0446\u0435\u043b\u043e\u043c \u044d\u0442\u043e\u0442 \u043f\u043e\u0434\u0445\u043e\u0434 \u043d\u0435\u0432\u0435\u0440\u0435\u043d. \u041a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0434\u043e\u043b\u0436\u0435\u043d \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u043d\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0435\u0433\u043e \u0442\u0440\u0435\u043d\u0438\u0440\u043e\u0432\u0430\u043b\u0438, \u0430 \u043d\u0435\u043a\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u044d\u0442\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043b\u0430. \u0412 \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u043e\u0442\u043b\u0438\u0447\u043d\u043e \u043f\u043e\u0434\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u0434 train-\u0432\u044b\u0431\u043e\u0440\u043a\u0443, \u043f\u0440\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0435 \u043d\u0430 \u043d\u0435\u0439 \u0436\u0435 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043e\u0442\u043b\u0438\u0447\u043d\u044b\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b, \u043e\u0434\u043d\u0430\u043a\u043e \u043f\u0440\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0435 \u043d\u0430 \u043d\u0435\u043a\u043e\u043c \u0434\u0440\u0443\u0433\u043e\u043c \u043d\u0430\u0431\u043e\u0440\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441 \u0442\u0440\u0435\u0441\u043a\u043e\u043c \u0441\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f. \u0427\u0442\u043e \u0438 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f <a href=\"https:\/\/en.wikipedia.org\/wiki\/Overfitting\">overfitting<\/a>. <\/p>\n<p>  \u041f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u043e\u043c \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0438\u043c\u0435\u044e\u0449\u0435\u0433\u043e\u0441\u044f train-\u043d\u0430\u0431\u043e\u0440\u0430 \u043d\u0430 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043a\u0443\u0441\u043a\u043e\u0432. \u041c\u044b \u043c\u043e\u0436\u0435\u043c \u0432\u0437\u044f\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0438\u0437 \u043d\u0438\u0445, \u043d\u0430\u0442\u0440\u0435\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430 \u043d\u0438\u0445 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440, \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0435\u0433\u043e \u0440\u0430\u0431\u043e\u0442\u0443 \u043d\u0430 \u043e\u0441\u0442\u0430\u0432\u0448\u0438\u0445\u0441\u044f. \u041f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u044c \u044d\u0442\u043e\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043c\u043e\u0436\u043d\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437 \u043f\u0440\u043e\u0441\u0442\u043e \u0442\u0430\u0441\u0443\u044f \u043a\u0443\u0441\u043a\u0438. \u0412 sklearn \u044d\u0442\u043e\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f <a href=\"http:\/\/scikit-learn.org\/stable\/modules\/cross_validation.html\">\u043a\u0440\u043e\u0441\u0441-\u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0435\u0439<\/a>.<\/p>\n<p>  \u041c\u043e\u0436\u043d\u043e \u0443\u0436\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0432 \u0433\u043e\u043b\u043e\u0432\u0435 \u0446\u0438\u043a\u043b\u044b \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0440\u0430\u0437\u0434\u0435\u043b\u044f\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435, \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u044c \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 \u0438 \u043e\u0446\u0435\u043d\u0438\u0432\u0430\u043d\u0438\u0435, \u043d\u043e \u0444\u0438\u0448\u043a\u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0432\u0441\u0435 \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0434\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u044d\u0442\u043e\u0433\u043e \u0432 sklearn \u2014 \u044d\u0442\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044e.<\/p>\n<pre><code class=\"python\">cv = StratifiedKFold(train_data[&quot;Survived&quot;], n_folds=3, shuffle=True, random_state=1) <\/code><\/pre>\n<p>  \u0417\u0434\u0435\u0441\u044c \u043c\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0441\u043b\u043e\u0436\u043d\u044b\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441: \u0442\u0440\u0435\u043d\u0438\u0440\u043e\u0432\u043e\u0447\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u044b \u043d\u0430 \u0442\u0440\u0438 \u043a\u0443\u0441\u043a\u0430, \u043f\u0440\u0438\u0447\u0435\u043c \u0437\u0430\u043f\u0438\u0441\u0438 \u0431\u0443\u0434\u0443\u0442 \u043f\u043e\u043f\u0430\u0434\u0430\u0442\u044c \u0432 \u043a\u0430\u0436\u0434\u044b\u0439 \u043a\u0443\u0441\u043e\u043a \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c (\u0447\u0442\u043e\u0431\u044b \u043d\u0438\u0432\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u0443\u044e \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c \u043e\u0442 \u043f\u043e\u0440\u044f\u0434\u043a\u0430), \u043a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044f \u043e\u0442\u0441\u043b\u0435\u0434\u0438\u0442 \u0447\u0442\u043e\u0431\u044b \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u0435 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u0432 \u043a\u0430\u0436\u0434\u043e\u043c \u043a\u0443\u0441\u043a\u0435 \u0431\u044b\u043b\u043e \u043f\u0440\u0438\u0431\u043b\u0438\u0437\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0440\u0430\u0432\u043d\u044b\u043c. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u044c \u0442\u0440\u0438 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f \u043f\u043e \u043a\u0443\u0441\u043a\u0430\u043c 1+2 vs 3, 1+3 vs 2, 2+3 vs 1 \u2014 \u043f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0441\u043c\u043e\u0436\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u0440\u0435\u0434\u043d\u044e\u044e \u043e\u0446\u0435\u043d\u043a\u0443 \u0430\u043a\u043a\u0443\u0440\u0430\u0442\u043d\u043e\u0441\u0442\u0438 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0430 (\u0447\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e \u0440\u0430\u0431\u043e\u0442\u044b), \u0430 \u0442\u0430\u043a\u0436\u0435 \u0434\u0438\u0441\u043f\u0435\u0440\u0441\u0438\u044e \u043e\u0446\u0435\u043d\u043a\u0438 (\u0447\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0435\u0433\u043e \u0440\u0430\u0431\u043e\u0442\u044b).<\/p>\n<h1>\u041a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f<\/h1>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u0443 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u043e\u0432.<\/p>\n<p>  <a href=\"http:\/\/scikit-learn.org\/stable\/modules\/generated\/sklearn.neighbors.KNeighborsClassifier.html\">KNeighborsClassifier<\/a>:  <\/p>\n<pre><code class=\"python\">alg_ngbh = KNeighborsClassifier(n_neighbors=3) scores = cross_val_score(alg_ngbh, train_data_scaled, train_data_munged[&quot;Survived&quot;], cv=cv, n_jobs=-1) print(&quot;Accuracy (k-neighbors): {}\/{}&quot;.format(scores.mean(), scores.std())) <\/code><\/pre>\n<p>  <a href=\"http:\/\/scikit-learn.org\/stable\/modules\/generated\/sklearn.linear_model.SGDClassifier.html\">SGDClassifier<\/a>:  <\/p>\n<pre><code class=\"python\">alg_sgd = SGDClassifier(random_state=1) scores = cross_val_score(alg_sgd, train_data_scaled, train_data_munged[&quot;Survived&quot;], cv=cv, n_jobs=-1) print(&quot;Accuracy (sgd): {}\/{}&quot;.format(scores.mean(), scores.std())) <\/code><\/pre>\n<p>  <a href=\"http:\/\/scikit-learn.org\/stable\/modules\/generated\/sklearn.svm.SVC.html\">SVC<\/a>:  <\/p>\n<pre><code class=\"python\">alg_svm = SVC(C=1.0) scores = cross_val_score(alg_svm, train_data_scaled, train_data_munged[&quot;Survived&quot;], cv=cv, n_jobs=-1) print(&quot;Accuracy (svm): {}\/{}&quot;.format(scores.mean(), scores.std())) <\/code><\/pre>\n<p>  <a href=\"http:\/\/scikit-learn.org\/stable\/modules\/generated\/sklearn.naive_bayes.GaussianNB.html\">GaussianNB<\/a>:  <\/p>\n<pre><code class=\"python\">alg_nbs = GaussianNB() scores = cross_val_score(alg_nbs, train_data_scaled, train_data_munged[&quot;Survived&quot;], cv=cv, n_jobs=-1) print(&quot;Accuracy (naive bayes): {}\/{}&quot;.format(scores.mean(), scores.std())) <\/code><\/pre>\n<p>  <a href=\"http:\/\/scikit-learn.org\/stable\/modules\/generated\/sklearn.linear_model.LinearRegression.html\">LinearRegression<\/a>:  <\/p>\n<pre><code class=\"python\">def linear_scorer(estimator, x, y):     scorer_predictions = estimator.predict(x)      scorer_predictions[scorer_predictions &gt; 0.5] = 1     scorer_predictions[scorer_predictions &lt;= 0.5] = 0      return metrics.accuracy_score(y, scorer_predictions)  alg_lnr = LinearRegression() scores = cross_val_score(alg_lnr, train_data_scaled, train_data_munged[&quot;Survived&quot;], cv=cv, n_jobs=-1,                          scoring=linear_scorer) print(&quot;Accuracy (linear regression): {}\/{}&quot;.format(scores.mean(), scores.std()))  <\/code><\/pre>\n<p>  \u041c\u0435\u0442\u043e\u0434 linear_scorer \u043d\u0443\u0436\u0435\u043d \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 LinearRegression \u2014 \u044d\u0442\u043e \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0449\u0430\u044f \u043b\u044e\u0431\u043e\u0435 \u0432\u0435\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e. \u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043c\u044b \u0440\u0430\u0437\u0434\u0435\u043b\u044f\u0435\u043c \u0448\u043a\u0430\u043b\u0443 \u0433\u0440\u0430\u043d\u0438\u0446\u0435\u0439 0.5 \u0438 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u043c \u043b\u044e\u0431\u044b\u0435 \u0447\u0438\u0441\u043b\u0430 \u043a \u0434\u0432\u0443\u043c \u043a\u043b\u0430\u0441\u0441\u0430\u043c \u2014 0 \u0438 1.<\/p>\n<p>  <a href=\"http:\/\/scikit-learn.org\/stable\/modules\/generated\/sklearn.linear_model.LogisticRegression.html\">LogisticRegression<\/a>:  <\/p>\n<pre><code class=\"python\">alg_log = LogisticRegression(random_state=1) scores = cross_val_score(alg_log, train_data_scaled, train_data_munged[&quot;Survived&quot;], cv=cv, n_jobs=-1,                          scoring=linear_scorer) print(&quot;Accuracy (logistic regression): {}\/{}&quot;.format(scores.mean(), scores.std())) <\/code><\/pre>\n<p>  <a href=\"http:\/\/scikit-learn.org\/stable\/modules\/generated\/sklearn.ensemble.RandomForestClassifier.html\">RandomForestClassifier<\/a>:  <\/p>\n<pre><code class=\"python\">alg_frst = RandomForestClassifier(random_state=1, n_estimators=500, min_samples_split=8, min_samples_leaf=2) scores = cross_val_score(alg_frst, train_data_scaled, train_data_munged[&quot;Survived&quot;], cv=cv, n_jobs=-1) print(&quot;Accuracy (random forest): {}\/{}&quot;.format(scores.mean(), scores.std())) <\/code><\/pre>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0423 \u043c\u0435\u043d\u044f \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a<\/b><\/p>\n<div class=\"spoiler_text\">Accuracy (k-neighbors): 0.698092031425\/0.0111105442611<br \/>  Accuracy (sgd): 0.708193041526\/0.0178870678457<br \/>  Accuracy (svm): 0.693602693603\/0.018027360723<br \/>  Accuracy (naive bayes): 0.791245791246\/0.0244349506813<br \/>  Accuracy (linear regression): 0.805836139169\/0.00839878201296<br \/>  Accuracy (logistic regression): 0.806958473625\/0.0156323100754<br \/>  Accuracy (random forest): 0.827160493827\/0.0063488824349  <\/div>\n<\/div>\n<p>  \u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c Random Forest \u043f\u043e\u0431\u0435\u0434\u0438\u043b \u0438 \u0434\u0438\u0441\u043f\u0435\u0440\u0441\u0438\u044f \u0443 \u043d\u0435\u0433\u043e \u043d\u0435\u043f\u043b\u043e\u0445\u0430\u044f \u2014 \u043a\u0430\u0436\u0435\u0442\u0441\u044f \u043e\u043d \u0441\u0442\u0430\u0431\u0438\u043b\u0435\u043d.<\/p>\n<h1>\u0415\u0449\u0435 \u043b\u0443\u0447\u0448\u0435<\/h1>\n<p>  \u0412\u0440\u043e\u0434\u0435 \u0432\u0441\u0435 \u0445\u043e\u0440\u043e\u0448\u043e \u0438 \u043c\u043e\u0436\u043d\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442, \u043d\u043e \u043e\u0441\u0442\u0430\u043b\u0441\u044f \u043e\u0434\u0438\u043d \u043c\u0443\u0442\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442: \u0443 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0430 \u0435\u0441\u0442\u044c \u0441\u0432\u043e\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u2014 \u043a\u0430\u043a \u043d\u0430\u043c \u043f\u043e\u043d\u044f\u0442\u044c \u0447\u0442\u043e \u043c\u044b \u0432\u044b\u0431\u0440\u0430\u043b\u0438 \u043d\u0430\u0438\u043b\u0443\u0447\u0448\u0438\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442? \u0411\u0435\u0437 \u0441\u043e\u043c\u043d\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u043b\u0433\u043e \u0441\u0438\u0434\u0435\u0442\u044c \u0438 \u043f\u0435\u0440\u0435\u0431\u0438\u0440\u0430\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u2014 \u043d\u043e \u0447\u0442\u043e \u0435\u0441\u043b\u0438 <a href=\"http:\/\/scikit-learn.org\/stable\/modules\/generated\/sklearn.grid_search.GridSearchCV.html\">\u043f\u043e\u0440\u0443\u0447\u0438\u0442\u044c<\/a> \u044d\u0442\u0443 \u0440\u0430\u0431\u043e\u0442\u0443 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0443?<\/p>\n<pre><code class=\"python\">alg_frst_model = RandomForestClassifier(random_state=1) alg_frst_params = [{     &quot;n_estimators&quot;: [350, 400, 450],     &quot;min_samples_split&quot;: [6, 8, 10],     &quot;min_samples_leaf&quot;: [1, 2, 4] }] alg_frst_grid = GridSearchCV(alg_frst_model, alg_frst_params, cv=cv, refit=True, verbose=1, n_jobs=-1) alg_frst_grid.fit(train_data_scaled, train_data_munged[&quot;Survived&quot;]) alg_frst_best = alg_frst_grid.best_estimator_ print(&quot;Accuracy (random forest auto): {} with params {}&quot;       .format(alg_frst_grid.best_score_, alg_frst_grid.best_params_)) <\/code><\/pre>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0435\u0449\u0435 \u043b\u0443\u0447\u0448\u0435!<\/b><\/p>\n<div class=\"spoiler_text\">Accuracy (random forest auto): 0.836139169473 with params {&#8216;min_samples_split&#8217;: 6, &#8216;n_estimators&#8217;: 350, &#8216;min_samples_leaf&#8217;: 2}  <\/div>\n<\/div>\n<p>  \u041f\u043e\u0434\u0431\u043e\u0440 \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0435\u0449\u0435 \u0442\u043e\u043d\u044c\u0448\u0435 \u043f\u0440\u0438 \u043d\u0430\u043b\u0438\u0447\u0438\u0438 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0438 \u0436\u0435\u043b\u0430\u043d\u0438\u044f \u2014 \u043b\u0438\u0431\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0432 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b, \u043b\u0438\u0431\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0434\u0440\u0443\u0433\u0443\u044e \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044e \u043f\u043e\u0434\u0431\u043e\u0440\u0430, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 <a href=\"http:\/\/scikit-learn.org\/stable\/modules\/generated\/sklearn.grid_search.RandomizedSearchCV.html\">RandomizedSearchCV<\/a>.<\/p>\n<h1>\u041f\u0440\u043e\u0431\u0443\u0435\u043c xgboost<\/h1>\n<p>  \u0412\u0441\u0435 \u0445\u0432\u0430\u043b\u044f\u0442 xgboost \u2014 \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0438 \u0435\u0433\u043e.<\/p>\n<pre><code class=\"python\">ald_xgb_model = xgb.XGBClassifier() ald_xgb_params = [     {&quot;n_estimators&quot;: [230, 250, 270],      &quot;max_depth&quot;: [1, 2, 4],      &quot;learning_rate&quot;: [0.01, 0.02, 0.05]} ] alg_xgb_grid = GridSearchCV(ald_xgb_model, ald_xgb_params, cv=cv, refit=True, verbose=1, n_jobs=1) alg_xgb_grid.fit(train_data_scaled, train_data_munged[&quot;Survived&quot;]) alg_xgb_best = alg_xgb_grid.best_estimator_ print(&quot;Accuracy (xgboost auto): {} with params {}&quot;       .format(alg_xgb_grid.best_score_, alg_xgb_grid.best_params_)) <\/code><\/pre>\n<p>  \u041f\u043e\u0447\u0435\u043c\u0443-\u0442\u043e \u0442\u0440\u0435\u043d\u0438\u0440\u043e\u0432\u043a\u0430 \u0437\u0430\u0432\u0438\u0441\u0430\u043b\u0430 \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0432\u0441\u0435\u0445 \u044f\u0434\u0435\u0440, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u043b\u0441\u044f \u043e\u0434\u043d\u0438\u043c \u043f\u043e\u0442\u043e\u043a\u043e\u043c (n_jobs=1), \u043d\u043e \u0438 \u0432 \u043e\u0434\u043d\u043e\u043f\u043e\u0442\u043e\u0447\u043d\u043e\u043c \u0440\u0435\u0436\u0438\u043c\u0435 \u0442\u0440\u0435\u043d\u0438\u0440\u043e\u0432\u043a\u0430 \u0438 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f \u0432 xgboost \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043e\u0447\u0435\u043d\u044c \u0431\u044b\u0441\u0442\u0440\u043e.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0442\u043e\u0436\u0435 \u043d\u0435\u043f\u043b\u043e\u0445<\/b><\/p>\n<div class=\"spoiler_text\">Accuracy (xgboost auto): 0.835016835017 with params {&#8216;n_estimators&#8217;: 270, &#8216;learning_rate&#8217;: 0.02, &#8216;max_depth&#8217;: 2}  <\/div>\n<\/div>\n<h1>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442<\/h1>\n<p>  \u041a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0432\u044b\u0431\u0440\u0430\u043d, \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u043d\u044b \u2014 \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043d\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u0432 Kaggle.<\/p>\n<pre><code class=\"python\">alg_test = alg_frst_best  alg_test.fit(train_data_scaled, train_data_munged[&quot;Survived&quot;])  predictions = alg_test.predict(test_data_scaled)  submission = pd.DataFrame({     &quot;PassengerId&quot;: test_data[&quot;PassengerId&quot;],     &quot;Survived&quot;: predictions })  submission.to_csv(&quot;titanic-submission.csv&quot;, index=False) <\/code><\/pre>\n<p>  \u0412\u043e\u043e\u0431\u0449\u0435 \u0441\u0442\u043e\u0438\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043c\u043e\u043c\u0435\u043d\u0442\u043e\u0432 \u0432 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u0441\u043e\u0440\u0435\u0432\u043d\u043e\u0432\u0430\u043d\u0438\u044f\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u0438\u0441\u044c \u043c\u043d\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u043c\u0438:<\/p>\n<ul>\n<li>\u0411\u043e\u0440\u044c\u0431\u0430 \u0432 \u0442\u043e\u043f\u0435 \u0438\u0434\u0435\u0442 \u043d\u0430 \u0441\u043e\u0442\u044b\u0435 \u0434\u043e\u043b\u0438 \u043f\u0440\u043e\u0446\u0435\u043d\u0442\u043e\u0432 \u2014 \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0440\u0435\u0448\u0430\u0435\u0442 \u0434\u0430\u0436\u0435 \u043e\u0434\u043d\u0430 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u0430\u044f \u0438\u043b\u0438 \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u0430\u044f \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f \u0438\u0437 \u0432\u0435\u0440\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u043d\u0430\u0431\u043e\u0440\u0430. \u0422\u0430\u043a\u0436\u0435 \u043d\u0430 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u043b\u0438\u044f\u044e\u0442 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0435 \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0438 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430;<\/li>\n<li>\u041b\u0443\u0447\u0448\u0438\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043f\u0440\u0438 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u043a\u0440\u043e\u0441\u0441-\u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438 \u043d\u0435 \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u0443\u0435\u0442 \u043b\u0443\u0447\u0448\u0435\u0433\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u043f\u0440\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0435 \u0432\u0435\u0440\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u043d\u0430\u0431\u043e\u0440\u0430. \u0411\u044b\u0432\u0430\u0435\u0442 \u0447\u0442\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0432\u0440\u043e\u0434\u0435 \u0431\u044b \u0440\u0430\u0437\u0443\u043c\u043d\u043e\u0439 \u0433\u0438\u043f\u043e\u0442\u0435\u0437\u044b \u0443\u043b\u0443\u0447\u0448\u0430\u0435\u0442 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043a\u0440\u043e\u0441\u0441-\u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438 \u0438 \u0443\u0445\u0443\u0434\u0448\u0430\u0435\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043d\u0430 Kaggle;<\/li>\n<li>\u0412\u044b\u0448\u0435\u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u0439 \u0434\u0432\u0430 \u043f\u0443\u043d\u043a\u0442\u0430 \u043f\u0440\u0438\u0432\u043e\u0434\u044f\u0442 \u043a \u0442\u0440\u0435\u0442\u044c\u0435\u043c\u0443 \u2014 \u0441\u043a\u0440\u0438\u043f\u0442 \u0438 \u043d\u0430\u0431\u043e\u0440 \u0434\u043b\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u043d\u0430 \u0432\u0435\u0440\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e \u0434\u043e\u043b\u0436\u043d\u044b \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u043e\u0434 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c \u043b\u044e\u0431\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0432\u0435\u0440\u0441\u0438\u044f\u043c\u0438 \u2014 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u0440\u043e\u0440\u044b\u0432\u0430 \u0432 \u0441\u0447\u0435\u0442\u0435 \u043d\u0443\u0436\u043d\u043e \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043a\u043e\u043c\u043c\u0438\u0442\u0438\u0442\u044c\u0441\u044f \u0441 \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0433\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u0432 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0438 \u043a\u043e\u043c\u043c\u0438\u0442\u0430;<\/li>\n<li>\u0421\u0430\u043c\u043e \u0441\u043e\u0440\u0435\u0432\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0438\u0441\u043a\u0443\u0441\u0441\u0442\u0432\u0435\u043d\u043d\u043e. \u0412 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u043c \u043c\u0438\u0440\u0435 \u0443 \u0432\u0430\u0441 \u043d\u0435\u0442 \u0432\u0435\u0440\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u043d\u0430\u0431\u043e\u0440\u0430 \u2014 \u0442\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437\u043c\u0435\u0447\u0435\u043d\u043d\u0430\u044f \u0432\u044b\u0431\u043e\u0440\u043a\u0430 \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u0442\u044c \u043a\u0440\u043e\u0441\u0441-\u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044e, \u043e\u043a\u043e\u043d\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e \u0440\u0430\u0431\u043e\u0442\u044b \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u043e\u0446\u0435\u043d\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u043a\u043e\u0441\u0432\u0435\u043d\u043d\u043e, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0443 \u0436\u0430\u043b\u043e\u0431 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439;<\/li>\n<li>\u041d\u0435 \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u043d\u044f\u0442\u043d\u0430 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u0430\u044f \u0441\u0442\u0435\u043f\u0435\u043d\u044c \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430 \u043e\u0446\u0435\u043d\u043a\u0438 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043c\u0430\u0448\u0438\u043d\u043d\u044b\u043c \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435\u043c \u043d\u0430 \u0437\u0430\u0434\u0430\u0447\u0435 \u2014 \u0440\u0430\u0437\u043c\u0435\u0440 \u043e\u0431\u0443\u0447\u0430\u044e\u0449\u0435\u0433\u043e \u043d\u0430\u0431\u043e\u0440\u0430 \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u0432\u044b\u0441\u043e\u043a, \u0430 \u0441\u0430\u043c <em>\u043f\u0440\u043e\u0446\u0435\u0441\u0441<\/em> \u043d\u0435\u043e\u0447\u0435\u0432\u0438\u0434\u0435\u043d. \u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u2014 \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0431\u0435\u0433\u0441\u0442\u0432\u0430 \u043f\u0430\u0441\u0441\u0430\u0436\u0438\u0440\u043e\u0432 \u0441 \u0433\u0438\u0431\u043d\u0443\u0449\u0435\u0433\u043e \u043a\u043e\u0440\u0430\u0431\u043b\u044f? \u0412\u043f\u043e\u043b\u043d\u0435 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e, \u0447\u0442\u043e \u043d\u0435 \u0432\u0441\u0435 \u0443\u0441\u0430\u0436\u0435\u043d\u043d\u044b\u0435 \u0432 \u043b\u043e\u0434\u043a\u0438 \u0432\u044b\u0436\u0438\u043b\u0438, \u0442\u0430\u043a\u0436\u0435 \u043a\u0430\u043a \u0432\u043f\u043e\u043b\u043d\u0435 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e \u0447\u0442\u043e \u043d\u0435 \u0432\u0441\u0435 \u043d\u0435\u0443\u0441\u0430\u0436\u0435\u043d\u043d\u044b\u0435 \u0432 \u043b\u043e\u0434\u043a\u0438 \u043f\u043e\u0433\u0438\u0431\u043b\u0438 \u2014 \u0447\u0430\u0441\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u043e\u0447\u0435\u043d\u044c \u0445\u0430\u043e\u0442\u0438\u0447\u043d\u0430 \u0438 \u0434\u043e\u043b\u0436\u043d\u0430 \u0441\u043e\u043f\u0440\u043e\u0442\u0438\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u043a\u0430\u043a\u043e\u043c\u0443-\u043b\u0438\u0431\u043e \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044e.<\/li>\n<\/ul>\n<h1>\u0413\u043b\u0430\u0432\u0430, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0430\u0432\u0442\u043e\u0440 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u0438\u0441\u043f\u044b\u0442\u0430\u043b \u0443\u0434\u0438\u0432\u043b\u0435\u043d\u0438\u0435 \u0438 \u043f\u0440\u043e\u0441\u0432\u0435\u0442\u043b\u0435\u043d\u0438\u0435<\/h1>\n<p>  \u041f\u0440\u043e\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u044f \u0442\u043e\u043f \u043a\u043e\u043d\u043a\u0443\u0440\u0441\u0430\u043d\u0442\u043e\u0432, \u043d\u0435\u043b\u044c\u0437\u044f \u043d\u0435 \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c \u043b\u044e\u0434\u0435\u0439 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u0431\u0440\u0430\u043b\u0438 1 (\u0432\u0441\u0435 \u043e\u0442\u0432\u0435\u0442\u044b \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0435) \u2014 \u043f\u0440\u0438\u0447\u0435\u043c \u0443 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u044d\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u0441 \u043f\u0435\u0440\u0432\u043e\u0439 \u0436\u0435 \u043f\u043e\u043f\u044b\u0442\u043a\u0438.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/c9d\/9d7\/1a7\/c9d9d71a7597491d9193edcda5f2fb5d.png\"\/><\/p>\n<p>  \u041d\u0430 \u0443\u043c \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442: \u043a\u0442\u043e-\u0442\u043e \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043b \u0443\u0447\u0435\u0442\u043a\u0443 \u0441 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043d\u0430\u0447\u0430\u043b \u043f\u0435\u0440\u0435\u0431\u043e\u0440\u043e\u043c \u043f\u043e\u0434\u0431\u0438\u0440\u0430\u0442\u044c (\u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0435 \u0431\u043e\u043b\u0435\u0435 10 \u043f\u043e\u043f\u044b\u0442\u043e\u043a \u0432 \u0434\u0435\u043d\u044c) \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0435 \u043e\u0442\u0432\u0435\u0442\u044b. \u0415\u0441\u043b\u0438 \u044f \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u043f\u043e\u043d\u0438\u043c\u0430\u044e \u044d\u0442\u043e \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0440\u0430\u0437\u043d\u043e\u0432\u0438\u0434\u043d\u043e\u0441\u0442\u044c\u044e <a href=\"https:\/\/ru.wikipedia.org\/wiki\/%D0%97%D0%B0%D0%B4%D0%B0%D1%87%D0%B8_%D0%BD%D0%B0_%D0%B2%D0%B7%D0%B2%D0%B5%D1%88%D0%B8%D0%B2%D0%B0%D0%BD%D0%B8%D0%B5\">\u0437\u0430\u0434\u0430\u0447 \u043e \u0432\u0437\u0432\u0435\u0448\u0438\u0432\u0430\u043d\u0438\u0438<\/a>.<\/p>\n<p>  \u041e\u0434\u043d\u0430\u043a\u043e \u043f\u043e\u0434\u0443\u043c\u0430\u0432 \u0435\u0449\u0435 \u043d\u0435\u043c\u043d\u043e\u0433\u043e, \u043d\u0435\u043b\u044c\u0437\u044f \u043d\u0435 \u0443\u043b\u044b\u0431\u043d\u0443\u0442\u044c\u0441\u044f \u0441\u0432\u043e\u0435\u0439 \u0434\u043e\u0433\u0430\u0434\u043a\u0435: \u043c\u044b \u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043e \u0437\u0430\u0434\u0430\u0447\u0435, \u043e\u0442\u0432\u0435\u0442\u044b \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0443\u0436\u0435 \u0434\u0430\u0432\u043d\u043e \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b! \u0412 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435, \u0433\u0438\u0431\u0435\u043b\u044c \u0422\u0438\u0442\u0430\u043d\u0438\u043a\u0430 \u0431\u044b\u043b\u0430 \u043f\u043e\u0442\u0440\u044f\u0441\u0435\u043d\u0438\u0435\u043c \u0434\u043b\u044f \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u0438\u043a\u043e\u0432, \u0438 \u044d\u0442\u043e\u043c\u0443 \u0441\u043e\u0431\u044b\u0442\u0438\u044e \u0431\u044b\u043b\u0438 \u043f\u043e\u0441\u0432\u044f\u0449\u0435\u043d\u044b \u0444\u0438\u043b\u044c\u043c\u044b, \u043a\u043d\u0438\u0433\u0438 \u0438 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u043b\u0438\u0441\u0442\u0438\u043a\u0430. \u0418 \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e \u0433\u0434\u0435-\u0442\u043e \u0435\u0441\u0442\u044c \u043f\u043e\u043b\u043d\u044b\u0439 \u043f\u043e\u0438\u043c\u0435\u043d\u043d\u044b\u0439 \u043f\u0435\u0440\u0435\u0447\u0435\u043d\u044c \u043f\u0430\u0441\u0441\u0430\u0436\u0438\u0440\u043e\u0432 \u0422\u0438\u0442\u0430\u043d\u0438\u043a\u0430 \u0441 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435\u043c \u0438\u0445 \u0441\u0443\u0434\u044c\u0431\u044b. \u041d\u043e \u043a \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u043c\u0443 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044e \u044d\u0442\u043e \u0443\u0436\u0435 \u043d\u0435 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0441\u044f. <\/p>\n<p>  \u041e\u0434\u043d\u0430\u043a\u043e \u0438\u0437 \u044d\u0442\u043e\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0438 \u043d\u0443\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0432\u044b\u0432\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044f \u0441\u043e\u0431\u0438\u0440\u0430\u044e\u0441\u044c \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u043a\u043e\u043d\u043a\u0443\u0440\u0441\u0430\u0445 \u2014 \u043d\u0435\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e (\u0435\u0441\u043b\u0438 \u044d\u0442\u043e \u043d\u0435 \u0437\u0430\u043f\u0440\u0435\u0449\u0435\u043d\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u0430\u043c\u0438 \u043a\u043e\u043d\u043a\u0443\u0440\u0441\u0430) \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b\u0434\u0430\u043b \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0442\u043e\u0440. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u043f\u043e \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e\u043c\u0443 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0438 \u043c\u0435\u0441\u0442\u0443 \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u044f\u0432\u0438\u0442\u044c \u043f\u043e\u0433\u043e\u0434\u043d\u044b\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u044f, \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0440\u044b\u043d\u043a\u043e\u0432 \u0446\u0435\u043d\u043d\u044b\u0445 \u0431\u0443\u043c\u0430\u0433, \u043a\u0443\u0440\u0441\u044b \u0432\u0430\u043b\u044e\u0442, \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043b\u0438 \u0434\u0435\u043d\u044c \u043f\u0440\u0430\u0437\u0434\u043d\u0438\u0447\u043d\u044b\u043c \u2014 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0436\u0435\u043d\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043e\u0442 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0442\u043e\u0440\u043e\u0432 \u0441 \u043b\u044e\u0431\u044b\u043c\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u043c\u0438 \u043d\u0430\u0431\u043e\u0440\u0430\u043c\u0438 \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u043f\u043e\u043c\u043e\u0447\u044c \u0432 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0438 \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0441\u0442\u0438\u043a \u043c\u043e\u0434\u0435\u043b\u0438.               <\/p>\n<div class=\"clear\"><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/274171\/\"> http:\/\/habrahabr.ru\/post\/274171\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>       \u0425\u043e\u0447\u0443 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u043e\u043f\u044b\u0442\u043e\u043c \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0437\u0430\u0434\u0430\u0447\u0435\u0439 <a href=\"https:\/\/www.kaggle.com\/c\/titanic\">\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e\u0433\u043e \u043a\u043e\u043d\u043a\u0443\u0440\u0441\u0430<\/a> \u043f\u043e \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u043c\u0443 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044e \u043e\u0442 Kaggle. \u042d\u0442\u043e\u0442 \u043a\u043e\u043d\u043a\u0443\u0440\u0441 \u043f\u043e\u0437\u0438\u0446\u0438\u043e\u043d\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043a\u0430\u043a \u043a\u043e\u043d\u043a\u0443\u0440\u0441 \u0434\u043b\u044f \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u0445, \u0430 \u0443 \u043c\u0435\u043d\u044f \u043a\u0430\u043a \u0440\u0430\u0437 \u043d\u0435 \u0431\u044b\u043b\u043e \u043f\u043e\u0447\u0442\u0438 \u043d\u0438\u043a\u0430\u043a\u043e\u0433\u043e \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043e\u043f\u044b\u0442\u0430 \u0432 \u044d\u0442\u043e\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u0438. \u042f \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0437\u043d\u0430\u043b \u0442\u0435\u043e\u0440\u0438\u044e, \u043d\u043e \u0441 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0434\u0435\u043b\u0430 \u043f\u043e\u0447\u0442\u0438 \u043d\u0435 \u0438\u043c\u0435\u043b \u0438 \u0441 \u043f\u0438\u0442\u043e\u043d\u043e\u043c \u043f\u043b\u043e\u0442\u043d\u043e \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u043b. \u0412 \u0438\u0442\u043e\u0433\u0435, \u043f\u043e\u0442\u0440\u0430\u0442\u0438\u0432 \u043f\u0430\u0440\u0443 \u043f\u0440\u0435\u0434\u043d\u043e\u0432\u043e\u0433\u043e\u0434\u043d\u0438\u0445 \u0432\u0435\u0447\u0435\u0440\u043e\u0432, \u043d\u0430\u0431\u0440\u0430\u043b 0.80383 (\u043f\u0435\u0440\u0432\u0430\u044f \u0447\u0435\u0442\u0432\u0435\u0440\u0442\u044c \u0440\u0435\u0439\u0442\u0438\u043d\u0433\u0430).<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/fb4\/856\/19f\/fb485619f6a24cd791db6792433c1bf0.jpeg\"\/><\/p>\n<p>  \u0412 \u043e\u0431\u0449\u0435\u043c \u044d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u0434\u043b\u044f \u0435\u0449\u0435 \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u0445 \u043e\u0442 \u0443\u0436\u0435 \u043d\u0430\u0447\u0430\u0432\u0448\u0435\u0433\u043e.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-271308","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/271308","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=271308"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/271308\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=271308"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=271308"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=271308"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}