{"id":470114,"date":"2025-08-08T21:01:49","date_gmt":"2025-08-08T21:01:49","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=470114"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=470114","title":{"rendered":"<span>Titanic + CatBoost (\u041f\u0435\u0440\u0432\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435, \u043f\u0435\u0440\u0432\u044b\u0439 Jupyter Notebook)<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<pre><code class=\"python\">#\u0418\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u0432\u0441\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438  import pandas as pd from catboost import CatBoostClassifier from sklearn.model_selection import train_test_split from sklearn.metrics import accuracy_score import numpy as np import matplotlib.pyplot as plt import seaborn as sns import json <\/code><\/pre>\n<pre><code class=\"python\"># \ud83d\udd15 \u041e\u0442\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0437\u0430\u0433\u0440\u043e\u043c\u043e\u0436\u0434\u0430\u043b\u0438 \u0432\u044b\u0432\u043e\u0434   import warnings warnings.filterwarnings('ignore')  <\/code><\/pre>\n<pre><code class=\"python\">### \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c \u043a\u0440\u0430\u0441\u0438\u0432\u044b\u0435 \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u044b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 ### \u041c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043b\u0435\u043d\u044c \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c ### \u0423 \u0433\u0440\u0430\u0444\u0438\u043a\u043e\u0432 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0446\u0432\u0435\u0442\u0430, \u0440\u0430\u0437\u043c\u0435\u0440\u0430, \u0448\u0440\u0438\u0444\u0442\u0430 ### \u041c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c \u0438\u0445 \u0432 \u0441\u043b\u043e\u0432\u0430\u0440\u044c \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u044b\u0445 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a  import matplotlib as mlp  # \u0421\u0435\u0442\u043a\u0430 (grid) mlp.rcParams['axes.grid'] = True mlp.rcParams['grid.color'] = '#D3D3D3' mlp.rcParams['grid.linestyle'] = '--' mlp.rcParams['grid.linewidth'] = 1  # \u0426\u0432\u0435\u0442 \u0444\u043e\u043d\u0430 mlp.rcParams['axes.facecolor'] = '#F9F9F9'   # \u0441\u0432\u0435\u0442\u043b\u043e-\u0441\u0435\u0440\u044b\u0439 \u0444\u043e\u043d \u0432\u043d\u0443\u0442\u0440\u0438 \u0433\u0440\u0430\u0444\u0438\u043a\u0430 mlp.rcParams['figure.facecolor'] = '#FFFFFF'  # \u0444\u043e\u043d \u0432\u0441\u0435\u0433\u043e \u0445\u043e\u043b\u0441\u0442\u0430  # \u041b\u0435\u0433\u0435\u043d\u0434\u0430 mlp.rcParams['legend.fontsize'] = 14 mlp.rcParams['legend.frameon'] = True mlp.rcParams['legend.framealpha'] = 0.9 mlp.rcParams['legend.edgecolor'] = '#333333'  # \u0420\u0430\u0437\u043c\u0435\u0440 \u0444\u0438\u0433\u0443\u0440\u044b \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e mlp.rcParams['figure.figsize'] = (10, 6)  # \u0428\u0440\u0438\u0444\u0442\u044b mlp.rcParams['font.family'] = 'DejaVu Sans'  # \u043c\u043e\u0436\u0435\u0448\u044c \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u043d\u0430 'Arial', 'Roboto' \u0438 \u0442.\u0434. mlp.rcParams['font.size'] = 16  # \u0426\u0432\u0435\u0442 \u043e\u0441\u0435\u0439 (\u0441\u043f\u0438\u043d\u043a\u0438) mlp.rcParams['axes.edgecolor'] = '#333333' mlp.rcParams['axes.linewidth'] = 2  # \u0426\u0432\u0435\u0442 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0433\u043e \u0442\u0435\u043a\u0441\u0442\u0430 mlp.rcParams['text.color'] = '#222222'  <\/code><\/pre>\n<pre><code class=\"python\"># \u041e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u044e train...  train_df = pd.read_csv('..\/data\/train.csv')  <\/code><\/pre>\n<pre><code class=\"python\"># ... \u0438 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e test  test_df = pd.read_csv('..\/data\/test.csv')  <\/code><\/pre>\n<pre><code class=\"python\"># \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u0435\u0440\u0432\u044b\u0435 10 \u0441\u0442\u0440\u043e\u043a train'a  train_df.head(10)  <\/code><\/pre>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th>\n<p align=\"left\">\n<\/th>\n<th>\n<p align=\"left\">PassengerId<\/p>\n<\/th>\n<th>\n<p align=\"left\">Survived<\/p>\n<\/th>\n<th>\n<p align=\"left\">Pclass<\/p>\n<\/th>\n<th>\n<p align=\"left\">Name<\/p>\n<\/th>\n<th>\n<p align=\"left\">Sex<\/p>\n<\/th>\n<th>\n<p align=\"left\">Age<\/p>\n<\/th>\n<th>\n<p align=\"left\">SibSp<\/p>\n<\/th>\n<th>\n<p align=\"left\">Parch<\/p>\n<\/th>\n<th>\n<p align=\"left\">Ticket<\/p>\n<\/th>\n<th>\n<p align=\"left\">Fare<\/p>\n<\/th>\n<th>\n<p align=\"left\">Cabin<\/p>\n<\/th>\n<th>\n<p align=\"left\">Embarked<\/p>\n<\/th>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">0<\/p>\n<\/th>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">3<\/p>\n<\/td>\n<td>\n<p align=\"left\">Braund, Mr. Owen Harris<\/p>\n<\/td>\n<td>\n<p align=\"left\">male<\/p>\n<\/td>\n<td>\n<p align=\"left\">22.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">A\/5 21171<\/p>\n<\/td>\n<td>\n<p align=\"left\">7.2500<\/p>\n<\/td>\n<td>\n<p align=\"left\">NaN<\/p>\n<\/td>\n<td>\n<p align=\"left\">S<\/p>\n<\/td>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">1<\/p>\n<\/th>\n<td>\n<p align=\"left\">2<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<td>\n<p align=\"left\">Cumings, Mrs. John Bradley (Florence Briggs Th&#8230;<\/p>\n<\/td>\n<td>\n<p align=\"left\">female<\/p>\n<\/td>\n<td>\n<p align=\"left\">38.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">PC 17599<\/p>\n<\/td>\n<td>\n<p align=\"left\">71.2833<\/p>\n<\/td>\n<td>\n<p align=\"left\">C85<\/p>\n<\/td>\n<td>\n<p align=\"left\">C<\/p>\n<\/td>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">2<\/p>\n<\/th>\n<td>\n<p align=\"left\">3<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<td>\n<p align=\"left\">3<\/p>\n<\/td>\n<td>\n<p align=\"left\">Heikkinen, Miss. Laina<\/p>\n<\/td>\n<td>\n<p align=\"left\">female<\/p>\n<\/td>\n<td>\n<p align=\"left\">26.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">STON\/O2. 3101282<\/p>\n<\/td>\n<td>\n<p align=\"left\">7.9250<\/p>\n<\/td>\n<td>\n<p align=\"left\">NaN<\/p>\n<\/td>\n<td>\n<p align=\"left\">S<\/p>\n<\/td>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">3<\/p>\n<\/th>\n<td>\n<p align=\"left\">4<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<td>\n<p align=\"left\">Futrelle, Mrs. Jacques Heath (Lily May Peel)<\/p>\n<\/td>\n<td>\n<p align=\"left\">female<\/p>\n<\/td>\n<td>\n<p align=\"left\">35.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">113803<\/p>\n<\/td>\n<td>\n<p align=\"left\">53.1000<\/p>\n<\/td>\n<td>\n<p align=\"left\">C123<\/p>\n<\/td>\n<td>\n<p align=\"left\">S<\/p>\n<\/td>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">4<\/p>\n<\/th>\n<td>\n<p align=\"left\">5<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">3<\/p>\n<\/td>\n<td>\n<p align=\"left\">Allen, Mr. William Henry<\/p>\n<\/td>\n<td>\n<p align=\"left\">male<\/p>\n<\/td>\n<td>\n<p align=\"left\">35.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">373450<\/p>\n<\/td>\n<td>\n<p align=\"left\">8.0500<\/p>\n<\/td>\n<td>\n<p align=\"left\">NaN<\/p>\n<\/td>\n<td>\n<p align=\"left\">S<\/p>\n<\/td>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">5<\/p>\n<\/th>\n<td>\n<p align=\"left\">6<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">3<\/p>\n<\/td>\n<td>\n<p align=\"left\">Moran, Mr. James<\/p>\n<\/td>\n<td>\n<p align=\"left\">male<\/p>\n<\/td>\n<td>\n<p align=\"left\">NaN<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">330877<\/p>\n<\/td>\n<td>\n<p align=\"left\">8.4583<\/p>\n<\/td>\n<td>\n<p align=\"left\">NaN<\/p>\n<\/td>\n<td>\n<p align=\"left\">Q<\/p>\n<\/td>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">6<\/p>\n<\/th>\n<td>\n<p align=\"left\">7<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<td>\n<p align=\"left\">McCarthy, Mr. Timothy J<\/p>\n<\/td>\n<td>\n<p align=\"left\">male<\/p>\n<\/td>\n<td>\n<p align=\"left\">54.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">17463<\/p>\n<\/td>\n<td>\n<p align=\"left\">51.8625<\/p>\n<\/td>\n<td>\n<p align=\"left\">E46<\/p>\n<\/td>\n<td>\n<p align=\"left\">S<\/p>\n<\/td>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">7<\/p>\n<\/th>\n<td>\n<p align=\"left\">8<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">3<\/p>\n<\/td>\n<td>\n<p align=\"left\">Palsson, Master. Gosta Leonard<\/p>\n<\/td>\n<td>\n<p align=\"left\">male<\/p>\n<\/td>\n<td>\n<p align=\"left\">2.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">3<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<td>\n<p align=\"left\">349909<\/p>\n<\/td>\n<td>\n<p align=\"left\">21.0750<\/p>\n<\/td>\n<td>\n<p align=\"left\">NaN<\/p>\n<\/td>\n<td>\n<p align=\"left\">S<\/p>\n<\/td>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">8<\/p>\n<\/th>\n<td>\n<p align=\"left\">9<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<td>\n<p align=\"left\">3<\/p>\n<\/td>\n<td>\n<p align=\"left\">Johnson, Mrs. Oscar W (Elisabeth Vilhelmina Berg)<\/p>\n<\/td>\n<td>\n<p align=\"left\">female<\/p>\n<\/td>\n<td>\n<p align=\"left\">27.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">2<\/p>\n<\/td>\n<td>\n<p align=\"left\">347742<\/p>\n<\/td>\n<td>\n<p align=\"left\">11.1333<\/p>\n<\/td>\n<td>\n<p align=\"left\">NaN<\/p>\n<\/td>\n<td>\n<p align=\"left\">S<\/p>\n<\/td>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">9<\/p>\n<\/th>\n<td>\n<p align=\"left\">10<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<td>\n<p align=\"left\">2<\/p>\n<\/td>\n<td>\n<p align=\"left\">Nasser, Mrs. Nicholas (Adele Achem)<\/p>\n<\/td>\n<td>\n<p align=\"left\">female<\/p>\n<\/td>\n<td>\n<p align=\"left\">14.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">237736<\/p>\n<\/td>\n<td>\n<p align=\"left\">30.0708<\/p>\n<\/td>\n<td>\n<p align=\"left\">NaN<\/p>\n<\/td>\n<td>\n<p align=\"left\">C<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<pre><code class=\"python\"># \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043f\u043e train'\u0443  train_df.info()  <\/code><\/pre>\n<pre><code>RangeIndex: 891 entries, 0 to 890 Data columns (total 12 columns):  #   Column       Non-Null Count  Dtype   ---  ------       --------------  -----    0   PassengerId  891 non-null    int64    1   Survived     891 non-null    int64    2   Pclass       891 non-null    int64    3   Name         891 non-null    object   4   Sex          891 non-null    object   5   Age          714 non-null    float64  6   SibSp        891 non-null    int64    7   Parch        891 non-null    int64    8   Ticket       891 non-null    object   9   Fare         891 non-null    float64  10  Cabin        204 non-null    object   11  Embarked     889 non-null    object  dtypes: float64(2), int64(5), object(5) memory usage: 83.7+ KB <\/code><\/pre>\n<h4>\u0412\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u0435\u0441\u0442\u044c \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0438 \u0432 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0435 \u0432\u043e\u0437\u0440\u0430\u0441\u0442. \u041e\u0447\u0435\u043d\u044c \u043c\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u043e\u0432 \u0432 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0435 \u043a\u0430\u0431\u0438\u043d\u0430<\/h4>\n<pre><code class=\"python\"># \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0431\u0430\u0437\u043e\u0432\u0443\u044e \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0443 \u043f\u043e \u0447\u0438\u0441\u043b\u043e\u0432\u044b\u043c \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0430\u043c (\u0441\u0440\u0435\u0434\u043d\u0435\u0435, \u043c\u0435\u0434\u0438\u0430\u043d\u0430, std \u0438 \u0442.\u0434.)  train_df.describe()  <\/code><\/pre>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th>\n<p align=\"left\">\n<\/th>\n<th>\n<p align=\"left\">PassengerId<\/p>\n<\/th>\n<th>\n<p align=\"left\">Survived<\/p>\n<\/th>\n<th>\n<p align=\"left\">Pclass<\/p>\n<\/th>\n<th>\n<p align=\"left\">Age<\/p>\n<\/th>\n<th>\n<p align=\"left\">SibSp<\/p>\n<\/th>\n<th>\n<p align=\"left\">Parch<\/p>\n<\/th>\n<th>\n<p align=\"left\">Fare<\/p>\n<\/th>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">count<\/p>\n<\/th>\n<td>\n<p align=\"left\">891.000000<\/p>\n<\/td>\n<td>\n<p align=\"left\">891.000000<\/p>\n<\/td>\n<td>\n<p align=\"left\">891.000000<\/p>\n<\/td>\n<td>\n<p align=\"left\">714.000000<\/p>\n<\/td>\n<td>\n<p align=\"left\">891.000000<\/p>\n<\/td>\n<td>\n<p align=\"left\">891.000000<\/p>\n<\/td>\n<td>\n<p align=\"left\">891.000000<\/p>\n<\/td>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">mean<\/p>\n<\/th>\n<td>\n<p align=\"left\">446.000000<\/p>\n<\/td>\n<td>\n<p align=\"left\">0.383838<\/p>\n<\/td>\n<td>\n<p align=\"left\">2.308642<\/p>\n<\/td>\n<td>\n<p align=\"left\">29.699118<\/p>\n<\/td>\n<td>\n<p align=\"left\">0.523008<\/p>\n<\/td>\n<td>\n<p align=\"left\">0.381594<\/p>\n<\/td>\n<td>\n<p align=\"left\">32.204208<\/p>\n<\/td>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">std<\/p>\n<\/th>\n<td>\n<p align=\"left\">257.353842<\/p>\n<\/td>\n<td>\n<p align=\"left\">0.486592<\/p>\n<\/td>\n<td>\n<p align=\"left\">0.836071<\/p>\n<\/td>\n<td>\n<p align=\"left\">14.526497<\/p>\n<\/td>\n<td>\n<p align=\"left\">1.102743<\/p>\n<\/td>\n<td>\n<p align=\"left\">0.806057<\/p>\n<\/td>\n<td>\n<p align=\"left\">49.693429<\/p>\n<\/td>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">min<\/p>\n<\/th>\n<td>\n<p align=\"left\">1.000000<\/p>\n<\/td>\n<td>\n<p align=\"left\">0.000000<\/p>\n<\/td>\n<td>\n<p align=\"left\">1.000000<\/p>\n<\/td>\n<td>\n<p align=\"left\">0.420000<\/p>\n<\/td>\n<td>\n<p align=\"left\">0.000000<\/p>\n<\/td>\n<td>\n<p align=\"left\">0.000000<\/p>\n<\/td>\n<td>\n<p align=\"left\">0.000000<\/p>\n<\/td>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">25%<\/p>\n<\/th>\n<td>\n<p align=\"left\">223.500000<\/p>\n<\/td>\n<td>\n<p align=\"left\">0.000000<\/p>\n<\/td>\n<td>\n<p align=\"left\">2.000000<\/p>\n<\/td>\n<td>\n<p align=\"left\">20.125000<\/p>\n<\/td>\n<td>\n<p align=\"left\">0.000000<\/p>\n<\/td>\n<td>\n<p align=\"left\">0.000000<\/p>\n<\/td>\n<td>\n<p align=\"left\">7.910400<\/p>\n<\/td>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">50%<\/p>\n<\/th>\n<td>\n<p align=\"left\">446.000000<\/p>\n<\/td>\n<td>\n<p align=\"left\">0.000000<\/p>\n<\/td>\n<td>\n<p align=\"left\">3.000000<\/p>\n<\/td>\n<td>\n<p align=\"left\">28.000000<\/p>\n<\/td>\n<td>\n<p align=\"left\">0.000000<\/p>\n<\/td>\n<td>\n<p align=\"left\">0.000000<\/p>\n<\/td>\n<td>\n<p align=\"left\">14.454200<\/p>\n<\/td>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">75%<\/p>\n<\/th>\n<td>\n<p align=\"left\">668.500000<\/p>\n<\/td>\n<td>\n<p align=\"left\">1.000000<\/p>\n<\/td>\n<td>\n<p align=\"left\">3.000000<\/p>\n<\/td>\n<td>\n<p align=\"left\">38.000000<\/p>\n<\/td>\n<td>\n<p align=\"left\">1.000000<\/p>\n<\/td>\n<td>\n<p align=\"left\">0.000000<\/p>\n<\/td>\n<td>\n<p align=\"left\">31.000000<\/p>\n<\/td>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">max<\/p>\n<\/th>\n<td>\n<p align=\"left\">891.000000<\/p>\n<\/td>\n<td>\n<p align=\"left\">1.000000<\/p>\n<\/td>\n<td>\n<p align=\"left\">3.000000<\/p>\n<\/td>\n<td>\n<p align=\"left\">80.000000<\/p>\n<\/td>\n<td>\n<p align=\"left\">8.000000<\/p>\n<\/td>\n<td>\n<p align=\"left\">6.000000<\/p>\n<\/td>\n<td>\n<p align=\"left\">512.329200<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<pre><code class=\"python\"># \u0418 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0443 \u043f\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u043d\u044b\u043c \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0430\u043c  train_df.describe(include='object')  <\/code><\/pre>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th>\n<p align=\"left\">\n<\/th>\n<th>\n<p align=\"left\">Name<\/p>\n<\/th>\n<th>\n<p align=\"left\">Sex<\/p>\n<\/th>\n<th>\n<p align=\"left\">Ticket<\/p>\n<\/th>\n<th>\n<p align=\"left\">Cabin<\/p>\n<\/th>\n<th>\n<p align=\"left\">Embarked<\/p>\n<\/th>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">count<\/p>\n<\/th>\n<td>\n<p align=\"left\">891<\/p>\n<\/td>\n<td>\n<p align=\"left\">891<\/p>\n<\/td>\n<td>\n<p align=\"left\">891<\/p>\n<\/td>\n<td>\n<p align=\"left\">204<\/p>\n<\/td>\n<td>\n<p align=\"left\">889<\/p>\n<\/td>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">unique<\/p>\n<\/th>\n<td>\n<p align=\"left\">891<\/p>\n<\/td>\n<td>\n<p align=\"left\">2<\/p>\n<\/td>\n<td>\n<p align=\"left\">681<\/p>\n<\/td>\n<td>\n<p align=\"left\">147<\/p>\n<\/td>\n<td>\n<p align=\"left\">3<\/p>\n<\/td>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">top<\/p>\n<\/th>\n<td>\n<p align=\"left\">Braund, Mr. Owen Harris<\/p>\n<\/td>\n<td>\n<p align=\"left\">male<\/p>\n<\/td>\n<td>\n<p align=\"left\">347082<\/p>\n<\/td>\n<td>\n<p align=\"left\">G6<\/p>\n<\/td>\n<td>\n<p align=\"left\">S<\/p>\n<\/td>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">freq<\/p>\n<\/th>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<td>\n<p align=\"left\">577<\/p>\n<\/td>\n<td>\n<p align=\"left\">7<\/p>\n<\/td>\n<td>\n<p align=\"left\">4<\/p>\n<\/td>\n<td>\n<p align=\"left\">644<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<pre><code class=\"python\"># \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0442\u0430\u0440\u0433\u0435\u0442\u0430  sns.countplot(x='Survived', data=train_df) plt.title('\u0420\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0432\u044b\u0436\u0438\u0432\u0448\u0438\u0445') plt.show()  <\/code><\/pre>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/36a\/9aa\/488\/36a9aa488a66dd4e55a8c1dc77d11b47.png\" width=\"873\" height=\"565\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/36a\/9aa\/488\/36a9aa488a66dd4e55a8c1dc77d11b47.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/36a\/9aa\/488\/36a9aa488a66dd4e55a8c1dc77d11b47.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<h4>\u0414\u0438\u0441\u0431\u0430\u043b\u0430\u043d\u0441\u0430 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u043d\u0435 \u043d\u0435\u0430\u0431\u043b\u044e\u0434\u0430\u0435\u043c<\/h4>\n<pre><code class=\"python\"># \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0442\u0430\u0440\u0433\u0435\u0442\u0430 \u043f\u043e \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0430\u043c  # \u041f\u043e\u043b plt.figure(figsize=(5,4)) sns.countplot(x='Sex', hue='Survived', data=train_df) plt.title('\u041f\u043e\u043b \u0438 \u0432\u044b\u0436\u0438\u0432\u0430\u043d\u0438\u0435') plt.show()  # \u041a\u043b\u0430\u0441\u0441 \u043a\u0430\u044e\u0442\u044b plt.figure(figsize=(5,4)) sns.countplot(x='Pclass', hue='Survived', data=train_df) plt.title('\u041a\u043b\u0430\u0441\u0441 \u043a\u0430\u044e\u0442\u044b \u0438 \u0432\u044b\u0436\u0438\u0432\u0430\u043d\u0438\u0435') plt.show()  # \u041f\u043e\u0440\u0442 \u043f\u043e\u0441\u0430\u0434\u043a\u0438 plt.figure(figsize=(5,4)) sns.countplot(x='Embarked', hue='Survived', data=train_df) plt.title('\u041f\u043e\u0440\u0442 \u043f\u043e\u0441\u0430\u0434\u043a\u0438 \u0438 \u0432\u044b\u0436\u0438\u0432\u0430\u043d\u0438\u0435') plt.show()  <\/code><\/pre>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/716\/a44\/20e\/716a4420e2a1d5c54fb481a3e39d7ced.png\" alt=\"png\" width=\"485\" height=\"411\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/716\/a44\/20e\/716a4420e2a1d5c54fb481a3e39d7ced.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/716\/a44\/20e\/716a4420e2a1d5c54fb481a3e39d7ced.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>png<\/figcaption><\/div>\n<\/figure>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/15a\/427\/eab\/15a427eabb6976658235a1df55f8c86d.png\" alt=\"png\" width=\"485\" height=\"411\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/15a\/427\/eab\/15a427eabb6976658235a1df55f8c86d.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/15a\/427\/eab\/15a427eabb6976658235a1df55f8c86d.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>png<\/figcaption><\/div>\n<\/figure>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/4c4\/0a0\/141\/4c40a01410a61345cdb071e80bc85ba5.png\" width=\"485\" height=\"411\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/4c4\/0a0\/141\/4c40a01410a61345cdb071e80bc85ba5.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/4c4\/0a0\/141\/4c40a01410a61345cdb071e80bc85ba5.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<h4>\u0412\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u0432\u0441\u0435 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0438 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0432\u0430\u0436\u043d\u044b\u043c\u0438 \u0434\u043b\u044f \u0442\u0430\u0440\u0433\u0435\u0442\u0430. \u0412 \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0433\u0440\u0430\u0444\u0438\u043a\u0438 \u0434\u043b\u044f \u0440\u0430\u0437\u043d\u044b\u0445 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432 \u0431\u044b\u043b\u0438 \u0431\u044b \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u043c\u0438.<\/h4>\n<pre><code class=\"python\"># \u0414\u043b\u044f \u0432\u043e\u0437\u0440\u0430\u0441\u0442\u0430 \u0438 \u043f\u043b\u0430\u0442\u044b \u0437\u0430 \u043f\u0440\u043e\u0435\u0437\u0434 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u044f\u0449\u0438\u043a\u0438 \u0441 \u0443\u0441\u0430\u043c\u0438  # \u0412\u043e\u0437\u0440\u0430\u0441\u0442 plt.figure(figsize=(6,5)) sns.boxplot(x='Survived', y='Age', data=train_df) plt.title('\u0412\u043e\u0437\u0440\u0430\u0441\u0442 \u0438 \u0432\u044b\u0436\u0438\u0432\u0430\u043d\u0438\u0435 (boxplot)') plt.show()  # Fare plt.figure(figsize=(6,5)) sns.boxplot(x='Survived', y='Fare', data=train_df) plt.title('\u0421\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c \u0431\u0438\u043b\u0435\u0442\u0430 \u0438 \u0432\u044b\u0436\u0438\u0432\u0430\u043d\u0438\u0435 (boxplot)') plt.show()  <\/code><\/pre>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/cd2\/645\/319\/cd2645319bf4fc20505dafb04f1add0a.png\" alt=\"png\" width=\"548\" height=\"488\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/cd2\/645\/319\/cd2645319bf4fc20505dafb04f1add0a.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/cd2\/645\/319\/cd2645319bf4fc20505dafb04f1add0a.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>png<\/figcaption><\/div>\n<\/figure>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/585\/ab9\/200\/585ab92002fcd0274150b864e0259132.png\" alt=\"png\" width=\"620\" height=\"489\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/585\/ab9\/200\/585ab92002fcd0274150b864e0259132.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/585\/ab9\/200\/585ab92002fcd0274150b864e0259132.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>png<\/figcaption><\/div>\n<\/figure>\n<h4>\u0422\u043e\u0436\u0435 \u0432\u0438\u0434\u043d\u044b \u0440\u0430\u0437\u043b\u0438\u0447\u0438\u044f \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0442\u0430\u0440\u0433\u0435\u0442\u0430<\/h4>\n<pre><code class=\"python\"># \u0421\u0434\u0435\u043b\u0430\u0435\u043c \u0441\u043f\u0438\u0441\u043a\u0438: \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u0438 \u0447\u0438\u0441\u043b\u043e\u0432\u044b\u0435 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0438  categorical_cols = ['Sex', 'Pclass', 'Embarked', 'Cabin'] numeric_cols = ['Age', 'Fare', 'SibSp', 'Parch'] <\/code><\/pre>\n<pre><code class=\"python\"># \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0442\u0435\u043f\u043b\u043e\u0432\u0443\u044e \u043a\u0430\u0440\u0442\u0443 \u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u0438 \u043c\u0435\u0436\u0434\u0443 \u0447\u0438\u0441\u043b\u043e\u0432\u044b\u043c\u0438 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0430\u043c\u0438  plt.figure(figsize=(10,8)) sns.heatmap(train_df.corr(numeric_only=True), annot=True, cmap='coolwarm', fmt=\".2f\") plt.title('\u041a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u044f \u0447\u0438\u0441\u043b\u043e\u0432\u044b\u0445 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432') plt.show()  <\/code><\/pre>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/c7e\/361\/3c0\/c7e3613c0d774de77014f02f850ae3e2.png\" alt=\"png\" width=\"917\" height=\"808\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/c7e\/361\/3c0\/c7e3613c0d774de77014f02f850ae3e2.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/c7e\/361\/3c0\/c7e3613c0d774de77014f02f850ae3e2.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>png<\/figcaption><\/div>\n<\/figure>\n<h4>\u0412\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u043e \u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u043c\u0443\u043b\u044c\u0442\u0438\u043a\u043e\u043b\u043b\u0438\u043d\u0435\u0430\u0440\u043d\u044b\u0445 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432 \u043d\u0435\u0442, \u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u0438<\/h4>\n<pre><code class=\"python\">### \u0421\u0435\u043a\u0440\u0435\u0442\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0441\u043e Stackovervlow \u0434\u043b\u044f \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u0438 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432  def get_redundant_pairs(df):     pairs_to_drop = set()     cols = df.columns     for i in range(0, df.shape[1]):         for j in range(0, i+1):             pairs_to_drop.add((cols[i], cols[j]))     return pairs_to_drop  def get_top_abs_correlations(df, n=5):     au_corr = df.corr().abs().unstack()     labels_to_drop = get_redundant_pairs(df)     au_corr = au_corr.drop(labels=labels_to_drop).sort_values(ascending=False)     return au_corr[0:n]  print(\"Top Absolute Correlations\") print(get_top_abs_correlations(train_df[numeric_cols], 10)) <\/code><\/pre>\n<pre><code>Top Absolute Correlations SibSp  Parch    0.414838 Age    SibSp    0.308247 Fare   Parch    0.216225 Age    Parch    0.189119 Fare   SibSp    0.159651 Age    Fare     0.096067 dtype: float64 <\/code><\/pre>\n<h4>\u041c\u0443\u043b\u044c\u0442\u0438\u043a\u043e\u043b\u043b\u0438\u043d\u0435\u0430\u0440\u043d\u043e\u0441\u0442\u0438 \u043d\u0435\u0442 &#8212; \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0430\u0435\u043c<\/h4>\n<pre><code class=\"python\"># \u0421\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0438  train_df.isnull().sum()  <\/code><\/pre>\n<pre><code>PassengerId      0 Survived         0 Pclass           0 Name             0 Sex              0 Age            177 SibSp            0 Parch            0 Ticket           0 Fare             0 Cabin          687 Embarked         2 dtype: int64 <\/code><\/pre>\n<pre><code class=\"python\">#\u0423\u0434\u0430\u043b\u044f\u0435\u043c \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0438 \u0432 \u043a\u043e\u043b\u043e\u043d\u043a\u0435 \"Embarked\" #\u0422\u0430\u043a \u043a\u0430\u043a \u0438\u0445 \u0432\u0441\u0435\u0433\u043e \u0434\u0432\u0430 #\u0421\u0435\u0439\u0447\u0430\u0441 \u0434\u043e \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f #\u0422\u0440\u0435\u043d\u0438\u0440\u043e\u0432\u043e\u0447\u043d\u044b\u0445 \u0438 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 #\u041c\u043e\u0436\u043d\u043e \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c  train_df = train_df.dropna(subset=['Embarked']).copy()  <\/code><\/pre>\n<pre><code class=\"python\">#\u0421\u043c\u043e\u0442\u0440\u0438\u043c \u0441\u043d\u043e\u0432\u0430  train_df.isnull().sum()  <\/code><\/pre>\n<pre><code>PassengerId      0 Survived         0 Pclass           0 Name             0 Sex              0 Age            177 SibSp            0 Parch            0 Ticket           0 Fare             0 Cabin          687 Embarked         0 dtype: int64 <\/code><\/pre>\n<h4>\u041f\u043e\u0441\u043b\u0435 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u0442\u044c \u0441\u0442\u0440\u043e\u043a\u0438. \u0423\u0434\u0430\u043b\u044f\u043b\u0438 \u0434\u043e \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u043f\u043e\u0432\u0440\u0435\u0434\u0438\u0442\u044c \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435.<\/h4>\n<h4>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u0433\u043e\u0442\u043e\u0432\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043a \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044e \u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043e\u0431\u0449\u0435\u0433\u043e \u0434\u0430\u0442\u0430\u0444\u0440\u0435\u0439\u043c\u0430.<\/h4>\n<h4>\u041e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0443\u0436\u043d\u043e \u0432\u0441\u0451 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0438\u0441\u043f\u043e\u0440\u0442\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435<\/h4>\n<pre><code class=\"python\">#\u0414\u043e\u0431\u0430\u0432\u0438\u043c \u043a\u043e\u043b\u043e\u043d\u043a\u0443-\u043c\u0435\u0442\u043a\u0443, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0442\u043e\u043c \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043e\u0431\u0440\u0430\u0442\u043d\u043e  train_df['is_train'] = 1 test_df['is_train'] = 0  <\/code><\/pre>\n<pre><code class=\"python\">#\u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0444\u0438\u043a\u0442\u0438\u0432\u043d\u0443\u044e \u043a\u043e\u043b\u043e\u043d\u043a\u0443 `Survived` \u0432 \u0442\u0435\u0441\u0442 (\u0447\u0442\u043e\u0431\u044b \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0431\u044b\u043b\u0430 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u0430\u044f)  test_df['Survived'] = np.nan  <\/code><\/pre>\n<pre><code class=\"python\">#\u0421\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c PassengerId \u0438\u0437 \u0442\u0435\u0441\u0442\u0430 \u0434\u043b\u044f submission  passenger_ids = test_df['PassengerId'].copy()  <\/code><\/pre>\n<h4>(\u043a\u043e\u043b\u043e\u043d\u043a\u0430 \u043d\u0435 \u0432\u0430\u0436\u043d\u0430 \u0434\u043b\u044f \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f, \u043d\u043e \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0432 \u0438\u0442\u043e\u0433\u043e\u0432\u043e\u043c \u0444\u0430\u0439\u043b\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f)<\/h4>\n<pre><code class=\"python\">#\u0423\u0434\u0430\u043b\u044f\u0435\u043c \u043a\u043e\u043b\u043e\u043d\u043a\u0443 PassengerId \u043f\u0435\u0440\u0435\u0434 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435\u043c \u2014 \u043e\u043d\u0430 \u043d\u0435 \u043d\u0443\u0436\u043d\u0430 \u0434\u043b\u044f \u043c\u043e\u0434\u0435\u043b\u0438  train_df = train_df.drop(columns=['PassengerId']) test_df = test_df.drop(columns=['PassengerId']) <\/code><\/pre>\n<pre><code class=\"python\">#\u041e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u0435\u043c \u0442\u0440\u0435\u043d\u0438\u0440\u043e\u0432\u043e\u0447\u043d\u044b\u0435 \u0438 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445  full_df = pd.concat([train_df, test_df], axis=0).reset_index(drop=True)  <\/code><\/pre>\n<pre><code class=\"python\">#\u041f\u0440\u043e\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043a \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0435 Age \u0437\u0430\u043c\u0435\u043d\u044f\u0435\u043c \u043c\u0435\u0434\u0438\u0430\u043d\u043d\u044b\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c \u043f\u043e \u0432\u0441\u0435\u043c \u043f\u0430\u0441\u0441\u0430\u0436\u0438\u0440\u0430\u043c #\u041d\u043e \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u044b\u043b\u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0442\u0440\u0435\u043d\u0438\u0440\u043e\u0432\u043e\u0447\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 #\u041c\u0435\u0434\u0438\u0430\u043d\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043c\u0435\u043d\u0435\u0435 \u0447\u0443\u0432\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043a \u0432\u044b\u0431\u0440\u043e\u0441\u0430\u043c \u0432 \u0434\u0430\u043d\u043d\u044b\u0445  full_df['Age'] = full_df['Age'].fillna(train_df['Age'].median())  <\/code><\/pre>\n<pre><code class=\"python\"># \u0421\u043d\u043e\u0432\u0430 \u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0438, \u043d\u043e \u0443\u0436\u0435 \u0432 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0451\u043d\u043d\u043e\u043c \u0434\u0430\u0442\u0430\u0444\u0440\u0435\u0439\u043c\u0435  full_df.isnull().sum()  <\/code><\/pre>\n<pre><code>Survived     418 Pclass         0 Name           0 Sex            0 Age            0 SibSp          0 Parch          0 Ticket         0 Fare           1 Cabin       1014 Embarked       0 is_train       0 dtype: int64 <\/code><\/pre>\n<pre><code class=\"python\"># \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0435\u0449\u0451 \u0440\u0430\u0437 \u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u0435, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0438\u043d\u044f\u0442\u044c \u0440\u0435\u0448\u0435\u043d\u0438\u0435, \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u0441 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u043c \u043f\u043b\u0430\u0442\u0430 \u0437\u0430 \u043f\u0440\u043e\u0435\u0437\u0434  full_df.head(20) <\/code><\/pre>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th>\n<p align=\"left\">\n<\/th>\n<th>\n<p align=\"left\">Survived<\/p>\n<\/th>\n<th>\n<p align=\"left\">Pclass<\/p>\n<\/th>\n<th>\n<p align=\"left\">Name<\/p>\n<\/th>\n<th>\n<p align=\"left\">Sex<\/p>\n<\/th>\n<th>\n<p align=\"left\">Age<\/p>\n<\/th>\n<th>\n<p align=\"left\">SibSp<\/p>\n<\/th>\n<th>\n<p align=\"left\">Parch<\/p>\n<\/th>\n<th>\n<p align=\"left\">Ticket<\/p>\n<\/th>\n<th>\n<p align=\"left\">Fare<\/p>\n<\/th>\n<th>\n<p align=\"left\">Cabin<\/p>\n<\/th>\n<th>\n<p align=\"left\">Embarked<\/p>\n<\/th>\n<th>\n<p align=\"left\">is_train<\/p>\n<\/th>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">0<\/p>\n<\/th>\n<td>\n<p align=\"left\">0.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">3<\/p>\n<\/td>\n<td>\n<p align=\"left\">Braund, Mr. Owen Harris<\/p>\n<\/td>\n<td>\n<p align=\"left\">male<\/p>\n<\/td>\n<td>\n<p align=\"left\">22.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">A\/5 21171<\/p>\n<\/td>\n<td>\n<p align=\"left\">7.2500<\/p>\n<\/td>\n<td>\n<p align=\"left\">NaN<\/p>\n<\/td>\n<td>\n<p align=\"left\">S<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">1<\/p>\n<\/th>\n<td>\n<p align=\"left\">1.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<td>\n<p align=\"left\">Cumings, Mrs. John Bradley (Florence Briggs Th&#8230;<\/p>\n<\/td>\n<td>\n<p align=\"left\">female<\/p>\n<\/td>\n<td>\n<p align=\"left\">38.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">PC 17599<\/p>\n<\/td>\n<td>\n<p align=\"left\">71.2833<\/p>\n<\/td>\n<td>\n<p align=\"left\">C85<\/p>\n<\/td>\n<td>\n<p align=\"left\">C<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">2<\/p>\n<\/th>\n<td>\n<p align=\"left\">1.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">3<\/p>\n<\/td>\n<td>\n<p align=\"left\">Heikkinen, Miss. Laina<\/p>\n<\/td>\n<td>\n<p align=\"left\">female<\/p>\n<\/td>\n<td>\n<p align=\"left\">26.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">STON\/O2. 3101282<\/p>\n<\/td>\n<td>\n<p align=\"left\">7.9250<\/p>\n<\/td>\n<td>\n<p align=\"left\">NaN<\/p>\n<\/td>\n<td>\n<p align=\"left\">S<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">3<\/p>\n<\/th>\n<td>\n<p align=\"left\">1.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<td>\n<p align=\"left\">Futrelle, Mrs. Jacques Heath (Lily May Peel)<\/p>\n<\/td>\n<td>\n<p align=\"left\">female<\/p>\n<\/td>\n<td>\n<p align=\"left\">35.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">113803<\/p>\n<\/td>\n<td>\n<p align=\"left\">53.1000<\/p>\n<\/td>\n<td>\n<p align=\"left\">C123<\/p>\n<\/td>\n<td>\n<p align=\"left\">S<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">4<\/p>\n<\/th>\n<td>\n<p align=\"left\">0.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">3<\/p>\n<\/td>\n<td>\n<p align=\"left\">Allen, Mr. William Henry<\/p>\n<\/td>\n<td>\n<p align=\"left\">male<\/p>\n<\/td>\n<td>\n<p align=\"left\">35.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">373450<\/p>\n<\/td>\n<td>\n<p align=\"left\">8.0500<\/p>\n<\/td>\n<td>\n<p align=\"left\">NaN<\/p>\n<\/td>\n<td>\n<p align=\"left\">S<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">5<\/p>\n<\/th>\n<td>\n<p align=\"left\">0.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">3<\/p>\n<\/td>\n<td>\n<p align=\"left\">Moran, Mr. James<\/p>\n<\/td>\n<td>\n<p align=\"left\">male<\/p>\n<\/td>\n<td>\n<p align=\"left\">28.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">330877<\/p>\n<\/td>\n<td>\n<p align=\"left\">8.4583<\/p>\n<\/td>\n<td>\n<p align=\"left\">NaN<\/p>\n<\/td>\n<td>\n<p align=\"left\">Q<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">6<\/p>\n<\/th>\n<td>\n<p align=\"left\">0.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<td>\n<p align=\"left\">McCarthy, Mr. Timothy J<\/p>\n<\/td>\n<td>\n<p align=\"left\">male<\/p>\n<\/td>\n<td>\n<p align=\"left\">54.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">17463<\/p>\n<\/td>\n<td>\n<p align=\"left\">51.8625<\/p>\n<\/td>\n<td>\n<p align=\"left\">E46<\/p>\n<\/td>\n<td>\n<p align=\"left\">S<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">7<\/p>\n<\/th>\n<td>\n<p align=\"left\">0.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">3<\/p>\n<\/td>\n<td>\n<p align=\"left\">Palsson, Master. Gosta Leonard<\/p>\n<\/td>\n<td>\n<p align=\"left\">male<\/p>\n<\/td>\n<td>\n<p align=\"left\">2.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">3<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<td>\n<p align=\"left\">349909<\/p>\n<\/td>\n<td>\n<p align=\"left\">21.0750<\/p>\n<\/td>\n<td>\n<p align=\"left\">NaN<\/p>\n<\/td>\n<td>\n<p align=\"left\">S<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">8<\/p>\n<\/th>\n<td>\n<p align=\"left\">1.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">3<\/p>\n<\/td>\n<td>\n<p align=\"left\">Johnson, Mrs. Oscar W (Elisabeth Vilhelmina Berg)<\/p>\n<\/td>\n<td>\n<p align=\"left\">female<\/p>\n<\/td>\n<td>\n<p align=\"left\">27.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">2<\/p>\n<\/td>\n<td>\n<p align=\"left\">347742<\/p>\n<\/td>\n<td>\n<p align=\"left\">11.1333<\/p>\n<\/td>\n<td>\n<p align=\"left\">NaN<\/p>\n<\/td>\n<td>\n<p align=\"left\">S<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">9<\/p>\n<\/th>\n<td>\n<p align=\"left\">1.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">2<\/p>\n<\/td>\n<td>\n<p align=\"left\">Nasser, Mrs. Nicholas (Adele Achem)<\/p>\n<\/td>\n<td>\n<p align=\"left\">female<\/p>\n<\/td>\n<td>\n<p align=\"left\">14.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">237736<\/p>\n<\/td>\n<td>\n<p align=\"left\">30.0708<\/p>\n<\/td>\n<td>\n<p align=\"left\">NaN<\/p>\n<\/td>\n<td>\n<p align=\"left\">C<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">10<\/p>\n<\/th>\n<td>\n<p align=\"left\">1.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">3<\/p>\n<\/td>\n<td>\n<p align=\"left\">Sandstrom, Miss. Marguerite Rut<\/p>\n<\/td>\n<td>\n<p align=\"left\">female<\/p>\n<\/td>\n<td>\n<p align=\"left\">4.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<td>\n<p align=\"left\">PP 9549<\/p>\n<\/td>\n<td>\n<p align=\"left\">16.7000<\/p>\n<\/td>\n<td>\n<p align=\"left\">G6<\/p>\n<\/td>\n<td>\n<p align=\"left\">S<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">11<\/p>\n<\/th>\n<td>\n<p align=\"left\">1.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<td>\n<p align=\"left\">Bonnell, Miss. Elizabeth<\/p>\n<\/td>\n<td>\n<p align=\"left\">female<\/p>\n<\/td>\n<td>\n<p align=\"left\">58.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">113783<\/p>\n<\/td>\n<td>\n<p align=\"left\">26.5500<\/p>\n<\/td>\n<td>\n<p align=\"left\">C103<\/p>\n<\/td>\n<td>\n<p align=\"left\">S<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">12<\/p>\n<\/th>\n<td>\n<p align=\"left\">0.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">3<\/p>\n<\/td>\n<td>\n<p align=\"left\">Saundercock, Mr. William Henry<\/p>\n<\/td>\n<td>\n<p align=\"left\">male<\/p>\n<\/td>\n<td>\n<p align=\"left\">20.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">A\/5. 2151<\/p>\n<\/td>\n<td>\n<p align=\"left\">8.0500<\/p>\n<\/td>\n<td>\n<p align=\"left\">NaN<\/p>\n<\/td>\n<td>\n<p align=\"left\">S<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">13<\/p>\n<\/th>\n<td>\n<p align=\"left\">0.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">3<\/p>\n<\/td>\n<td>\n<p align=\"left\">Andersson, Mr. Anders Johan<\/p>\n<\/td>\n<td>\n<p align=\"left\">male<\/p>\n<\/td>\n<td>\n<p align=\"left\">39.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<td>\n<p align=\"left\">5<\/p>\n<\/td>\n<td>\n<p align=\"left\">347082<\/p>\n<\/td>\n<td>\n<p align=\"left\">31.2750<\/p>\n<\/td>\n<td>\n<p align=\"left\">NaN<\/p>\n<\/td>\n<td>\n<p align=\"left\">S<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">14<\/p>\n<\/th>\n<td>\n<p align=\"left\">0.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">3<\/p>\n<\/td>\n<td>\n<p align=\"left\">Vestrom, Miss. Hulda Amanda Adolfina<\/p>\n<\/td>\n<td>\n<p align=\"left\">female<\/p>\n<\/td>\n<td>\n<p align=\"left\">14.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">350406<\/p>\n<\/td>\n<td>\n<p align=\"left\">7.8542<\/p>\n<\/td>\n<td>\n<p align=\"left\">NaN<\/p>\n<\/td>\n<td>\n<p align=\"left\">S<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">15<\/p>\n<\/th>\n<td>\n<p align=\"left\">1.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">2<\/p>\n<\/td>\n<td>\n<p align=\"left\">Hewlett, Mrs. (Mary D Kingcome)<\/p>\n<\/td>\n<td>\n<p align=\"left\">female<\/p>\n<\/td>\n<td>\n<p align=\"left\">55.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">248706<\/p>\n<\/td>\n<td>\n<p align=\"left\">16.0000<\/p>\n<\/td>\n<td>\n<p align=\"left\">NaN<\/p>\n<\/td>\n<td>\n<p align=\"left\">S<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">16<\/p>\n<\/th>\n<td>\n<p align=\"left\">0.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">3<\/p>\n<\/td>\n<td>\n<p align=\"left\">Rice, Master. Eugene<\/p>\n<\/td>\n<td>\n<p align=\"left\">male<\/p>\n<\/td>\n<td>\n<p align=\"left\">2.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">4<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<td>\n<p align=\"left\">382652<\/p>\n<\/td>\n<td>\n<p align=\"left\">29.1250<\/p>\n<\/td>\n<td>\n<p align=\"left\">NaN<\/p>\n<\/td>\n<td>\n<p align=\"left\">Q<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">17<\/p>\n<\/th>\n<td>\n<p align=\"left\">1.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">2<\/p>\n<\/td>\n<td>\n<p align=\"left\">Williams, Mr. Charles Eugene<\/p>\n<\/td>\n<td>\n<p align=\"left\">male<\/p>\n<\/td>\n<td>\n<p align=\"left\">28.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">244373<\/p>\n<\/td>\n<td>\n<p align=\"left\">13.0000<\/p>\n<\/td>\n<td>\n<p align=\"left\">NaN<\/p>\n<\/td>\n<td>\n<p align=\"left\">S<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">18<\/p>\n<\/th>\n<td>\n<p align=\"left\">0.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">3<\/p>\n<\/td>\n<td>\n<p align=\"left\">Vander Planke, Mrs. Julius (Emelia Maria Vande&#8230;<\/p>\n<\/td>\n<td>\n<p align=\"left\">female<\/p>\n<\/td>\n<td>\n<p align=\"left\">31.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">345763<\/p>\n<\/td>\n<td>\n<p align=\"left\">18.0000<\/p>\n<\/td>\n<td>\n<p align=\"left\">NaN<\/p>\n<\/td>\n<td>\n<p align=\"left\">S<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">19<\/p>\n<\/th>\n<td>\n<p align=\"left\">1.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">3<\/p>\n<\/td>\n<td>\n<p align=\"left\">Masselmani, Mrs. Fatima<\/p>\n<\/td>\n<td>\n<p align=\"left\">female<\/p>\n<\/td>\n<td>\n<p align=\"left\">28.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">2649<\/p>\n<\/td>\n<td>\n<p align=\"left\">7.2250<\/p>\n<\/td>\n<td>\n<p align=\"left\">NaN<\/p>\n<\/td>\n<td>\n<p align=\"left\">C<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<pre><code class=\"python\">#\u0422\u0430\u043a\u0436\u0435 \u0437\u0430\u043a\u043e\u0434\u0438\u0440\u0443\u0435\u043c \u0438 \u0446\u0435\u043d\u0443 \u0437\u0430 \u043f\u0440\u043e\u0435\u0437\u0434 #\u0423\u0434\u0430\u043b\u044f\u0442\u044c \u043f\u043e\u0441\u043b\u0435 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u043d\u0435\u043b\u044c\u0437\u044f - \u043c\u043e\u0436\u043d\u043e \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0441\u0442\u0440\u043e\u043a\u0443 \u0438\u0437 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445  full_df['Fare'] = full_df['Fare'].fillna(train_df['Fare'].median())  <\/code><\/pre>\n<pre><code class=\"python\"># \u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c  full_df.isnull().sum()  <\/code><\/pre>\n<pre><code>Survived     418 Pclass         0 Name           0 Sex            0 Age            0 SibSp          0 Parch          0 Ticket         0 Fare           0 Cabin       1014 Embarked       0 is_train       0 dtype: int64 <\/code><\/pre>\n<h4>\u0422\u0440\u0438 \u0447\u0435\u0442\u0432\u0435\u0440\u0442\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u043e \u043a\u043e\u043b\u043e\u043d\u043a\u0435 Cabin \u0432 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f NaN. \u0421\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u044d\u0442\u043e \u043f\u0430\u0441\u0441\u0430\u0436\u0438\u0440\u044b \u0432\u0442\u043e\u0440\u043e\u0433\u043e \u0438\u043b\u0438 \u0442\u0440\u0435\u0442\u044c\u0435\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430, \u0443 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0435 \u0431\u044b\u043b\u043e \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u043a\u0430\u0431\u0438\u043d\u044b. \u0421\u043e\u0432\u0441\u0435\u043c \u0438\u0437\u0431\u0430\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u043e\u0442 \u044d\u0442\u043e\u0439 \u043a\u043e\u043b\u043e\u043d\u043a\u0438, \u043d\u0430\u0432\u0435\u0440\u043d\u043e\u0435, \u043d\u0435 \u0441\u0442\u043e\u0438\u0442 \u2014 \u0438 \u043d\u0435 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e. \u0412\u043c\u0435\u0441\u0442\u043e \u044d\u0442\u043e\u0433\u043e \u043c\u044b \u0437\u0430\u043a\u043e\u0434\u0438\u0440\u0443\u0435\u043c \u0435\u0451 \u043a\u0430\u043a \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u0438\u043b\u0438 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u043f\u0430\u043b\u0443\u0431\u044b.<\/h4>\n<pre><code class=\"python\"># \u0421\u043e\u0437\u0434\u0430\u0451\u043c \u043d\u043e\u0432\u044b\u0439 \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0439 \u043f\u0440\u0438\u0437\u043d\u0430\u043a: \u0431\u044b\u043b\u0430 \u043b\u0438 \u0443\u043a\u0430\u0437\u0430\u043d\u0430 \u043a\u0430\u044e\u0442\u0430  full_df['Has_Cabin'] = full_df['Cabin'].notnull().astype(int)  <\/code><\/pre>\n<pre><code class=\"python\"># \u0423\u0434\u0430\u043b\u044f\u0435\u043c \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u0443\u044e \u043a\u043e\u043b\u043e\u043d\u043a\u0443 Cabin, \u0447\u0442\u043e\u0431\u044b \u043e\u043d\u0430 \u043d\u0435 \u043c\u0435\u0448\u0430\u043b\u0430  full_df = full_df.drop(columns='Cabin')  <\/code><\/pre>\n<pre><code class=\"python\"># \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u043d\u0430\u0448 \u0438\u0437\u043c\u0435\u043d\u0451\u043d\u043d\u044b\u0439 \u0434\u0430\u0442\u0430\u0444\u0440\u0435\u0439\u043c   full_df  <\/code><\/pre>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th>\n<p align=\"left\">\n<\/th>\n<th>\n<p align=\"left\">Survived<\/p>\n<\/th>\n<th>\n<p align=\"left\">Pclass<\/p>\n<\/th>\n<th>\n<p align=\"left\">Name<\/p>\n<\/th>\n<th>\n<p align=\"left\">Sex<\/p>\n<\/th>\n<th>\n<p align=\"left\">Age<\/p>\n<\/th>\n<th>\n<p align=\"left\">SibSp<\/p>\n<\/th>\n<th>\n<p align=\"left\">Parch<\/p>\n<\/th>\n<th>\n<p align=\"left\">Ticket<\/p>\n<\/th>\n<th>\n<p align=\"left\">Fare<\/p>\n<\/th>\n<th>\n<p align=\"left\">Embarked<\/p>\n<\/th>\n<th>\n<p align=\"left\">is_train<\/p>\n<\/th>\n<th>\n<p align=\"left\">Has_Cabin<\/p>\n<\/th>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">0<\/p>\n<\/th>\n<td>\n<p align=\"left\">0.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">3<\/p>\n<\/td>\n<td>\n<p align=\"left\">Braund, Mr. Owen Harris<\/p>\n<\/td>\n<td>\n<p align=\"left\">male<\/p>\n<\/td>\n<td>\n<p align=\"left\">22.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">A\/5 21171<\/p>\n<\/td>\n<td>\n<p align=\"left\">7.2500<\/p>\n<\/td>\n<td>\n<p align=\"left\">S<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">1<\/p>\n<\/th>\n<td>\n<p align=\"left\">1.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<td>\n<p align=\"left\">Cumings, Mrs. John Bradley (Florence Briggs Th&#8230;<\/p>\n<\/td>\n<td>\n<p align=\"left\">female<\/p>\n<\/td>\n<td>\n<p align=\"left\">38.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">PC 17599<\/p>\n<\/td>\n<td>\n<p align=\"left\">71.2833<\/p>\n<\/td>\n<td>\n<p align=\"left\">C<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">2<\/p>\n<\/th>\n<td>\n<p align=\"left\">1.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">3<\/p>\n<\/td>\n<td>\n<p align=\"left\">Heikkinen, Miss. Laina<\/p>\n<\/td>\n<td>\n<p align=\"left\">female<\/p>\n<\/td>\n<td>\n<p align=\"left\">26.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">STON\/O2. 3101282<\/p>\n<\/td>\n<td>\n<p align=\"left\">7.9250<\/p>\n<\/td>\n<td>\n<p align=\"left\">S<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">3<\/p>\n<\/th>\n<td>\n<p align=\"left\">1.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<td>\n<p align=\"left\">Futrelle, Mrs. Jacques Heath (Lily May Peel)<\/p>\n<\/td>\n<td>\n<p align=\"left\">female<\/p>\n<\/td>\n<td>\n<p align=\"left\">35.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">113803<\/p>\n<\/td>\n<td>\n<p align=\"left\">53.1000<\/p>\n<\/td>\n<td>\n<p align=\"left\">S<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">4<\/p>\n<\/th>\n<td>\n<p align=\"left\">0.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">3<\/p>\n<\/td>\n<td>\n<p align=\"left\">Allen, Mr. William Henry<\/p>\n<\/td>\n<td>\n<p align=\"left\">male<\/p>\n<\/td>\n<td>\n<p align=\"left\">35.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">373450<\/p>\n<\/td>\n<td>\n<p align=\"left\">8.0500<\/p>\n<\/td>\n<td>\n<p align=\"left\">S<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">&#8230;<\/p>\n<\/th>\n<td>\n<p align=\"left\">&#8230;<\/p>\n<\/td>\n<td>\n<p align=\"left\">&#8230;<\/p>\n<\/td>\n<td>\n<p align=\"left\">&#8230;<\/p>\n<\/td>\n<td>\n<p align=\"left\">&#8230;<\/p>\n<\/td>\n<td>\n<p align=\"left\">&#8230;<\/p>\n<\/td>\n<td>\n<p align=\"left\">&#8230;<\/p>\n<\/td>\n<td>\n<p align=\"left\">&#8230;<\/p>\n<\/td>\n<td>\n<p align=\"left\">&#8230;<\/p>\n<\/td>\n<td>\n<p align=\"left\">&#8230;<\/p>\n<\/td>\n<td>\n<p align=\"left\">&#8230;<\/p>\n<\/td>\n<td>\n<p align=\"left\">&#8230;<\/p>\n<\/td>\n<td>\n<p align=\"left\">&#8230;<\/p>\n<\/td>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">1302<\/p>\n<\/th>\n<td>\n<p align=\"left\">NaN<\/p>\n<\/td>\n<td>\n<p align=\"left\">3<\/p>\n<\/td>\n<td>\n<p align=\"left\">Spector, Mr. Woolf<\/p>\n<\/td>\n<td>\n<p align=\"left\">male<\/p>\n<\/td>\n<td>\n<p align=\"left\">28.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">A.5. 3236<\/p>\n<\/td>\n<td>\n<p align=\"left\">8.0500<\/p>\n<\/td>\n<td>\n<p align=\"left\">S<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">1303<\/p>\n<\/th>\n<td>\n<p align=\"left\">NaN<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<td>\n<p align=\"left\">Oliva y Ocana, Dona. Fermina<\/p>\n<\/td>\n<td>\n<p align=\"left\">female<\/p>\n<\/td>\n<td>\n<p align=\"left\">39.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">PC 17758<\/p>\n<\/td>\n<td>\n<p align=\"left\">108.9000<\/p>\n<\/td>\n<td>\n<p align=\"left\">C<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">1304<\/p>\n<\/th>\n<td>\n<p align=\"left\">NaN<\/p>\n<\/td>\n<td>\n<p align=\"left\">3<\/p>\n<\/td>\n<td>\n<p align=\"left\">Saether, Mr. Simon Sivertsen<\/p>\n<\/td>\n<td>\n<p align=\"left\">male<\/p>\n<\/td>\n<td>\n<p align=\"left\">38.5<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">SOTON\/O.Q. 3101262<\/p>\n<\/td>\n<td>\n<p align=\"left\">7.2500<\/p>\n<\/td>\n<td>\n<p align=\"left\">S<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">1305<\/p>\n<\/th>\n<td>\n<p align=\"left\">NaN<\/p>\n<\/td>\n<td>\n<p align=\"left\">3<\/p>\n<\/td>\n<td>\n<p align=\"left\">Ware, Mr. Frederick<\/p>\n<\/td>\n<td>\n<p align=\"left\">male<\/p>\n<\/td>\n<td>\n<p align=\"left\">28.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">359309<\/p>\n<\/td>\n<td>\n<p align=\"left\">8.0500<\/p>\n<\/td>\n<td>\n<p align=\"left\">S<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">1306<\/p>\n<\/th>\n<td>\n<p align=\"left\">NaN<\/p>\n<\/td>\n<td>\n<p align=\"left\">3<\/p>\n<\/td>\n<td>\n<p align=\"left\">Peter, Master. Michael J<\/p>\n<\/td>\n<td>\n<p align=\"left\">male<\/p>\n<\/td>\n<td>\n<p align=\"left\">28.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<td>\n<p align=\"left\">2668<\/p>\n<\/td>\n<td>\n<p align=\"left\">22.3583<\/p>\n<\/td>\n<td>\n<p align=\"left\">C<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>1307 rows \u00d7 12 columns<\/p>\n<h4>\u041d\u0430\u0447\u0438\u043d\u0430\u0435\u043c \u0438\u0437\u0431\u0430\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u043e\u0442 \u043d\u0435\u043d\u0443\u0436\u043d\u044b\u0445, \u043d\u0435 \u043d\u0435\u0441\u0443\u0449\u0438\u0445 \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u0434\u043b\u044f \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u043c\u043e\u0434\u0435\u043b\u0438, \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432<\/h4>\n<pre><code class=\"python\"># \u0418\u043c\u044f \u0438 \u043d\u043e\u043c\u0435\u0440 \u0431\u0438\u043b\u0435\u0442\u0430 \u0443\u0434\u0430\u043b\u044f\u0435\u043c  full_df = full_df.drop(columns=['Name','Ticket'])  <\/code><\/pre>\n<pre><code class=\"python\"># \u0421\u043c\u043e\u0442\u0440\u0438\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442  full_df  <\/code><\/pre>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th>\n<p align=\"left\">\n<\/th>\n<th>\n<p align=\"left\">Survived<\/p>\n<\/th>\n<th>\n<p align=\"left\">Pclass<\/p>\n<\/th>\n<th>\n<p align=\"left\">Sex<\/p>\n<\/th>\n<th>\n<p align=\"left\">Age<\/p>\n<\/th>\n<th>\n<p align=\"left\">SibSp<\/p>\n<\/th>\n<th>\n<p align=\"left\">Parch<\/p>\n<\/th>\n<th>\n<p align=\"left\">Fare<\/p>\n<\/th>\n<th>\n<p align=\"left\">Embarked<\/p>\n<\/th>\n<th>\n<p align=\"left\">is_train<\/p>\n<\/th>\n<th>\n<p align=\"left\">Has_Cabin<\/p>\n<\/th>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">0<\/p>\n<\/th>\n<td>\n<p align=\"left\">0.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">3<\/p>\n<\/td>\n<td>\n<p align=\"left\">male<\/p>\n<\/td>\n<td>\n<p align=\"left\">22.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">7.2500<\/p>\n<\/td>\n<td>\n<p align=\"left\">S<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">1<\/p>\n<\/th>\n<td>\n<p align=\"left\">1.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<td>\n<p align=\"left\">female<\/p>\n<\/td>\n<td>\n<p align=\"left\">38.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">71.2833<\/p>\n<\/td>\n<td>\n<p align=\"left\">C<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">2<\/p>\n<\/th>\n<td>\n<p align=\"left\">1.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">3<\/p>\n<\/td>\n<td>\n<p align=\"left\">female<\/p>\n<\/td>\n<td>\n<p align=\"left\">26.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">7.9250<\/p>\n<\/td>\n<td>\n<p align=\"left\">S<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">3<\/p>\n<\/th>\n<td>\n<p align=\"left\">1.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<td>\n<p align=\"left\">female<\/p>\n<\/td>\n<td>\n<p align=\"left\">35.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">53.1000<\/p>\n<\/td>\n<td>\n<p align=\"left\">S<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">4<\/p>\n<\/th>\n<td>\n<p align=\"left\">0.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">3<\/p>\n<\/td>\n<td>\n<p align=\"left\">male<\/p>\n<\/td>\n<td>\n<p align=\"left\">35.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">8.0500<\/p>\n<\/td>\n<td>\n<p align=\"left\">S<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">&#8230;<\/p>\n<\/th>\n<td>\n<p align=\"left\">&#8230;<\/p>\n<\/td>\n<td>\n<p align=\"left\">&#8230;<\/p>\n<\/td>\n<td>\n<p align=\"left\">&#8230;<\/p>\n<\/td>\n<td>\n<p align=\"left\">&#8230;<\/p>\n<\/td>\n<td>\n<p align=\"left\">&#8230;<\/p>\n<\/td>\n<td>\n<p align=\"left\">&#8230;<\/p>\n<\/td>\n<td>\n<p align=\"left\">&#8230;<\/p>\n<\/td>\n<td>\n<p align=\"left\">&#8230;<\/p>\n<\/td>\n<td>\n<p align=\"left\">&#8230;<\/p>\n<\/td>\n<td>\n<p align=\"left\">&#8230;<\/p>\n<\/td>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">1302<\/p>\n<\/th>\n<td>\n<p align=\"left\">NaN<\/p>\n<\/td>\n<td>\n<p align=\"left\">3<\/p>\n<\/td>\n<td>\n<p align=\"left\">male<\/p>\n<\/td>\n<td>\n<p align=\"left\">28.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">8.0500<\/p>\n<\/td>\n<td>\n<p align=\"left\">S<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">1303<\/p>\n<\/th>\n<td>\n<p align=\"left\">NaN<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<td>\n<p align=\"left\">female<\/p>\n<\/td>\n<td>\n<p align=\"left\">39.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">108.9000<\/p>\n<\/td>\n<td>\n<p align=\"left\">C<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">1304<\/p>\n<\/th>\n<td>\n<p align=\"left\">NaN<\/p>\n<\/td>\n<td>\n<p align=\"left\">3<\/p>\n<\/td>\n<td>\n<p align=\"left\">male<\/p>\n<\/td>\n<td>\n<p align=\"left\">38.5<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">7.2500<\/p>\n<\/td>\n<td>\n<p align=\"left\">S<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">1305<\/p>\n<\/th>\n<td>\n<p align=\"left\">NaN<\/p>\n<\/td>\n<td>\n<p align=\"left\">3<\/p>\n<\/td>\n<td>\n<p align=\"left\">male<\/p>\n<\/td>\n<td>\n<p align=\"left\">28.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">8.0500<\/p>\n<\/td>\n<td>\n<p align=\"left\">S<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">1306<\/p>\n<\/th>\n<td>\n<p align=\"left\">NaN<\/p>\n<\/td>\n<td>\n<p align=\"left\">3<\/p>\n<\/td>\n<td>\n<p align=\"left\">male<\/p>\n<\/td>\n<td>\n<p align=\"left\">28.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<td>\n<p align=\"left\">22.3583<\/p>\n<\/td>\n<td>\n<p align=\"left\">C<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>1307 rows \u00d7 10 columns<\/p>\n<h4>\u0412 \u0446\u0435\u043b\u043e\u043c \u043d\u0435 \u0441\u0442\u0435\u0441\u043d\u044f\u0435\u043c\u0441\u044f \u0447\u0430\u0441\u0442\u043e \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442. \u0412 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e\u0433\u043e \u043e\u0442\u0441\u043c\u043e\u0442\u0440\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0434\u0442\u0438 \u0438\u0434\u0435\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0443\u043b\u0443\u0447\u0448\u0438\u0442 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e \u043c\u043e\u0434\u0435\u043b\u0438<\/h4>\n<h4>\u0422\u0435\u043f\u0435\u0440\u044c \u0437\u0430\u043a\u043e\u0434\u0438\u0440\u0443\u0435\u043c \u043a\u043e\u043b\u043e\u043d\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u043c\u0438 (object), \u043a\u0430\u043a \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0438 (category). \u042d\u0442\u043e \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0432\u0430\u0436\u043d\u043e, \u0435\u0441\u043b\u0438 \u043c\u044b \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u044c CatBoost \u2014 \u043e\u043d\u0430 \u0443\u043c\u0435\u0435\u0442 \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0430\u043c\u0438 \u0438 \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0438\u0445 one-hot-\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f.<\/h4>\n<h4>CatBoost \u0441\u0430\u043c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u044d\u0442\u0438 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0438, \u0435\u0441\u043b\u0438 \u043e\u043d\u0438 \u0431\u0443\u0434\u0443\u0442 \u0438\u043c\u0435\u0442\u044c \u0442\u0438\u043f category, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u043c \u043d\u0443\u0436\u043d\u044b\u0435 \u043a\u043e\u043b\u043e\u043d\u043a\u0438 \u043a \u044d\u0442\u043e\u043c\u0443 \u0442\u0438\u043f\u0443.<\/h4>\n<pre><code class=\"python\"># \u041f\u0440\u0438\u0432\u043e\u0434\u0438\u043c \u043a\u043e\u043b\u043e\u043d\u043a\u0438 \u043f\u043e\u043b \u0438 \u043f\u043e\u0440\u0442 \u043f\u043e\u0441\u0430\u0434\u043a\u0438 \u043a \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0430\u043b\u044c\u043d\u043e\u043c\u0443 \u0432\u0438\u0434\u0443  full_df['Sex'] = full_df['Sex'].astype('category') full_df['Embarked'] = full_df['Embarked'].astype('category')  <\/code><\/pre>\n<pre><code class=\"python\"># \u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c  full_df.describe(include='all')  <\/code><\/pre>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th>\n<p align=\"left\">\n<\/th>\n<th>\n<p align=\"left\">Survived<\/p>\n<\/th>\n<th>\n<p align=\"left\">Pclass<\/p>\n<\/th>\n<th>\n<p align=\"left\">Sex<\/p>\n<\/th>\n<th>\n<p align=\"left\">Age<\/p>\n<\/th>\n<th>\n<p align=\"left\">SibSp<\/p>\n<\/th>\n<th>\n<p align=\"left\">Parch<\/p>\n<\/th>\n<th>\n<p align=\"left\">Fare<\/p>\n<\/th>\n<th>\n<p align=\"left\">Embarked<\/p>\n<\/th>\n<th>\n<p align=\"left\">is_train<\/p>\n<\/th>\n<th>\n<p align=\"left\">Has_Cabin<\/p>\n<\/th>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">count<\/p>\n<\/th>\n<td>\n<p align=\"left\">889.000000<\/p>\n<\/td>\n<td>\n<p align=\"left\">1307.000000<\/p>\n<\/td>\n<td>\n<p align=\"left\">1307<\/p>\n<\/td>\n<td>\n<p align=\"left\">1307.000000<\/p>\n<\/td>\n<td>\n<p align=\"left\">1307.000000<\/p>\n<\/td>\n<td>\n<p align=\"left\">1307.000000<\/p>\n<\/td>\n<td>\n<p align=\"left\">1307.000000<\/p>\n<\/td>\n<td>\n<p align=\"left\">1307<\/p>\n<\/td>\n<td>\n<p align=\"left\">1307.000000<\/p>\n<\/td>\n<td>\n<p align=\"left\">1307.000000<\/p>\n<\/td>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">unique<\/p>\n<\/th>\n<td>\n<p align=\"left\">NaN<\/p>\n<\/td>\n<td>\n<p align=\"left\">NaN<\/p>\n<\/td>\n<td>\n<p align=\"left\">2<\/p>\n<\/td>\n<td>\n<p align=\"left\">NaN<\/p>\n<\/td>\n<td>\n<p align=\"left\">NaN<\/p>\n<\/td>\n<td>\n<p align=\"left\">NaN<\/p>\n<\/td>\n<td>\n<p align=\"left\">NaN<\/p>\n<\/td>\n<td>\n<p align=\"left\">3<\/p>\n<\/td>\n<td>\n<p align=\"left\">NaN<\/p>\n<\/td>\n<td>\n<p align=\"left\">NaN<\/p>\n<\/td>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">top<\/p>\n<\/th>\n<td>\n<p align=\"left\">NaN<\/p>\n<\/td>\n<td>\n<p align=\"left\">NaN<\/p>\n<\/td>\n<td>\n<p align=\"left\">male<\/p>\n<\/td>\n<td>\n<p align=\"left\">NaN<\/p>\n<\/td>\n<td>\n<p align=\"left\">NaN<\/p>\n<\/td>\n<td>\n<p align=\"left\">NaN<\/p>\n<\/td>\n<td>\n<p align=\"left\">NaN<\/p>\n<\/td>\n<td>\n<p align=\"left\">S<\/p>\n<\/td>\n<td>\n<p align=\"left\">NaN<\/p>\n<\/td>\n<td>\n<p align=\"left\">NaN<\/p>\n<\/td>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">freq<\/p>\n<\/th>\n<td>\n<p align=\"left\">NaN<\/p>\n<\/td>\n<td>\n<p align=\"left\">NaN<\/p>\n<\/td>\n<td>\n<p align=\"left\">843<\/p>\n<\/td>\n<td>\n<p align=\"left\">NaN<\/p>\n<\/td>\n<td>\n<p align=\"left\">NaN<\/p>\n<\/td>\n<td>\n<p align=\"left\">NaN<\/p>\n<\/td>\n<td>\n<p align=\"left\">NaN<\/p>\n<\/td>\n<td>\n<p align=\"left\">914<\/p>\n<\/td>\n<td>\n<p align=\"left\">NaN<\/p>\n<\/td>\n<td>\n<p align=\"left\">NaN<\/p>\n<\/td>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">mean<\/p>\n<\/th>\n<td>\n<p align=\"left\">0.382452<\/p>\n<\/td>\n<td>\n<p align=\"left\">2.296863<\/p>\n<\/td>\n<td>\n<p align=\"left\">NaN<\/p>\n<\/td>\n<td>\n<p align=\"left\">29.471821<\/p>\n<\/td>\n<td>\n<p align=\"left\">0.499617<\/p>\n<\/td>\n<td>\n<p align=\"left\">0.385616<\/p>\n<\/td>\n<td>\n<p align=\"left\">33.209595<\/p>\n<\/td>\n<td>\n<p align=\"left\">NaN<\/p>\n<\/td>\n<td>\n<p align=\"left\">0.680184<\/p>\n<\/td>\n<td>\n<p align=\"left\">0.224178<\/p>\n<\/td>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">std<\/p>\n<\/th>\n<td>\n<p align=\"left\">0.486260<\/p>\n<\/td>\n<td>\n<p align=\"left\">0.836942<\/p>\n<\/td>\n<td>\n<p align=\"left\">NaN<\/p>\n<\/td>\n<td>\n<p align=\"left\">12.881592<\/p>\n<\/td>\n<td>\n<p align=\"left\">1.042273<\/p>\n<\/td>\n<td>\n<p align=\"left\">0.866092<\/p>\n<\/td>\n<td>\n<p align=\"left\">51.748768<\/p>\n<\/td>\n<td>\n<p align=\"left\">NaN<\/p>\n<\/td>\n<td>\n<p align=\"left\">0.466584<\/p>\n<\/td>\n<td>\n<p align=\"left\">0.417199<\/p>\n<\/td>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">min<\/p>\n<\/th>\n<td>\n<p align=\"left\">0.000000<\/p>\n<\/td>\n<td>\n<p align=\"left\">1.000000<\/p>\n<\/td>\n<td>\n<p align=\"left\">NaN<\/p>\n<\/td>\n<td>\n<p align=\"left\">0.170000<\/p>\n<\/td>\n<td>\n<p align=\"left\">0.000000<\/p>\n<\/td>\n<td>\n<p align=\"left\">0.000000<\/p>\n<\/td>\n<td>\n<p align=\"left\">0.000000<\/p>\n<\/td>\n<td>\n<p align=\"left\">NaN<\/p>\n<\/td>\n<td>\n<p align=\"left\">0.000000<\/p>\n<\/td>\n<td>\n<p align=\"left\">0.000000<\/p>\n<\/td>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">25%<\/p>\n<\/th>\n<td>\n<p align=\"left\">0.000000<\/p>\n<\/td>\n<td>\n<p align=\"left\">2.000000<\/p>\n<\/td>\n<td>\n<p align=\"left\">NaN<\/p>\n<\/td>\n<td>\n<p align=\"left\">22.000000<\/p>\n<\/td>\n<td>\n<p align=\"left\">0.000000<\/p>\n<\/td>\n<td>\n<p align=\"left\">0.000000<\/p>\n<\/td>\n<td>\n<p align=\"left\">7.895800<\/p>\n<\/td>\n<td>\n<p align=\"left\">NaN<\/p>\n<\/td>\n<td>\n<p align=\"left\">0.000000<\/p>\n<\/td>\n<td>\n<p align=\"left\">0.000000<\/p>\n<\/td>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">50%<\/p>\n<\/th>\n<td>\n<p align=\"left\">0.000000<\/p>\n<\/td>\n<td>\n<p align=\"left\">3.000000<\/p>\n<\/td>\n<td>\n<p align=\"left\">NaN<\/p>\n<\/td>\n<td>\n<p align=\"left\">28.000000<\/p>\n<\/td>\n<td>\n<p align=\"left\">0.000000<\/p>\n<\/td>\n<td>\n<p align=\"left\">0.000000<\/p>\n<\/td>\n<td>\n<p align=\"left\">14.454200<\/p>\n<\/td>\n<td>\n<p align=\"left\">NaN<\/p>\n<\/td>\n<td>\n<p align=\"left\">1.000000<\/p>\n<\/td>\n<td>\n<p align=\"left\">0.000000<\/p>\n<\/td>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">75%<\/p>\n<\/th>\n<td>\n<p align=\"left\">1.000000<\/p>\n<\/td>\n<td>\n<p align=\"left\">3.000000<\/p>\n<\/td>\n<td>\n<p align=\"left\">NaN<\/p>\n<\/td>\n<td>\n<p align=\"left\">35.000000<\/p>\n<\/td>\n<td>\n<p align=\"left\">1.000000<\/p>\n<\/td>\n<td>\n<p align=\"left\">0.000000<\/p>\n<\/td>\n<td>\n<p align=\"left\">31.275000<\/p>\n<\/td>\n<td>\n<p align=\"left\">NaN<\/p>\n<\/td>\n<td>\n<p align=\"left\">1.000000<\/p>\n<\/td>\n<td>\n<p align=\"left\">0.000000<\/p>\n<\/td>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">max<\/p>\n<\/th>\n<td>\n<p align=\"left\">1.000000<\/p>\n<\/td>\n<td>\n<p align=\"left\">3.000000<\/p>\n<\/td>\n<td>\n<p align=\"left\">NaN<\/p>\n<\/td>\n<td>\n<p align=\"left\">80.000000<\/p>\n<\/td>\n<td>\n<p align=\"left\">8.000000<\/p>\n<\/td>\n<td>\n<p align=\"left\">9.000000<\/p>\n<\/td>\n<td>\n<p align=\"left\">512.329200<\/p>\n<\/td>\n<td>\n<p align=\"left\">NaN<\/p>\n<\/td>\n<td>\n<p align=\"left\">1.000000<\/p>\n<\/td>\n<td>\n<p align=\"left\">1.000000<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<h4>\u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u043a\u043e\u043b\u043e\u043d\u043a\u0430 Pclass \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u0438\u043c\u0435\u0435\u0442 \u0442\u0438\u043f int, \u043d\u043e \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u044d\u0442\u043e \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u0440\u0438\u0437\u043d\u0430\u043a (\u043a\u043b\u0430\u0441\u0441 \u043e\u0431\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u043d\u0438\u044f: 1, 2 \u0438\u043b\u0438 3). \u0415\u0441\u043b\u0438 \u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0435\u0451 \u043a\u0430\u043a \u0447\u0438\u0441\u043b\u043e\u0432\u0443\u044e, \u043c\u043e\u0434\u0435\u043b\u044c \u043c\u043e\u0436\u0435\u0442 \u043e\u0448\u0438\u0431\u043e\u0447\u043d\u043e \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u0442\u044c, \u0447\u0442\u043e \u043a\u043b\u0430\u0441\u0441 3 \u00ab\u0431\u043e\u043b\u044c\u0448\u0435\u00bb \u0438 \u0432\u0430\u0436\u043d\u0435\u0435, \u0447\u0435\u043c \u043a\u043b\u0430\u0441\u0441 2, \u0430 \u0442\u043e\u0442 \u2014 \u0432\u0430\u0436\u043d\u0435\u0435, \u0447\u0435\u043c \u043a\u043b\u0430\u0441\u0441 1. \u0427\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u044d\u0442\u043e\u0433\u043e, \u043c\u044b \u0442\u0430\u043a\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u043c Pclass \u043a \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0430\u043b\u044c\u043d\u043e\u043c\u0443 \u0442\u0438\u043f\u0443.<\/h4>\n<pre><code class=\"python\"># \u041f\u0440\u0438\u0432\u043e\u0434\u0438\u043c \u043a\u043e\u043b\u043e\u043d\u043a\u0443 \u043a\u043b\u0430\u0441\u0441 \u043a \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0430\u043b\u044c\u043d\u043e\u043c\u0443 \u0432\u0438\u0434\u0443  full_df['Pclass'] = full_df['Pclass'].astype('category')  <\/code><\/pre>\n<h4>\u041e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0430 \u0438 \u0442\u0435\u043f\u0435\u0440\u044c \u0440\u0430\u0437\u0434\u0435\u043b\u044f\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u043e\u0431\u0440\u0430\u0442\u043d\u043e:<\/h4>\n<pre><code class=\"python\"># \u0420\u0430\u0437\u0434\u0435\u043b\u0438\u043c \u043e\u0431\u0440\u0430\u0442\u043d\u043e:  X_train = full_df[full_df['is_train'] == 1].drop(['is_train', 'Survived'], axis=1) y_train = full_df[full_df['is_train'] == 1]['Survived']  X_test  = full_df[full_df['is_train'] == 0].drop(['is_train', 'Survived'], axis=1)  <\/code><\/pre>\n<pre><code class=\"python\"># \u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0440\u0430\u0437\u043c\u0435\u0440\u044b  print(X_train.shape, y_train.shape, X_test.shape)  <\/code><\/pre>\n<pre><code>(889, 8) (889,) (418, 8) <\/code><\/pre>\n<h4>\u041d\u0430\u0447\u0438\u043d\u0430\u0435\u043c \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0438<\/h4>\n<pre><code class=\"python\"># \u041d\u0430\u0447\u0438\u043d\u0430\u0435\u043c \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 # \u0421\u043d\u0430\u0447\u0430\u043b\u0438 \u0441\u043f\u043b\u0438\u0442\u0442\u0438\u043c \u0432\u044b\u0431\u043e\u0440\u043a\u0443  X_train_split, X_valid, y_train_split, y_valid = train_test_split(     X_train, y_train,     test_size=0.2,     random_state=42,     stratify=y_train )  <\/code><\/pre>\n<pre><code class=\"python\"># \u041f\u043e\u043b\u043e\u0436\u0438\u043c \u0432 \u0441\u043f\u0438\u0441\u043e\u043a \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432 \u0434\u043b\u044f CatBoost \u043d\u0430\u0448\u0438 \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u043d\u043d\u044b\u0435 \u043a \u0442\u0438\u043f\u0443 Category \u043a\u043e\u043b\u043e\u043d\u043a\u0438  cat_features = X_train.select_dtypes(include='category').columns.tolist()  <\/code><\/pre>\n<pre><code class=\"python\"># \u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c  cat_features  <\/code><\/pre>\n<pre><code>['Pclass', 'Sex', 'Embarked'] <\/code><\/pre>\n<pre><code class=\"python\"># \u041e\u0431\u0443\u0447\u0430\u0435\u043c \u043c\u043e\u0434\u0435\u043b\u044c \u0441 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0441\u0440\u0435\u0434\u043d\u0438\u043c\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438 # \u041f\u043e\u043a\u0430 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043f\u0435\u0440\u0435\u0431\u043e\u0440 \u0433\u0438\u043f\u0435\u0440\u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432  model = CatBoostClassifier(     iterations=1000,     learning_rate=0.05,     depth=6,     eval_metric='Accuracy',     random_seed=42,     early_stopping_rounds=50,     verbose=100 )  model.fit(     X_train_split, y_train_split,     eval_set=(X_valid, y_valid),     cat_features=cat_features )  <\/code><\/pre>\n<pre><code>0:learn: 0.8227848test: 0.7977528best: 0.7977528 (0)total: 160msremaining: 2m 39s Stopped by overfitting detector  (50 iterations wait)  bestTest = 0.8314606742 bestIteration = 32  Shrink model to first 33 iterations. <\/code><\/pre>\n<pre><code class=\"python\"># \u041e\u0446\u0435\u043d\u0438\u043c \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e y_pred = model.predict(X_valid) acc = accuracy_score(y_valid, y_pred) print(f\"Validation Accuracy: {acc:.4f}\")  <\/code><\/pre>\n<pre><code>Validation Accuracy: 0.8315 <\/code><\/pre>\n<h4>\u0414\u043e\u043b\u044f \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0445 \u043e\u0442\u0432\u0435\u0442\u043e\u0432 83,15%<\/h4>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/383\/194\/e3c\/383194e3ce8a9647bfd619f6156c3553.png\" alt=\"image.png\" width=\"488\" height=\"82\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/383\/194\/e3c\/383194e3ce8a9647bfd619f6156c3553.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/383\/194\/e3c\/383194e3ce8a9647bfd619f6156c3553.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>image.png<\/figcaption><\/div>\n<\/figure>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/772\/713\/cf9\/772713cf927094e68dd5ab479f65ddda.png\" alt=\"image.png\" width=\"623\" height=\"137\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/772\/713\/cf9\/772713cf927094e68dd5ab479f65ddda.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/772\/713\/cf9\/772713cf927094e68dd5ab479f65ddda.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>image.png<\/figcaption><\/div>\n<\/figure>\n<pre><code class=\"python\"># \u041f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u0438\u0435 \u043d\u0430 \u0442\u0435\u0441\u0442\u0435  test_preds = model.predict(X_test)   <\/code><\/pre>\n<pre><code class=\"python\"># \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u0438\u044f \u043c\u043e\u0434\u0435\u043b\u0438  test_preds  <\/code><\/pre>\n<pre><code>array([0., 0., 0., 0., 0., 0., 1., 0., 1., 0., 0., 0., 1., 0., 1., 1., 0.,        0., 0., 1., 0., 0., 1., 0., 1., 0., 1., 0., 0., 0., 0., 0., 0., 0.,        0., 0., 0., 0., 0., 0., 0., 0., 0., 1., 1., 0., 0., 0., 1., 0., 0.,        0., 1., 1., 0., 0., 0., 0., 0., 1., 0., 0., 0., 1., 1., 1., 1., 0.,        0., 1., 1., 0., 0., 0., 1., 0., 0., 1., 0., 1., 1., 0., 0., 0., 0.,        0., 1., 0., 1., 1., 0., 0., 1., 0., 0., 0., 1., 0., 1., 0., 1., 0.,        0., 0., 1., 0., 0., 0., 0., 0., 0., 1., 1., 1., 1., 0., 0., 1., 0.,        1., 1., 0., 1., 0., 0., 0., 0., 1., 0., 0., 0., 0., 0., 0., 0., 0.,        0., 0., 0., 0., 0., 1., 0., 0., 0., 0., 0., 0., 0., 0., 1., 0., 0.,        0., 0., 0., 1., 1., 0., 0., 1., 1., 1., 0., 0., 0., 0., 0., 1., 0.,        0., 0., 0., 0., 0., 1., 1., 0., 1., 1., 0., 0., 1., 0., 1., 0., 1.,        0., 0., 0., 0., 0., 0., 0., 1., 0., 1., 1., 0., 0., 1., 1., 0., 1.,        0., 0., 1., 0., 1., 0., 0., 0., 0., 1., 0., 0., 1., 0., 1., 0., 1.,        0., 1., 0., 1., 1., 0., 1., 0., 0., 0., 1., 0., 0., 0., 0., 0., 0.,        1., 1., 1., 1., 0., 0., 0., 0., 1., 0., 1., 1., 1., 0., 0., 0., 0.,        0., 0., 0., 1., 0., 0., 0., 1., 1., 0., 0., 0., 0., 0., 0., 0., 0.,        1., 1., 0., 1., 0., 0., 0., 0., 0., 1., 1., 1., 1., 0., 0., 0., 0.,        0., 0., 1., 0., 0., 0., 0., 1., 0., 0., 0., 0., 0., 0., 0., 1., 1.,        0., 1., 0., 0., 0., 0., 0., 1., 1., 1., 0., 0., 0., 0., 0., 0., 0.,        0., 1., 0., 1., 0., 0., 0., 1., 0., 0., 1., 0., 0., 0., 0., 0., 0.,        0., 0., 0., 1., 0., 1., 0., 1., 0., 1., 1., 0., 0., 0., 1., 0., 1.,        0., 0., 0., 0., 1., 1., 0., 1., 0., 0., 0., 1., 0., 0., 1., 0., 0.,        1., 1., 0., 0., 0., 0., 0., 0., 0., 0., 0., 1., 0., 0., 0., 0., 0.,        1., 0., 0., 0., 1., 0., 1., 0., 0., 1., 0., 1., 0., 0., 0., 0., 0.,        1., 1., 1., 1., 1., 0., 1., 0., 0., 0.]) <\/code><\/pre>\n<pre><code class=\"python\"># \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 submission.csv  submission = pd.DataFrame({     'PassengerId': passenger_ids,     'Survived': test_preds.astype(int) })  submission.to_csv('..\/submissions\/submission.csv', index=False) print(\"\u2705 Submission \u0444\u0430\u0439\u043b \u0441\u043e\u0445\u0440\u0430\u043d\u0451\u043d \u043a\u0430\u043a submission.csv\")  <\/code><\/pre>\n<pre><code>\u2705 Submission \u0444\u0430\u0439\u043b \u0441\u043e\u0445\u0440\u0430\u043d\u0451\u043d \u043a\u0430\u043a submission.csv <\/code><\/pre>\n<pre><code class=\"python\"># \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0444\u0430\u0439\u043b  submission   <\/code><\/pre>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th>\n<p align=\"left\">\n<\/th>\n<th>\n<p align=\"left\">PassengerId<\/p>\n<\/th>\n<th>\n<p align=\"left\">Survived<\/p>\n<\/th>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">0<\/p>\n<\/th>\n<td>\n<p align=\"left\">892<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">1<\/p>\n<\/th>\n<td>\n<p align=\"left\">893<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">2<\/p>\n<\/th>\n<td>\n<p align=\"left\">894<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">3<\/p>\n<\/th>\n<td>\n<p align=\"left\">895<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">4<\/p>\n<\/th>\n<td>\n<p align=\"left\">896<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">&#8230;<\/p>\n<\/th>\n<td>\n<p align=\"left\">&#8230;<\/p>\n<\/td>\n<td>\n<p align=\"left\">&#8230;<\/p>\n<\/td>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">413<\/p>\n<\/th>\n<td>\n<p align=\"left\">1305<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">414<\/p>\n<\/th>\n<td>\n<p align=\"left\">1306<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">415<\/p>\n<\/th>\n<td>\n<p align=\"left\">1307<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">416<\/p>\n<\/th>\n<td>\n<p align=\"left\">1308<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">417<\/p>\n<\/th>\n<td>\n<p align=\"left\">1309<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>418 rows \u00d7 2 columns<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/8d3\/db1\/246\/8d3db1246bfa92a26d6e34f2bbd05cc4.png\" alt=\"image.png\" width=\"1072\" height=\"78\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/8d3\/db1\/246\/8d3db1246bfa92a26d6e34f2bbd05cc4.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/8d3\/db1\/246\/8d3db1246bfa92a26d6e34f2bbd05cc4.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>image.png<\/figcaption><\/div>\n<\/figure>\n<h4>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0422\u043e\u043f 2&#8217;400<\/h4>\n<h4>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0443\u043b\u0443\u0447\u0448\u0438\u0442\u044c \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e \u043c\u043e\u0434\u0435\u043b\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u043e\u0434\u0431\u043e\u0440\u0430 \u0433\u0438\u043f\u0435\u0440\u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432<\/h4>\n<h4>\u0411\u0443\u0434\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0439 \u043f\u043e\u0434\u0431\u043e\u0440 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e RandomizedSearchCV<\/h4>\n<pre><code class=\"python\"># \u0418\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u043c\u043e\u0434\u0443\u043b\u044c  from sklearn.model_selection import RandomizedSearchCV  <\/code><\/pre>\n<pre><code class=\"python\">#\u0421\u0435\u0442\u043a\u0430 \u0433\u0438\u043f\u0435\u0440\u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432  param_grid = {     'depth': [4, 6, 8, 10],              # \u041c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u0430\u044f \u0433\u043b\u0443\u0431\u0438\u043d\u0430 \u0434\u0435\u0440\u0435\u0432\u0430 (\u0447\u0435\u043c \u0433\u043b\u0443\u0431\u0436\u0435 \u2014 \u0442\u0435\u043c \u0441\u043b\u043e\u0436\u043d\u0435\u0435 \u043c\u043e\u0434\u0435\u043b\u044c)     'learning_rate': [0.01, 0.05, 0.1],  # \u0421\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f (\u043c\u0430\u043b\u0435\u043d\u044c\u043a\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 = \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u0435\u0435 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435, \u043d\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0442\u043e\u0447\u043d\u0435\u0435)      'iterations': [300, 500, 1000],      # \u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0434\u0435\u0440\u0435\u0432\u044c\u0435\u0432 (\u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0439 \u0431\u0443\u0441\u0442\u0438\u043d\u0433\u0430)     'l2_leaf_reg': [1, 3, 5, 7, 9],      # L2-\u0440\u0435\u0433\u0443\u043b\u044f\u0440\u0438\u0437\u0430\u0446\u0438\u044f \u2014 \u043f\u0440\u0435\u0434\u043e\u0442\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043f\u0435\u0440\u0435\u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435     'border_count': [32, 64, 128]        # \u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0431\u0438\u043d\u043e\u0432 \u0434\u043b\u044f \u0434\u0438\u0441\u043a\u0440\u0435\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u0447\u0438\u0441\u043b\u043e\u0432\u044b\u0445 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432 }  #Randomized Search \u0441 \u043a\u0440\u043e\u0441\u0441-\u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0435\u0439  random_search = RandomizedSearchCV(     estimator=model,     param_distributions=param_grid,     n_iter=45,                   # \u0421\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0445 \u043a\u043e\u043c\u0431\u0438\u043d\u0430\u0446\u0438\u0439 \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c     scoring='accuracy',          # \u041c\u0435\u0442\u0440\u0438\u043a\u0430 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043d\u0443\u0436\u043d\u043e \u043c\u0430\u043a\u0441\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c     cv=10,                       # \u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0444\u043e\u043b\u0434\u043e\u0432 (\u0440\u0430\u0437\u0431\u0438\u0435\u043d\u0438\u0439) \u0434\u043b\u044f \u043a\u0440\u043e\u0441\u0441-\u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438     verbose=2,                   # \u041f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u0432 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0435     n_jobs=-1                    # \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0435 \u044f\u0434\u0440\u0430 CPU \u0434\u043b\u044f \u0443\u0441\u043a\u043e\u0440\u0435\u043d\u0438\u044f )  <\/code><\/pre>\n<pre><code class=\"python\"># \u0421\u043e\u0437\u0434\u0430\u0451\u043c \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u043c\u043e\u0434\u0435\u043b\u0438  model = CatBoostClassifier(silent=True, random_state=42) # random state \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439   <\/code><\/pre>\n<pre><code class=\"python\"># \u0424\u0438\u043a\u0441\u0438\u0440\u0443\u0435\u043c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0434\u043b\u044f \u043c\u043e\u0434\u0435\u043b\u0438  fit_params = {     \"eval_set\": [(X_valid, y_valid)], # \u041d\u0430\u0431\u043e\u0440 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 (\u0434\u043b\u044f \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f \u043f\u0435\u0440\u0435\u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f early stopping)     \"early_stopping_rounds\": 100,     # \u0415\u0441\u043b\u0438 \u043c\u0435\u0442\u0440\u0438\u043a\u0430 \u043d\u0435 \u0443\u043b\u0443\u0447\u0448\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u0435\u0447\u0435\u043d\u0438\u0435 100 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0439 \u2014 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f     \"cat_features\": cat_features,     # \u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c, \u043a\u0430\u043a\u0438\u0435 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0438 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0430\u043b\u044c\u043d\u044b\u043c\u0438 (CatBoost \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 \u043d\u0438\u043c\u0438 \u043d\u0430\u0442\u0438\u0432\u043d\u043e)     \"verbose\": 1                      # \u041f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0433\u0440\u0435\u0441\u0441 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0442\u0440\u0435\u043d\u0438\u0440\u043e\u0432\u043a\u0438 }  <\/code><\/pre>\n<pre><code class=\"python\">#\u0417\u0430\u043f\u0443\u0441\u043a \u043f\u043e\u0434\u0431\u043e\u0440\u0430  random_search.fit(X_train_split, y_train_split, **fit_params)  <\/code><\/pre>\n<pre><code>Fitting 10 folds for each of 45 candidates, totalling 450 fits 0:learn: 0.7988748test: 0.7752809best: 0.7752809 (0)total: 18.8msremaining: 5.63s 1:learn: 0.8016878test: 0.7808989best: 0.7808989 (1)total: 39.8msremaining: 5.93s 2:learn: 0.8101266test: 0.7921348best: 0.7921348 (2)total: 56.4msremaining: 5.58s 3:learn: 0.8045007test: 0.7865169best: 0.7921348 (2)total: 76.9msremaining: 5.69s 4:learn: 0.8030942test: 0.7865169best: 0.7921348 (2)total: 97.1msremaining: 5.73s 5:learn: 0.8087201test: 0.7977528best: 0.7977528 (5)total: 118msremaining: 5.78s 6:learn: 0.8087201test: 0.7977528best: 0.7977528 (5)total: 139msremaining: 5.82s 7:learn: 0.8101266test: 0.8033708best: 0.8033708 (7)total: 160msremaining: 5.85s 8:learn: 0.8101266test: 0.7977528best: 0.8033708 (7)total: 181msremaining: 5.86s 9:learn: 0.8101266test: 0.7977528best: 0.8033708 (7)total: 201msremaining: 5.82s 10:learn: 0.8101266test: 0.7977528best: 0.8033708 (7)total: 220msremaining: 5.77s 11:learn: 0.8115331test: 0.7977528best: 0.8033708 (7)total: 241msremaining: 5.78s 12:learn: 0.8171589test: 0.7977528best: 0.8033708 (7)total: 262msremaining: 5.78s 13:learn: 0.8185654test: 0.7977528best: 0.8033708 (7)total: 293msremaining: 5.98s 14:learn: 0.8185654test: 0.8033708best: 0.8033708 (7)total: 322msremaining: 6.12s 15:learn: 0.8185654test: 0.8033708best: 0.8033708 (7)total: 348msremaining: 6.17s 16:learn: 0.8185654test: 0.8033708best: 0.8033708 (7)total: 369msremaining: 6.14s 17:learn: 0.8185654test: 0.8033708best: 0.8033708 (7)total: 385msremaining: 6.03s 18:learn: 0.8199719test: 0.8033708best: 0.8033708 (7)total: 407msremaining: 6.03s 19:learn: 0.8227848test: 0.8033708best: 0.8033708 (7)total: 430msremaining: 6.02s 20:learn: 0.8227848test: 0.8033708best: 0.8033708 (7)total: 452msremaining: 6s 21:learn: 0.8227848test: 0.8033708best: 0.8033708 (7)total: 473msremaining: 5.98s 22:learn: 0.8255977test: 0.8033708best: 0.8033708 (7)total: 495msremaining: 5.96s 23:learn: 0.8270042test: 0.8033708best: 0.8033708 (7)total: 501msremaining: 5.76s 24:learn: 0.8270042test: 0.8033708best: 0.8033708 (7)total: 521msremaining: 5.73s 25:learn: 0.8255977test: 0.8033708best: 0.8033708 (7)total: 536msremaining: 5.65s 26:learn: 0.8255977test: 0.8033708best: 0.8033708 (7)total: 558msremaining: 5.64s 27:learn: 0.8241913test: 0.7977528best: 0.8033708 (7)total: 576msremaining: 5.6s 28:learn: 0.8255977test: 0.7977528best: 0.8033708 (7)total: 596msremaining: 5.57s 29:learn: 0.8255977test: 0.8033708best: 0.8033708 (7)total: 615msremaining: 5.54s 30:learn: 0.8255977test: 0.8033708best: 0.8033708 (7)total: 635msremaining: 5.51s 31:learn: 0.8255977test: 0.8089888best: 0.8089888 (31)total: 655msremaining: 5.48s 32:learn: 0.8284107test: 0.8089888best: 0.8089888 (31)total: 674msremaining: 5.45s 33:learn: 0.8298172test: 0.8146067best: 0.8146067 (33)total: 694msremaining: 5.43s 34:learn: 0.8340366test: 0.8146067best: 0.8146067 (33)total: 706msremaining: 5.35s 35:learn: 0.8354430test: 0.8146067best: 0.8146067 (33)total: 728msremaining: 5.34s 36:learn: 0.8354430test: 0.8146067best: 0.8146067 (33)total: 749msremaining: 5.32s 37:learn: 0.8368495test: 0.8089888best: 0.8146067 (33)total: 764msremaining: 5.27s 38:learn: 0.8382560test: 0.8089888best: 0.8146067 (33)total: 780msremaining: 5.22s 39:learn: 0.8368495test: 0.8089888best: 0.8146067 (33)total: 799msremaining: 5.19s 40:learn: 0.8368495test: 0.8089888best: 0.8146067 (33)total: 820msremaining: 5.18s 41:learn: 0.8382560test: 0.8089888best: 0.8146067 (33)total: 840msremaining: 5.16s 42:learn: 0.8382560test: 0.8202247best: 0.8202247 (42)total: 862msremaining: 5.15s 43:learn: 0.8410689test: 0.8146067best: 0.8202247 (42)total: 884msremaining: 5.14s 44:learn: 0.8396624test: 0.8146067best: 0.8202247 (42)total: 907msremaining: 5.14s 45:learn: 0.8438819test: 0.8258427best: 0.8258427 (45)total: 930msremaining: 5.14s 46:learn: 0.8466948test: 0.8258427best: 0.8258427 (45)total: 953msremaining: 5.13s 47:learn: 0.8466948test: 0.8258427best: 0.8258427 (45)total: 976msremaining: 5.12s 48:learn: 0.8481013test: 0.8258427best: 0.8258427 (45)total: 999msremaining: 5.12s 49:learn: 0.8452883test: 0.8314607best: 0.8314607 (49)total: 1.02sremaining: 5.11s 50:learn: 0.8438819test: 0.8314607best: 0.8314607 (49)total: 1.04sremaining: 5.09s 51:learn: 0.8438819test: 0.8314607best: 0.8314607 (49)total: 1.06sremaining: 5.07s 52:learn: 0.8452883test: 0.8370787best: 0.8370787 (52)total: 1.08sremaining: 5.05s 53:learn: 0.8424754test: 0.8370787best: 0.8370787 (52)total: 1.1sremaining: 5.04s 54:learn: 0.8396624test: 0.8370787best: 0.8370787 (52)total: 1.13sremaining: 5.01s 55:learn: 0.8396624test: 0.8314607best: 0.8370787 (52)total: 1.15sremaining: 4.99s 56:learn: 0.8396624test: 0.8314607best: 0.8370787 (52)total: 1.17sremaining: 4.97s 57:learn: 0.8382560test: 0.8314607best: 0.8370787 (52)total: 1.18sremaining: 4.94s 58:learn: 0.8382560test: 0.8314607best: 0.8370787 (52)total: 1.2sremaining: 4.89s 59:learn: 0.8396624test: 0.8314607best: 0.8370787 (52)total: 1.22sremaining: 4.87s 60:learn: 0.8396624test: 0.8314607best: 0.8370787 (52)total: 1.24sremaining: 4.85s 61:learn: 0.8396624test: 0.8314607best: 0.8370787 (52)total: 1.27sremaining: 4.89s 62:learn: 0.8396624test: 0.8314607best: 0.8370787 (52)total: 1.29sremaining: 4.87s 63:learn: 0.8396624test: 0.8314607best: 0.8370787 (52)total: 1.32sremaining: 4.86s 64:learn: 0.8396624test: 0.8314607best: 0.8370787 (52)total: 1.34sremaining: 4.85s 65:learn: 0.8396624test: 0.8314607best: 0.8370787 (52)total: 1.36sremaining: 4.84s 66:learn: 0.8410689test: 0.8314607best: 0.8370787 (52)total: 1.39sremaining: 4.82s 67:learn: 0.8410689test: 0.8314607best: 0.8370787 (52)total: 1.41sremaining: 4.8s 68:learn: 0.8410689test: 0.8314607best: 0.8370787 (52)total: 1.42sremaining: 4.75s 69:learn: 0.8424754test: 0.8314607best: 0.8370787 (52)total: 1.44sremaining: 4.74s 70:learn: 0.8424754test: 0.8314607best: 0.8370787 (52)total: 1.46sremaining: 4.72s 71:learn: 0.8424754test: 0.8314607best: 0.8370787 (52)total: 1.49sremaining: 4.7s 72:learn: 0.8438819test: 0.8314607best: 0.8370787 (52)total: 1.51sremaining: 4.69s 73:learn: 0.8396624test: 0.8314607best: 0.8370787 (52)total: 1.52sremaining: 4.66s 74:learn: 0.8382560test: 0.8258427best: 0.8370787 (52)total: 1.55sremaining: 4.64s 75:learn: 0.8410689test: 0.8258427best: 0.8370787 (52)total: 1.57sremaining: 4.63s 76:learn: 0.8424754test: 0.8202247best: 0.8370787 (52)total: 1.59sremaining: 4.6s 77:learn: 0.8424754test: 0.8202247best: 0.8370787 (52)total: 1.61sremaining: 4.58s 78:learn: 0.8438819test: 0.8202247best: 0.8370787 (52)total: 1.63sremaining: 4.56s 79:learn: 0.8452883test: 0.8202247best: 0.8370787 (52)total: 1.65sremaining: 4.54s 80:learn: 0.8452883test: 0.8202247best: 0.8370787 (52)total: 1.67sremaining: 4.52s 81:learn: 0.8452883test: 0.8202247best: 0.8370787 (52)total: 1.69sremaining: 4.49s 82:learn: 0.8452883test: 0.8202247best: 0.8370787 (52)total: 1.71sremaining: 4.47s 83:learn: 0.8452883test: 0.8202247best: 0.8370787 (52)total: 1.73sremaining: 4.44s 84:learn: 0.8438819test: 0.8202247best: 0.8370787 (52)total: 1.75sremaining: 4.42s 85:learn: 0.8452883test: 0.8202247best: 0.8370787 (52)total: 1.77sremaining: 4.39s 86:learn: 0.8452883test: 0.8202247best: 0.8370787 (52)total: 1.79sremaining: 4.37s 87:learn: 0.8438819test: 0.8202247best: 0.8370787 (52)total: 1.8sremaining: 4.35s 88:learn: 0.8452883test: 0.8146067best: 0.8370787 (52)total: 1.83sremaining: 4.33s 89:learn: 0.8438819test: 0.8146067best: 0.8370787 (52)total: 1.85sremaining: 4.31s 90:learn: 0.8438819test: 0.8146067best: 0.8370787 (52)total: 1.87sremaining: 4.29s 91:learn: 0.8438819test: 0.8146067best: 0.8370787 (52)total: 1.89sremaining: 4.26s 92:learn: 0.8438819test: 0.8146067best: 0.8370787 (52)total: 1.91sremaining: 4.24s 93:learn: 0.8438819test: 0.8258427best: 0.8370787 (52)total: 1.92sremaining: 4.22s 94:learn: 0.8438819test: 0.8258427best: 0.8370787 (52)total: 1.93sremaining: 4.16s 95:learn: 0.8438819test: 0.8258427best: 0.8370787 (52)total: 1.95sremaining: 4.14s 96:learn: 0.8438819test: 0.8202247best: 0.8370787 (52)total: 1.97sremaining: 4.12s 97:learn: 0.8438819test: 0.8258427best: 0.8370787 (52)total: 1.99sremaining: 4.1s 98:learn: 0.8438819test: 0.8258427best: 0.8370787 (52)total: 2.01sremaining: 4.08s 99:learn: 0.8438819test: 0.8258427best: 0.8370787 (52)total: 2.02sremaining: 4.05s 100:learn: 0.8438819test: 0.8258427best: 0.8370787 (52)total: 2.04sremaining: 4.03s 101:learn: 0.8438819test: 0.8258427best: 0.8370787 (52)total: 2.06sremaining: 4.01s 102:learn: 0.8438819test: 0.8258427best: 0.8370787 (52)total: 2.09sremaining: 3.99s 103:learn: 0.8438819test: 0.8258427best: 0.8370787 (52)total: 2.11sremaining: 3.97s 104:learn: 0.8438819test: 0.8258427best: 0.8370787 (52)total: 2.13sremaining: 3.95s 105:learn: 0.8452883test: 0.8202247best: 0.8370787 (52)total: 2.15sremaining: 3.93s 106:learn: 0.8452883test: 0.8202247best: 0.8370787 (52)total: 2.2sremaining: 3.97s 107:learn: 0.8452883test: 0.8202247best: 0.8370787 (52)total: 2.24sremaining: 3.99s 108:learn: 0.8452883test: 0.8146067best: 0.8370787 (52)total: 2.28sremaining: 3.99s 109:learn: 0.8466948test: 0.8146067best: 0.8370787 (52)total: 2.3sremaining: 3.98s 110:learn: 0.8466948test: 0.8146067best: 0.8370787 (52)total: 2.32sremaining: 3.96s 111:learn: 0.8466948test: 0.8146067best: 0.8370787 (52)total: 2.35sremaining: 3.94s 112:learn: 0.8466948test: 0.8146067best: 0.8370787 (52)total: 2.37sremaining: 3.92s 113:learn: 0.8466948test: 0.8146067best: 0.8370787 (52)total: 2.39sremaining: 3.9s 114:learn: 0.8466948test: 0.8146067best: 0.8370787 (52)total: 2.41sremaining: 3.88s 115:learn: 0.8466948test: 0.8146067best: 0.8370787 (52)total: 2.43sremaining: 3.86s 116:learn: 0.8466948test: 0.8146067best: 0.8370787 (52)total: 2.45sremaining: 3.84s 117:learn: 0.8452883test: 0.8202247best: 0.8370787 (52)total: 2.48sremaining: 3.82s 118:learn: 0.8452883test: 0.8146067best: 0.8370787 (52)total: 2.5sremaining: 3.8s 119:learn: 0.8452883test: 0.8146067best: 0.8370787 (52)total: 2.52sremaining: 3.78s 120:learn: 0.8452883test: 0.8146067best: 0.8370787 (52)total: 2.54sremaining: 3.76s 121:learn: 0.8452883test: 0.8146067best: 0.8370787 (52)total: 2.56sremaining: 3.74s 122:learn: 0.8452883test: 0.8146067best: 0.8370787 (52)total: 2.59sremaining: 3.72s 123:learn: 0.8452883test: 0.8146067best: 0.8370787 (52)total: 2.61sremaining: 3.71s 124:learn: 0.8452883test: 0.8146067best: 0.8370787 (52)total: 2.63sremaining: 3.69s 125:learn: 0.8452883test: 0.8146067best: 0.8370787 (52)total: 2.65sremaining: 3.67s 126:learn: 0.8452883test: 0.8146067best: 0.8370787 (52)total: 2.68sremaining: 3.65s 127:learn: 0.8466948test: 0.8146067best: 0.8370787 (52)total: 2.7sremaining: 3.63s 128:learn: 0.8466948test: 0.8146067best: 0.8370787 (52)total: 2.72sremaining: 3.61s 129:learn: 0.8466948test: 0.8146067best: 0.8370787 (52)total: 2.73sremaining: 3.57s 130:learn: 0.8466948test: 0.8146067best: 0.8370787 (52)total: 2.75sremaining: 3.55s 131:learn: 0.8466948test: 0.8146067best: 0.8370787 (52)total: 2.77sremaining: 3.53s 132:learn: 0.8466948test: 0.8146067best: 0.8370787 (52)total: 2.79sremaining: 3.51s 133:learn: 0.8466948test: 0.8146067best: 0.8370787 (52)total: 2.8sremaining: 3.47s 134:learn: 0.8466948test: 0.8146067best: 0.8370787 (52)total: 2.83sremaining: 3.46s 135:learn: 0.8466948test: 0.8146067best: 0.8370787 (52)total: 2.85sremaining: 3.43s 136:learn: 0.8466948test: 0.8146067best: 0.8370787 (52)total: 2.87sremaining: 3.42s 137:learn: 0.8466948test: 0.8146067best: 0.8370787 (52)total: 2.89sremaining: 3.4s 138:learn: 0.8481013test: 0.8146067best: 0.8370787 (52)total: 2.91sremaining: 3.37s 139:learn: 0.8481013test: 0.8146067best: 0.8370787 (52)total: 2.94sremaining: 3.35s 140:learn: 0.8481013test: 0.8146067best: 0.8370787 (52)total: 2.96sremaining: 3.33s 141:learn: 0.8481013test: 0.8146067best: 0.8370787 (52)total: 2.98sremaining: 3.31s 142:learn: 0.8481013test: 0.8146067best: 0.8370787 (52)total: 3sremaining: 3.29s 143:learn: 0.8495077test: 0.8146067best: 0.8370787 (52)total: 3.02sremaining: 3.27s 144:learn: 0.8495077test: 0.8146067best: 0.8370787 (52)total: 3.04sremaining: 3.25s 145:learn: 0.8495077test: 0.8146067best: 0.8370787 (52)total: 3.06sremaining: 3.23s 146:learn: 0.8509142test: 0.8146067best: 0.8370787 (52)total: 3.08sremaining: 3.21s 147:learn: 0.8509142test: 0.8146067best: 0.8370787 (52)total: 3.1sremaining: 3.19s 148:learn: 0.8523207test: 0.8146067best: 0.8370787 (52)total: 3.12sremaining: 3.16s 149:learn: 0.8523207test: 0.8146067best: 0.8370787 (52)total: 3.14sremaining: 3.14s 150:learn: 0.8523207test: 0.8146067best: 0.8370787 (52)total: 3.16sremaining: 3.12s 151:learn: 0.8523207test: 0.8146067best: 0.8370787 (52)total: 3.18sremaining: 3.1s 152:learn: 0.8523207test: 0.8146067best: 0.8370787 (52)total: 3.2sremaining: 3.08s Stopped by overfitting detector  (100 iterations wait)  bestTest = 0.8370786517 bestIteration = 52  Shrink model to first 53 iterations. <\/code><\/pre>\n<pre><code>RandomizedSearchCV(cv=10,                    estimator=&lt;catboost.core.CatBoostClassifier object at 0x000002E16600D400&gt;,                    n_iter=45, n_jobs=-1,                    param_distributions={'border_count': [32, 64, 128],                                         'depth': [4, 6, 8, 10],                                         'iterations': [300, 500, 1000],                                         'l2_leaf_reg': [1, 3, 5, 7, 9],                                         'learning_rate': [0.01, 0.05, 0.1]},                    scoring='accuracy', verbose=2)<\/code><\/pre>\n<p><strong>In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook. On GitHub, the HTML representation is unable to render, please try loading this page with <\/strong><a href=\"http:\/\/nbviewer.org\" rel=\"noopener noreferrer nofollow\"><strong>nbviewer.org<\/strong><\/a><strong>.<\/strong><\/p>\n<p>RandomizedSearchCV<\/p>\n<p><a href=\"https:\/\/scikit-learn.org\/1.7\/modules\/generated\/sklearn.model_selection.RandomizedSearchCV.html\" rel=\"noopener noreferrer nofollow\">?Documentation for RandomizedSearchCV<\/a>iFitted<\/p>\n<details class=\"spoiler\">\n<summary>Parameters<\/summary>\n<div class=\"spoiler__content\">\n<pre><code>    &lt;tr class=\"user-set\"&gt;         &lt;td&gt;&lt;i class=\"copy-paste-icon\"&gt;&lt;\/i&gt;&lt;\/td&gt;         &lt;td class=\"param\"&gt;estimator&amp;nbsp;&lt;\/td&gt;         &lt;td class=\"value\"&gt;&amp;lt;catboost.cor...002E16600D400&amp;gt;&lt;\/td&gt;     &lt;\/tr&gt;       &lt;tr class=\"user-set\"&gt;         &lt;td&gt;&lt;i class=\"copy-paste-icon\"&gt;&lt;\/i&gt;&lt;\/td&gt;         &lt;td class=\"param\"&gt;param_distributions&amp;nbsp;&lt;\/td&gt;         &lt;td class=\"value\"&gt;{'border_count': [32, 64, ...], 'depth': [4, 6, ...], 'iterations': [300, 500, ...], 'l2_leaf_reg': [1, 3, ...], ...}&lt;\/td&gt;     &lt;\/tr&gt;       &lt;tr class=\"user-set\"&gt;         &lt;td&gt;&lt;i class=\"copy-paste-icon\"&gt;&lt;\/i&gt;&lt;\/td&gt;         &lt;td class=\"param\"&gt;n_iter&amp;nbsp;&lt;\/td&gt;         &lt;td class=\"value\"&gt;45&lt;\/td&gt;     &lt;\/tr&gt;       &lt;tr class=\"user-set\"&gt;         &lt;td&gt;&lt;i class=\"copy-paste-icon\"&gt;&lt;\/i&gt;&lt;\/td&gt;         &lt;td class=\"param\"&gt;scoring&amp;nbsp;&lt;\/td&gt;         &lt;td class=\"value\"&gt;'accuracy'&lt;\/td&gt;     &lt;\/tr&gt;       &lt;tr class=\"user-set\"&gt;         &lt;td&gt;&lt;i class=\"copy-paste-icon\"&gt;&lt;\/i&gt;&lt;\/td&gt;         &lt;td class=\"param\"&gt;n_jobs&amp;nbsp;&lt;\/td&gt;         &lt;td class=\"value\"&gt;-1&lt;\/td&gt;     &lt;\/tr&gt;       &lt;tr class=\"default\"&gt;         &lt;td&gt;&lt;i class=\"copy-paste-icon\"&gt;&lt;\/i&gt;&lt;\/td&gt;         &lt;td class=\"param\"&gt;refit&amp;nbsp;&lt;\/td&gt;         &lt;td class=\"value\"&gt;True&lt;\/td&gt;     &lt;\/tr&gt;       &lt;tr class=\"user-set\"&gt;         &lt;td&gt;&lt;i class=\"copy-paste-icon\"&gt;&lt;\/i&gt;&lt;\/td&gt;         &lt;td class=\"param\"&gt;cv&amp;nbsp;&lt;\/td&gt;         &lt;td class=\"value\"&gt;10&lt;\/td&gt;     &lt;\/tr&gt;       &lt;tr class=\"user-set\"&gt;         &lt;td&gt;&lt;i class=\"copy-paste-icon\"&gt;&lt;\/i&gt;&lt;\/td&gt;         &lt;td class=\"param\"&gt;verbose&amp;nbsp;&lt;\/td&gt;         &lt;td class=\"value\"&gt;2&lt;\/td&gt;     &lt;\/tr&gt;       &lt;tr class=\"default\"&gt;         &lt;td&gt;&lt;i class=\"copy-paste-icon\"&gt;&lt;\/i&gt;&lt;\/td&gt;         &lt;td class=\"param\"&gt;pre_dispatch&amp;nbsp;&lt;\/td&gt;         &lt;td class=\"value\"&gt;'2*n_jobs'&lt;\/td&gt;     &lt;\/tr&gt;       &lt;tr class=\"default\"&gt;         &lt;td&gt;&lt;i class=\"copy-paste-icon\"&gt;&lt;\/i&gt;&lt;\/td&gt;         &lt;td class=\"param\"&gt;random_state&amp;nbsp;&lt;\/td&gt;         &lt;td class=\"value\"&gt;None&lt;\/td&gt;     &lt;\/tr&gt;       &lt;tr class=\"default\"&gt;         &lt;td&gt;&lt;i class=\"copy-paste-icon\"&gt;&lt;\/i&gt;&lt;\/td&gt;         &lt;td class=\"param\"&gt;error_score&amp;nbsp;&lt;\/td&gt;         &lt;td class=\"value\"&gt;nan&lt;\/td&gt;     &lt;\/tr&gt;       &lt;tr class=\"default\"&gt;         &lt;td&gt;&lt;i class=\"copy-paste-icon\"&gt;&lt;\/i&gt;&lt;\/td&gt;         &lt;td class=\"param\"&gt;return_train_score&amp;nbsp;&lt;\/td&gt;         &lt;td class=\"value\"&gt;False&lt;\/td&gt;     &lt;\/tr&gt;                &lt;\/tbody&gt;             &lt;\/table&gt;         &lt;\/details&gt;     &lt;\/div&gt; &lt;\/div&gt;&lt;\/div&gt;&lt;\/div&gt;&lt;div class=\"sk-parallel\"&gt;&lt;div class=\"sk-parallel-item\"&gt;&lt;div class=\"sk-item\"&gt;&lt;div class=\"sk-label-container\"&gt;&lt;div class=\"sk-label fitted sk-toggleable\"&gt;&lt;input type=\"checkbox\" id=\"sk-estimator-id-2\" class=\"sk-toggleable__control sk-hidden--visually\"&gt;&lt;label class=\"sk-toggleable__label fitted sk-toggleable__label-arrow\" for=\"sk-estimator-id-2\"&gt;&lt;div&gt;&lt;div&gt;best_estimator_: CatBoostClassifier&lt;\/div&gt;&lt;\/div&gt;&lt;\/label&gt;&lt;div data-param-prefix=\"best_estimator___\" class=\"sk-toggleable__content fitted\"&gt;&lt;pre&gt;&amp;lt;catboost.core.CatBoostClassifier object at 0x000002E169667020&amp;gt;&lt;\/pre&gt;&lt;\/div&gt;&lt;\/div&gt;&lt;\/div&gt;&lt;div class=\"sk-serial\"&gt;&lt;div class=\"sk-item\"&gt;&lt;div class=\"sk-estimator fitted sk-toggleable\"&gt;&lt;input type=\"checkbox\" id=\"sk-estimator-id-3\" class=\"sk-toggleable__control sk-hidden--visually\"&gt;&lt;label class=\"sk-toggleable__label fitted sk-toggleable__label-arrow\" for=\"sk-estimator-id-3\"&gt;&lt;div&gt;&lt;div&gt;CatBoostClassifier&lt;\/div&gt;&lt;\/div&gt;&lt;\/label&gt;&lt;div data-param-prefix=\"best_estimator___\" class=\"sk-toggleable__content fitted\"&gt;&lt;pre&gt;&amp;lt;catboost.core.CatBoostClassifier object at 0x000002E169667020&amp;gt;&lt;\/pre&gt;&lt;\/div&gt;&lt;\/div&gt;&lt;\/div&gt;&lt;\/div&gt;&lt;\/div&gt;&lt;\/div&gt;&lt;\/div&gt;&lt;\/div&gt;&lt;\/div&gt;&lt;\/div&gt; <\/code><\/pre>\n<pre><code class=\"python\"># \u0412\u044b\u0432\u0435\u0434\u0435\u043c \u043b\u0443\u0447\u0448\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b  random_search.best_params_  <\/code><\/pre>\n<pre><code>{'learning_rate': 0.05,  'l2_leaf_reg': 3,  'iterations': 300,  'depth': 4,  'border_count': 32} <\/code><\/pre>\n<pre><code class=\"python\"># \u0412\u044b\u0432\u0435\u0434\u0435\u043c \u043b\u0443\u0447\u0448\u0438\u0439 \u0441\u043a\u043e\u0440  random_search.best_score_  <\/code><\/pre>\n<pre><code>np.float64(0.82981220657277) <\/code><\/pre>\n<pre><code class=\"python\">#\u0421\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c best_params \u0432 .txt \u0444\u0430\u0439\u043b, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u043f\u043e\u0442\u0435\u0440\u044f\u0442\u044c  with open(\"best_params.txt\", \"a\") as f:     json.dump(random_search.best_params_, f,              indent=4)      <\/code><\/pre>\n<h3>\u041e\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0435<\/h3>\n<h4>\u0414\u0432\u0430\u0436\u0434\u044b \u043f\u0440\u0438 \u043c\u0430\u043b\u043e\u043c early_stopping_rounds, \u0440\u0430\u0432\u043d\u043e\u043c 30, \u043f\u0440\u0438 n_iter, \u0440\u0430\u0432\u043d\u043e\u043c 15 \u0438 cs, \u0440\u0430\u0432\u043d\u043e\u043c 3<\/h4>\n<h4>\u041c\u043e\u0434\u0435\u043b\u044c \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u043b\u0430 \u043b\u0443\u0447\u0448\u0438\u0439 accuracy, \u043d\u043e \u043f\u0440\u0438 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438 \u043d\u0430 Kaggle, \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u043b\u0430 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0445\u0443\u0436\u0435<\/h4>\n<h4>\u0414\u043e\u0431\u0430\u0432\u0438\u043b early_stopping_rounds, n_iter \u0438 cs \u0438 \u0442\u043e\u0433\u0434\u0430<\/h4>\n<h4>\u041f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u0443\u043b\u0443\u0447\u0448\u0438\u0442\u044c \u0438\u0442\u043e\u0433\u043e\u0432\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442<\/h4>\n<pre><code class=\"python\"># \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043b\u0443\u0447\u0448\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c  best_model = random_search.best_estimator_  <\/code><\/pre>\n<pre><code class=\"python\"># \u041e\u0431\u0443\u0447\u0430\u0435\u043c \u043c\u043e\u0434\u0435\u043b\u044c \u0441 \u043b\u0443\u0447\u0448\u0438\u043c\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438  best_model.fit(X_train_split, y_train_split, **fit_params)  <\/code><\/pre>\n<pre><code>0:learn: 0.7988748test: 0.7752809best: 0.7752809 (0)total: 21.9msremaining: 6.54s 1:learn: 0.8016878test: 0.7808989best: 0.7808989 (1)total: 48.9msremaining: 7.29s 2:learn: 0.8101266test: 0.7921348best: 0.7921348 (2)total: 74.5msremaining: 7.37s 3:learn: 0.8045007test: 0.7865169best: 0.7921348 (2)total: 105msremaining: 7.76s 4:learn: 0.8030942test: 0.7865169best: 0.7921348 (2)total: 133msremaining: 7.85s 5:learn: 0.8087201test: 0.7977528best: 0.7977528 (5)total: 159msremaining: 7.77s 6:learn: 0.8087201test: 0.7977528best: 0.7977528 (5)total: 184msremaining: 7.7s 7:learn: 0.8101266test: 0.8033708best: 0.8033708 (7)total: 209msremaining: 7.63s 8:learn: 0.8101266test: 0.7977528best: 0.8033708 (7)total: 234msremaining: 7.57s 9:learn: 0.8101266test: 0.7977528best: 0.8033708 (7)total: 258msremaining: 7.49s 10:learn: 0.8101266test: 0.7977528best: 0.8033708 (7)total: 286msremaining: 7.52s 11:learn: 0.8115331test: 0.7977528best: 0.8033708 (7)total: 314msremaining: 7.54s 12:learn: 0.8171589test: 0.7977528best: 0.8033708 (7)total: 341msremaining: 7.54s 13:learn: 0.8185654test: 0.7977528best: 0.8033708 (7)total: 369msremaining: 7.53s 14:learn: 0.8185654test: 0.8033708best: 0.8033708 (7)total: 392msremaining: 7.45s 15:learn: 0.8185654test: 0.8033708best: 0.8033708 (7)total: 416msremaining: 7.38s 16:learn: 0.8185654test: 0.8033708best: 0.8033708 (7)total: 438msremaining: 7.29s 17:learn: 0.8185654test: 0.8033708best: 0.8033708 (7)total: 456msremaining: 7.14s 18:learn: 0.8199719test: 0.8033708best: 0.8033708 (7)total: 479msremaining: 7.08s 19:learn: 0.8227848test: 0.8033708best: 0.8033708 (7)total: 501msremaining: 7.02s 20:learn: 0.8227848test: 0.8033708best: 0.8033708 (7)total: 524msremaining: 6.96s 21:learn: 0.8227848test: 0.8033708best: 0.8033708 (7)total: 546msremaining: 6.9s 22:learn: 0.8255977test: 0.8033708best: 0.8033708 (7)total: 576msremaining: 6.93s 23:learn: 0.8270042test: 0.8033708best: 0.8033708 (7)total: 584msremaining: 6.72s 24:learn: 0.8270042test: 0.8033708best: 0.8033708 (7)total: 607msremaining: 6.68s 25:learn: 0.8255977test: 0.8033708best: 0.8033708 (7)total: 624msremaining: 6.57s 26:learn: 0.8255977test: 0.8033708best: 0.8033708 (7)total: 646msremaining: 6.53s 27:learn: 0.8241913test: 0.7977528best: 0.8033708 (7)total: 670msremaining: 6.51s 28:learn: 0.8255977test: 0.7977528best: 0.8033708 (7)total: 692msremaining: 6.47s 29:learn: 0.8255977test: 0.8033708best: 0.8033708 (7)total: 716msremaining: 6.44s 30:learn: 0.8255977test: 0.8033708best: 0.8033708 (7)total: 739msremaining: 6.41s 31:learn: 0.8255977test: 0.8089888best: 0.8089888 (31)total: 760msremaining: 6.37s 32:learn: 0.8284107test: 0.8089888best: 0.8089888 (31)total: 784msremaining: 6.34s 33:learn: 0.8298172test: 0.8146067best: 0.8146067 (33)total: 807msremaining: 6.31s 34:learn: 0.8340366test: 0.8146067best: 0.8146067 (33)total: 820msremaining: 6.21s 35:learn: 0.8354430test: 0.8146067best: 0.8146067 (33)total: 845msremaining: 6.2s 36:learn: 0.8354430test: 0.8146067best: 0.8146067 (33)total: 868msremaining: 6.17s 37:learn: 0.8368495test: 0.8089888best: 0.8146067 (33)total: 886msremaining: 6.11s 38:learn: 0.8382560test: 0.8089888best: 0.8146067 (33)total: 908msremaining: 6.08s 39:learn: 0.8368495test: 0.8089888best: 0.8146067 (33)total: 936msremaining: 6.08s 40:learn: 0.8368495test: 0.8089888best: 0.8146067 (33)total: 959msremaining: 6.05s 41:learn: 0.8382560test: 0.8089888best: 0.8146067 (33)total: 979msremaining: 6.01s 42:learn: 0.8382560test: 0.8202247best: 0.8202247 (42)total: 1sremaining: 5.98s 43:learn: 0.8410689test: 0.8146067best: 0.8202247 (42)total: 1.02sremaining: 5.94s 44:learn: 0.8396624test: 0.8146067best: 0.8202247 (42)total: 1.04sremaining: 5.92s 45:learn: 0.8438819test: 0.8258427best: 0.8258427 (45)total: 1.07sremaining: 5.89s 46:learn: 0.8466948test: 0.8258427best: 0.8258427 (45)total: 1.09sremaining: 5.85s 47:learn: 0.8466948test: 0.8258427best: 0.8258427 (45)total: 1.11sremaining: 5.82s 48:learn: 0.8481013test: 0.8258427best: 0.8258427 (45)total: 1.13sremaining: 5.78s 49:learn: 0.8452883test: 0.8314607best: 0.8314607 (49)total: 1.15sremaining: 5.75s 50:learn: 0.8438819test: 0.8314607best: 0.8314607 (49)total: 1.17sremaining: 5.71s 51:learn: 0.8438819test: 0.8314607best: 0.8314607 (49)total: 1.19sremaining: 5.67s 52:learn: 0.8452883test: 0.8370787best: 0.8370787 (52)total: 1.21sremaining: 5.63s 53:learn: 0.8424754test: 0.8370787best: 0.8370787 (52)total: 1.23sremaining: 5.59s 54:learn: 0.8396624test: 0.8370787best: 0.8370787 (52)total: 1.25sremaining: 5.56s 55:learn: 0.8396624test: 0.8314607best: 0.8370787 (52)total: 1.27sremaining: 5.53s 56:learn: 0.8396624test: 0.8314607best: 0.8370787 (52)total: 1.29sremaining: 5.5s 57:learn: 0.8382560test: 0.8314607best: 0.8370787 (52)total: 1.31sremaining: 5.46s 58:learn: 0.8382560test: 0.8314607best: 0.8370787 (52)total: 1.32sremaining: 5.41s 59:learn: 0.8396624test: 0.8314607best: 0.8370787 (52)total: 1.34sremaining: 5.38s 60:learn: 0.8396624test: 0.8314607best: 0.8370787 (52)total: 1.36sremaining: 5.35s 61:learn: 0.8396624test: 0.8314607best: 0.8370787 (52)total: 1.38sremaining: 5.31s 62:learn: 0.8396624test: 0.8314607best: 0.8370787 (52)total: 1.4sremaining: 5.27s 63:learn: 0.8396624test: 0.8314607best: 0.8370787 (52)total: 1.42sremaining: 5.24s 64:learn: 0.8396624test: 0.8314607best: 0.8370787 (52)total: 1.44sremaining: 5.21s 65:learn: 0.8396624test: 0.8314607best: 0.8370787 (52)total: 1.46sremaining: 5.18s 66:learn: 0.8410689test: 0.8314607best: 0.8370787 (52)total: 1.48sremaining: 5.15s 67:learn: 0.8410689test: 0.8314607best: 0.8370787 (52)total: 1.5sremaining: 5.13s 68:learn: 0.8410689test: 0.8314607best: 0.8370787 (52)total: 1.51sremaining: 5.07s 69:learn: 0.8424754test: 0.8314607best: 0.8370787 (52)total: 1.53sremaining: 5.05s 70:learn: 0.8424754test: 0.8314607best: 0.8370787 (52)total: 1.56sremaining: 5.03s 71:learn: 0.8424754test: 0.8314607best: 0.8370787 (52)total: 1.58sremaining: 5s 72:learn: 0.8438819test: 0.8314607best: 0.8370787 (52)total: 1.6sremaining: 4.98s 73:learn: 0.8396624test: 0.8314607best: 0.8370787 (52)total: 1.61sremaining: 4.93s 74:learn: 0.8382560test: 0.8258427best: 0.8370787 (52)total: 1.64sremaining: 4.91s 75:learn: 0.8410689test: 0.8258427best: 0.8370787 (52)total: 1.66sremaining: 4.88s 76:learn: 0.8424754test: 0.8202247best: 0.8370787 (52)total: 1.68sremaining: 4.86s 77:learn: 0.8424754test: 0.8202247best: 0.8370787 (52)total: 1.7sremaining: 4.83s 78:learn: 0.8438819test: 0.8202247best: 0.8370787 (52)total: 1.72sremaining: 4.81s 79:learn: 0.8452883test: 0.8202247best: 0.8370787 (52)total: 1.74sremaining: 4.78s 80:learn: 0.8452883test: 0.8202247best: 0.8370787 (52)total: 1.76sremaining: 4.76s 81:learn: 0.8452883test: 0.8202247best: 0.8370787 (52)total: 1.78sremaining: 4.73s 82:learn: 0.8452883test: 0.8202247best: 0.8370787 (52)total: 1.8sremaining: 4.71s 83:learn: 0.8452883test: 0.8202247best: 0.8370787 (52)total: 1.82sremaining: 4.68s 84:learn: 0.8438819test: 0.8202247best: 0.8370787 (52)total: 1.84sremaining: 4.67s 85:learn: 0.8452883test: 0.8202247best: 0.8370787 (52)total: 1.87sremaining: 4.65s 86:learn: 0.8452883test: 0.8202247best: 0.8370787 (52)total: 1.89sremaining: 4.64s 87:learn: 0.8438819test: 0.8202247best: 0.8370787 (52)total: 1.92sremaining: 4.62s 88:learn: 0.8452883test: 0.8146067best: 0.8370787 (52)total: 1.94sremaining: 4.59s 89:learn: 0.8438819test: 0.8146067best: 0.8370787 (52)total: 1.96sremaining: 4.58s 90:learn: 0.8438819test: 0.8146067best: 0.8370787 (52)total: 1.98sremaining: 4.55s 91:learn: 0.8438819test: 0.8146067best: 0.8370787 (52)total: 2sremaining: 4.53s 92:learn: 0.8438819test: 0.8146067best: 0.8370787 (52)total: 2.02sremaining: 4.51s 93:learn: 0.8438819test: 0.8258427best: 0.8370787 (52)total: 2.05sremaining: 4.49s 94:learn: 0.8438819test: 0.8258427best: 0.8370787 (52)total: 2.05sremaining: 4.43s 95:learn: 0.8438819test: 0.8258427best: 0.8370787 (52)total: 2.08sremaining: 4.41s 96:learn: 0.8438819test: 0.8202247best: 0.8370787 (52)total: 2.1sremaining: 4.39s 97:learn: 0.8438819test: 0.8258427best: 0.8370787 (52)total: 2.12sremaining: 4.36s 98:learn: 0.8438819test: 0.8258427best: 0.8370787 (52)total: 2.14sremaining: 4.34s 99:learn: 0.8438819test: 0.8258427best: 0.8370787 (52)total: 2.16sremaining: 4.32s 100:learn: 0.8438819test: 0.8258427best: 0.8370787 (52)total: 2.19sremaining: 4.31s 101:learn: 0.8438819test: 0.8258427best: 0.8370787 (52)total: 2.21sremaining: 4.29s 102:learn: 0.8438819test: 0.8258427best: 0.8370787 (52)total: 2.23sremaining: 4.27s 103:learn: 0.8438819test: 0.8258427best: 0.8370787 (52)total: 2.25sremaining: 4.25s 104:learn: 0.8438819test: 0.8258427best: 0.8370787 (52)total: 2.28sremaining: 4.23s 105:learn: 0.8452883test: 0.8202247best: 0.8370787 (52)total: 2.3sremaining: 4.21s 106:learn: 0.8452883test: 0.8202247best: 0.8370787 (52)total: 2.32sremaining: 4.19s 107:learn: 0.8452883test: 0.8202247best: 0.8370787 (52)total: 2.35sremaining: 4.17s 108:learn: 0.8452883test: 0.8146067best: 0.8370787 (52)total: 2.37sremaining: 4.15s 109:learn: 0.8466948test: 0.8146067best: 0.8370787 (52)total: 2.39sremaining: 4.13s 110:learn: 0.8466948test: 0.8146067best: 0.8370787 (52)total: 2.41sremaining: 4.11s 111:learn: 0.8466948test: 0.8146067best: 0.8370787 (52)total: 2.44sremaining: 4.09s 112:learn: 0.8466948test: 0.8146067best: 0.8370787 (52)total: 2.46sremaining: 4.07s 113:learn: 0.8466948test: 0.8146067best: 0.8370787 (52)total: 2.48sremaining: 4.05s 114:learn: 0.8466948test: 0.8146067best: 0.8370787 (52)total: 2.5sremaining: 4.02s 115:learn: 0.8466948test: 0.8146067best: 0.8370787 (52)total: 2.52sremaining: 4s 116:learn: 0.8466948test: 0.8146067best: 0.8370787 (52)total: 2.54sremaining: 3.97s 117:learn: 0.8452883test: 0.8202247best: 0.8370787 (52)total: 2.56sremaining: 3.95s 118:learn: 0.8452883test: 0.8146067best: 0.8370787 (52)total: 2.58sremaining: 3.92s 119:learn: 0.8452883test: 0.8146067best: 0.8370787 (52)total: 2.6sremaining: 3.9s 120:learn: 0.8452883test: 0.8146067best: 0.8370787 (52)total: 2.62sremaining: 3.87s 121:learn: 0.8452883test: 0.8146067best: 0.8370787 (52)total: 2.64sremaining: 3.85s 122:learn: 0.8452883test: 0.8146067best: 0.8370787 (52)total: 2.66sremaining: 3.83s 123:learn: 0.8452883test: 0.8146067best: 0.8370787 (52)total: 2.68sremaining: 3.8s 124:learn: 0.8452883test: 0.8146067best: 0.8370787 (52)total: 2.7sremaining: 3.78s 125:learn: 0.8452883test: 0.8146067best: 0.8370787 (52)total: 2.72sremaining: 3.75s 126:learn: 0.8452883test: 0.8146067best: 0.8370787 (52)total: 2.74sremaining: 3.73s 127:learn: 0.8466948test: 0.8146067best: 0.8370787 (52)total: 2.76sremaining: 3.71s 128:learn: 0.8466948test: 0.8146067best: 0.8370787 (52)total: 2.78sremaining: 3.68s 129:learn: 0.8466948test: 0.8146067best: 0.8370787 (52)total: 2.79sremaining: 3.65s 130:learn: 0.8466948test: 0.8146067best: 0.8370787 (52)total: 2.81sremaining: 3.62s 131:learn: 0.8466948test: 0.8146067best: 0.8370787 (52)total: 2.82sremaining: 3.59s 132:learn: 0.8466948test: 0.8146067best: 0.8370787 (52)total: 2.84sremaining: 3.57s 133:learn: 0.8466948test: 0.8146067best: 0.8370787 (52)total: 2.85sremaining: 3.53s 134:learn: 0.8466948test: 0.8146067best: 0.8370787 (52)total: 2.87sremaining: 3.51s 135:learn: 0.8466948test: 0.8146067best: 0.8370787 (52)total: 2.89sremaining: 3.49s 136:learn: 0.8466948test: 0.8146067best: 0.8370787 (52)total: 2.91sremaining: 3.47s 137:learn: 0.8466948test: 0.8146067best: 0.8370787 (52)total: 2.94sremaining: 3.44s 138:learn: 0.8481013test: 0.8146067best: 0.8370787 (52)total: 2.96sremaining: 3.42s 139:learn: 0.8481013test: 0.8146067best: 0.8370787 (52)total: 2.97sremaining: 3.4s 140:learn: 0.8481013test: 0.8146067best: 0.8370787 (52)total: 3sremaining: 3.38s 141:learn: 0.8481013test: 0.8146067best: 0.8370787 (52)total: 3.02sremaining: 3.35s 142:learn: 0.8481013test: 0.8146067best: 0.8370787 (52)total: 3.03sremaining: 3.33s 143:learn: 0.8495077test: 0.8146067best: 0.8370787 (52)total: 3.05sremaining: 3.31s 144:learn: 0.8495077test: 0.8146067best: 0.8370787 (52)total: 3.07sremaining: 3.29s 145:learn: 0.8495077test: 0.8146067best: 0.8370787 (52)total: 3.1sremaining: 3.27s 146:learn: 0.8509142test: 0.8146067best: 0.8370787 (52)total: 3.12sremaining: 3.24s 147:learn: 0.8509142test: 0.8146067best: 0.8370787 (52)total: 3.14sremaining: 3.22s 148:learn: 0.8523207test: 0.8146067best: 0.8370787 (52)total: 3.16sremaining: 3.2s 149:learn: 0.8523207test: 0.8146067best: 0.8370787 (52)total: 3.18sremaining: 3.18s 150:learn: 0.8523207test: 0.8146067best: 0.8370787 (52)total: 3.2sremaining: 3.15s 151:learn: 0.8523207test: 0.8146067best: 0.8370787 (52)total: 3.22sremaining: 3.13s 152:learn: 0.8523207test: 0.8146067best: 0.8370787 (52)total: 3.24sremaining: 3.11s Stopped by overfitting detector  (100 iterations wait)  bestTest = 0.8370786517 bestIteration = 52  Shrink model to first 53 iterations. <\/code><\/pre>\n<pre><code class=\"python\">#\u041e\u0446\u0435\u043d\u0438\u043c \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e  acc = accuracy_score(y_valid, y_pred) print(f\"Validation Accuracy: {acc:.4f}\")  <\/code><\/pre>\n<pre><code>Validation Accuracy: 0.8315 <\/code><\/pre>\n<pre><code class=\"python\">#\u041f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u0438\u0435 \u043d\u0430 \u0442\u0435\u0441\u0442\u0435  best_test_preds = best_model.predict(X_test)  <\/code><\/pre>\n<pre><code class=\"python\"># \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 submission_V2.csv  submission_V2 = pd.DataFrame({     'PassengerId': passenger_ids,     'Survived': best_test_preds.astype(int) })  submission_V2.to_csv('submission_V2.csv', index=False) print(\"\u2705 Submission \u0444\u0430\u0439\u043b \u0441\u043e\u0445\u0440\u0430\u043d\u0451\u043d \u043a\u0430\u043a submission_V2.csv\")  <\/code><\/pre>\n<pre><code>\u2705 Submission \u0444\u0430\u0439\u043b \u0441\u043e\u0445\u0440\u0430\u043d\u0451\u043d \u043a\u0430\u043a submission_V2.csv <\/code><\/pre>\n<pre><code class=\"python\"># \u0421\u043c\u043e\u0442\u0440\u0438\u043c \u043e\u0446\u0435\u043d\u043a\u0443 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430  accuracy_score(y_valid, best_model.predict(X_valid))  <\/code><\/pre>\n<pre><code>0.8370786516853933 <\/code><\/pre>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/2c5\/01e\/fca\/2c501efca2a7aaea137f53890fbc46fb.png\" alt=\"image.png\" width=\"1069\" height=\"82\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/2c5\/01e\/fca\/2c501efca2a7aaea137f53890fbc46fb.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/2c5\/01e\/fca\/2c501efca2a7aaea137f53890fbc46fb.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>image.png<\/figcaption><\/div>\n<\/figure>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/f64\/3a6\/4ad\/f643a64adfbf240d73cefd1881383426.png\" alt=\"image.png\" width=\"968\" height=\"83\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/f64\/3a6\/4ad\/f643a64adfbf240d73cefd1881383426.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/f64\/3a6\/4ad\/f643a64adfbf240d73cefd1881383426.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>image.png<\/figcaption><\/div>\n<\/figure>\n<h3>\u0421\u043c\u043e\u0433\u043b\u0438 \u0443\u043b\u0443\u0447\u0448\u0438\u0442\u044c \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e \u043c\u043e\u0434\u0435\u043b\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u043e\u0434\u0431\u043e\u0440\u0430 \u0433\u0438\u043f\u0435\u0440\u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0438 \u043e\u0442\u0432\u043e\u0435\u0432\u0430\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 500 \u043c\u0435\u0441\u0442 \u0432 \u0438\u0442\u043e\u0433\u043e\u0432\u043e\u043c \u0440\u0435\u0439\u0442\u0438\u043d\u0433\u0435<\/h3>\n<div><\/div>\n<pre><code><\/code><\/pre>\n<\/div>\n<\/details>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/935540\/\"> https:\/\/habr.com\/ru\/articles\/935540\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<pre><code class=\"python\">#\u0418\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u0432\u0441\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438  import pandas as pd from catboost import CatBoostClassifier from sklearn.model_selection import train_test_split from sklearn.metrics import accuracy_score import numpy as np import matplotlib.pyplot as plt import seaborn as sns import json <\/code><\/pre>\n<pre><code class=\"python\"># \ud83d\udd15 \u041e\u0442\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0437\u0430\u0433\u0440\u043e\u043c\u043e\u0436\u0434\u0430\u043b\u0438 \u0432\u044b\u0432\u043e\u0434   import warnings warnings.filterwarnings('ignore')  <\/code><\/pre>\n<pre><code class=\"python\">### \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c \u043a\u0440\u0430\u0441\u0438\u0432\u044b\u0435 \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u044b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 ### \u041c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043b\u0435\u043d\u044c \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c ### \u0423 \u0433\u0440\u0430\u0444\u0438\u043a\u043e\u0432 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0446\u0432\u0435\u0442\u0430, \u0440\u0430\u0437\u043c\u0435\u0440\u0430, \u0448\u0440\u0438\u0444\u0442\u0430 ### \u041c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c \u0438\u0445 \u0432 \u0441\u043b\u043e\u0432\u0430\u0440\u044c \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u044b\u0445 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a  import matplotlib as mlp  # \u0421\u0435\u0442\u043a\u0430 (grid) mlp.rcParams['axes.grid'] = True mlp.rcParams['grid.color'] = '#D3D3D3' mlp.rcParams['grid.linestyle'] = '--' mlp.rcParams['grid.linewidth'] = 1  # \u0426\u0432\u0435\u0442 \u0444\u043e\u043d\u0430 mlp.rcParams['axes.facecolor'] = '#F9F9F9'   # \u0441\u0432\u0435\u0442\u043b\u043e-\u0441\u0435\u0440\u044b\u0439 \u0444\u043e\u043d \u0432\u043d\u0443\u0442\u0440\u0438 \u0433\u0440\u0430\u0444\u0438\u043a\u0430 mlp.rcParams['figure.facecolor'] = '#FFFFFF'  # \u0444\u043e\u043d \u0432\u0441\u0435\u0433\u043e \u0445\u043e\u043b\u0441\u0442\u0430  # \u041b\u0435\u0433\u0435\u043d\u0434\u0430 mlp.rcParams['legend.fontsize'] = 14 mlp.rcParams['legend.frameon'] = True mlp.rcParams['legend.framealpha'] = 0.9 mlp.rcParams['legend.edgecolor'] = '#333333'  # \u0420\u0430\u0437\u043c\u0435\u0440 \u0444\u0438\u0433\u0443\u0440\u044b \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e mlp.rcParams['figure.figsize'] = (10, 6)  # \u0428\u0440\u0438\u0444\u0442\u044b mlp.rcParams['font.family'] = 'DejaVu Sans'  # \u043c\u043e\u0436\u0435\u0448\u044c \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u043d\u0430 'Arial', 'Roboto' \u0438 \u0442.\u0434. mlp.rcParams['font.size'] = 16  # \u0426\u0432\u0435\u0442 \u043e\u0441\u0435\u0439 (\u0441\u043f\u0438\u043d\u043a\u0438) mlp.rcParams['axes.edgecolor'] = '#333333' mlp.rcParams['axes.linewidth'] = 2  # \u0426\u0432\u0435\u0442 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0433\u043e \u0442\u0435\u043a\u0441\u0442\u0430 mlp.rcParams['text.color'] = '#222222'  <\/code><\/pre>\n<pre><code class=\"python\"># \u041e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u044e train...  train_df = pd.read_csv('..\/data\/train.csv')  <\/code><\/pre>\n<pre><code class=\"python\"># ... \u0438 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e test  test_df = pd.read_csv('..\/data\/test.csv')  <\/code><\/pre>\n<pre><code class=\"python\"># \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u0435\u0440\u0432\u044b\u0435 10 \u0441\u0442\u0440\u043e\u043a train'a  train_df.head(10)  <\/code><\/pre>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th>\n<p align=\"left\">\n<\/th>\n<th>\n<p align=\"left\">PassengerId<\/p>\n<\/th>\n<th>\n<p align=\"left\">Survived<\/p>\n<\/th>\n<th>\n<p align=\"left\">Pclass<\/p>\n<\/th>\n<th>\n<p align=\"left\">Name<\/p>\n<\/th>\n<th>\n<p align=\"left\">Sex<\/p>\n<\/th>\n<th>\n<p align=\"left\">Age<\/p>\n<\/th>\n<th>\n<p align=\"left\">SibSp<\/p>\n<\/th>\n<th>\n<p align=\"left\">Parch<\/p>\n<\/th>\n<th>\n<p align=\"left\">Ticket<\/p>\n<\/th>\n<th>\n<p align=\"left\">Fare<\/p>\n<\/th>\n<th>\n<p align=\"left\">Cabin<\/p>\n<\/th>\n<th>\n<p align=\"left\">Embarked<\/p>\n<\/th>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">0<\/p>\n<\/th>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">3<\/p>\n<\/td>\n<td>\n<p align=\"left\">Braund, Mr. Owen Harris<\/p>\n<\/td>\n<td>\n<p align=\"left\">male<\/p>\n<\/td>\n<td>\n<p align=\"left\">22.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">A\/5 21171<\/p>\n<\/td>\n<td>\n<p align=\"left\">7.2500<\/p>\n<\/td>\n<td>\n<p align=\"left\">NaN<\/p>\n<\/td>\n<td>\n<p align=\"left\">S<\/p>\n<\/td>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">1<\/p>\n<\/th>\n<td>\n<p align=\"left\">2<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<td>\n<p align=\"left\">Cumings, Mrs. John Bradley (Florence Briggs Th&#8230;<\/p>\n<\/td>\n<td>\n<p align=\"left\">female<\/p>\n<\/td>\n<td>\n<p align=\"left\">38.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">PC 17599<\/p>\n<\/td>\n<td>\n<p align=\"left\">71.2833<\/p>\n<\/td>\n<td>\n<p align=\"left\">C85<\/p>\n<\/td>\n<td>\n<p align=\"left\">C<\/p>\n<\/td>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">2<\/p>\n<\/th>\n<td>\n<p align=\"left\">3<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<td>\n<p align=\"left\">3<\/p>\n<\/td>\n<td>\n<p align=\"left\">Heikkinen, Miss. Laina<\/p>\n<\/td>\n<td>\n<p align=\"left\">female<\/p>\n<\/td>\n<td>\n<p align=\"left\">26.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">STON\/O2. 3101282<\/p>\n<\/td>\n<td>\n<p align=\"left\">7.9250<\/p>\n<\/td>\n<td>\n<p align=\"left\">NaN<\/p>\n<\/td>\n<td>\n<p align=\"left\">S<\/p>\n<\/td>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">3<\/p>\n<\/th>\n<td>\n<p align=\"left\">4<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<td>\n<p align=\"left\">Futrelle, Mrs. Jacques Heath (Lily May Peel)<\/p>\n<\/td>\n<td>\n<p align=\"left\">female<\/p>\n<\/td>\n<td>\n<p align=\"left\">35.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">113803<\/p>\n<\/td>\n<td>\n<p align=\"left\">53.1000<\/p>\n<\/td>\n<td>\n<p align=\"left\">C123<\/p>\n<\/td>\n<td>\n<p align=\"left\">S<\/p>\n<\/td>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">4<\/p>\n<\/th>\n<td>\n<p align=\"left\">5<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">3<\/p>\n<\/td>\n<td>\n<p align=\"left\">Allen, Mr. William Henry<\/p>\n<\/td>\n<td>\n<p align=\"left\">male<\/p>\n<\/td>\n<td>\n<p align=\"left\">35.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">373450<\/p>\n<\/td>\n<td>\n<p align=\"left\">8.0500<\/p>\n<\/td>\n<td>\n<p align=\"left\">NaN<\/p>\n<\/td>\n<td>\n<p align=\"left\">S<\/p>\n<\/td>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">5<\/p>\n<\/th>\n<td>\n<p align=\"left\">6<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">3<\/p>\n<\/td>\n<td>\n<p align=\"left\">Moran, Mr. James<\/p>\n<\/td>\n<td>\n<p align=\"left\">male<\/p>\n<\/td>\n<td>\n<p align=\"left\">NaN<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">330877<\/p>\n<\/td>\n<td>\n<p align=\"left\">8.4583<\/p>\n<\/td>\n<td>\n<p align=\"left\">NaN<\/p>\n<\/td>\n<td>\n<p align=\"left\">Q<\/p>\n<\/td>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">6<\/p>\n<\/th>\n<td>\n<p align=\"left\">7<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<td>\n<p align=\"left\">McCarthy, Mr. Timothy J<\/p>\n<\/td>\n<td>\n<p align=\"left\">male<\/p>\n<\/td>\n<td>\n<p align=\"left\">54.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">17463<\/p>\n<\/td>\n<td>\n<p align=\"left\">51.8625<\/p>\n<\/td>\n<td>\n<p align=\"left\">E46<\/p>\n<\/td>\n<td>\n<p align=\"left\">S<\/p>\n<\/td>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">7<\/p>\n<\/th>\n<td>\n<p align=\"left\">8<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">3<\/p>\n<\/td>\n<td>\n<p align=\"left\">Palsson, Master. Gosta Leonard<\/p>\n<\/td>\n<td>\n<p align=\"left\">male<\/p>\n<\/td>\n<td>\n<p align=\"left\">2.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">3<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<td>\n<p align=\"left\">349909<\/p>\n<\/td>\n<td>\n<p align=\"left\">21.0750<\/p>\n<\/td>\n<td>\n<p align=\"left\">NaN<\/p>\n<\/td>\n<td>\n<p align=\"left\">S<\/p>\n<\/td>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">8<\/p>\n<\/th>\n<td>\n<p align=\"left\">9<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<td>\n<p align=\"left\">3<\/p>\n<\/td>\n<td>\n<p align=\"left\">Johnson, Mrs. Oscar W (Elisabeth Vilhelmina Berg)<\/p>\n<\/td>\n<td>\n<p align=\"left\">female<\/p>\n<\/td>\n<td>\n<p align=\"left\">27.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">2<\/p>\n<\/td>\n<td>\n<p align=\"left\">347742<\/p>\n<\/td>\n<td>\n<p align=\"left\">11.1333<\/p>\n<\/td>\n<td>\n<p align=\"left\">NaN<\/p>\n<\/td>\n<td>\n<p align=\"left\">S<\/p>\n<\/td>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">9<\/p>\n<\/th>\n<td>\n<p align=\"left\">10<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<td>\n<p align=\"left\">2<\/p>\n<\/td>\n<td>\n<p align=\"left\">Nasser, Mrs. Nicholas (Adele Achem)<\/p>\n<\/td>\n<td>\n<p align=\"left\">female<\/p>\n<\/td>\n<td>\n<p align=\"left\">14.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">237736<\/p>\n<\/td>\n<td>\n<p align=\"left\">30.0708<\/p>\n<\/td>\n<td>\n<p align=\"left\">NaN<\/p>\n<\/td>\n<td>\n<p align=\"left\">C<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<pre><code class=\"python\"># \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043f\u043e train'\u0443  train_df.info()  <\/code><\/pre>\n<pre><code>RangeIndex: 891 entries, 0 to 890 Data columns (total 12 columns):  #   Column       Non-Null Count  Dtype   ---  ------       --------------  -----    0   PassengerId  891 non-null    int64    1   Survived     891 non-null    int64    2   Pclass       891 non-null    int64    3   Name         891 non-null    object   4   Sex          891 non-null    object   5   Age          714 non-null    float64  6   SibSp        891 non-null    int64    7   Parch        891 non-null    int64    8   Ticket       891 non-null    object   9   Fare         891 non-null    float64  10  Cabin        204 non-null    object   11  Embarked     889 non-null    object  dtypes: float64(2), int64(5), object(5) memory usage: 83.7+ KB <\/code><\/pre>\n<h4>\u0412\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u0435\u0441\u0442\u044c \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0438 \u0432 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0435 \u0432\u043e\u0437\u0440\u0430\u0441\u0442. \u041e\u0447\u0435\u043d\u044c \u043c\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u043e\u0432 \u0432 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0435 \u043a\u0430\u0431\u0438\u043d\u0430<\/h4>\n<pre><code class=\"python\"># \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0431\u0430\u0437\u043e\u0432\u0443\u044e \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0443 \u043f\u043e \u0447\u0438\u0441\u043b\u043e\u0432\u044b\u043c \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0430\u043c (\u0441\u0440\u0435\u0434\u043d\u0435\u0435, \u043c\u0435\u0434\u0438\u0430\u043d\u0430, std \u0438 \u0442.\u0434.)  train_df.describe()  <\/code><\/pre>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th>\n<p align=\"left\">\n<\/th>\n<th>\n<p align=\"left\">PassengerId<\/p>\n<\/th>\n<th>\n<p align=\"left\">Survived<\/p>\n<\/th>\n<th>\n<p align=\"left\">Pclass<\/p>\n<\/th>\n<th>\n<p align=\"left\">Age<\/p>\n<\/th>\n<th>\n<p align=\"left\">SibSp<\/p>\n<\/th>\n<th>\n<p align=\"left\">Parch<\/p>\n<\/th>\n<th>\n<p align=\"left\">Fare<\/p>\n<\/th>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">count<\/p>\n<\/th>\n<td>\n<p align=\"left\">891.000000<\/p>\n<\/td>\n<td>\n<p align=\"left\">891.000000<\/p>\n<\/td>\n<td>\n<p align=\"left\">891.000000<\/p>\n<\/td>\n<td>\n<p align=\"left\">714.000000<\/p>\n<\/td>\n<td>\n<p align=\"left\">891.000000<\/p>\n<\/td>\n<td>\n<p align=\"left\">891.000000<\/p>\n<\/td>\n<td>\n<p align=\"left\">891.000000<\/p>\n<\/td>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">mean<\/p>\n<\/th>\n<td>\n<p align=\"left\">446.000000<\/p>\n<\/td>\n<td>\n<p align=\"left\">0.383838<\/p>\n<\/td>\n<td>\n<p align=\"left\">2.308642<\/p>\n<\/td>\n<td>\n<p align=\"left\">29.699118<\/p>\n<\/td>\n<td>\n<p align=\"left\">0.523008<\/p>\n<\/td>\n<td>\n<p align=\"left\">0.381594<\/p>\n<\/td>\n<td>\n<p align=\"left\">32.204208<\/p>\n<\/td>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">std<\/p>\n<\/th>\n<td>\n<p align=\"left\">257.353842<\/p>\n<\/td>\n<td>\n<p align=\"left\">0.486592<\/p>\n<\/td>\n<td>\n<p align=\"left\">0.836071<\/p>\n<\/td>\n<td>\n<p align=\"left\">14.526497<\/p>\n<\/td>\n<td>\n<p align=\"left\">1.102743<\/p>\n<\/td>\n<td>\n<p align=\"left\">0.806057<\/p>\n<\/td>\n<td>\n<p align=\"left\">49.693429<\/p>\n<\/td>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">min<\/p>\n<\/th>\n<td>\n<p align=\"left\">1.000000<\/p>\n<\/td>\n<td>\n<p align=\"left\">0.000000<\/p>\n<\/td>\n<td>\n<p align=\"left\">1.000000<\/p>\n<\/td>\n<td>\n<p align=\"left\">0.420000<\/p>\n<\/td>\n<td>\n<p align=\"left\">0.000000<\/p>\n<\/td>\n<td>\n<p align=\"left\">0.000000<\/p>\n<\/td>\n<td>\n<p align=\"left\">0.000000<\/p>\n<\/td>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">25%<\/p>\n<\/th>\n<td>\n<p align=\"left\">223.500000<\/p>\n<\/td>\n<td>\n<p align=\"left\">0.000000<\/p>\n<\/td>\n<td>\n<p align=\"left\">2.000000<\/p>\n<\/td>\n<td>\n<p align=\"left\">20.125000<\/p>\n<\/td>\n<td>\n<p align=\"left\">0.000000<\/p>\n<\/td>\n<td>\n<p align=\"left\">0.000000<\/p>\n<\/td>\n<td>\n<p align=\"left\">7.910400<\/p>\n<\/td>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">50%<\/p>\n<\/th>\n<td>\n<p align=\"left\">446.000000<\/p>\n<\/td>\n<td>\n<p align=\"left\">0.000000<\/p>\n<\/td>\n<td>\n<p align=\"left\">3.000000<\/p>\n<\/td>\n<td>\n<p align=\"left\">28.000000<\/p>\n<\/td>\n<td>\n<p align=\"left\">0.000000<\/p>\n<\/td>\n<td>\n<p align=\"left\">0.000000<\/p>\n<\/td>\n<td>\n<p align=\"left\">14.454200<\/p>\n<\/td>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">75%<\/p>\n<\/th>\n<td>\n<p align=\"left\">668.500000<\/p>\n<\/td>\n<td>\n<p align=\"left\">1.000000<\/p>\n<\/td>\n<td>\n<p align=\"left\">3.000000<\/p>\n<\/td>\n<td>\n<p align=\"left\">38.000000<\/p>\n<\/td>\n<td>\n<p align=\"left\">1.000000<\/p>\n<\/td>\n<td>\n<p align=\"left\">0.000000<\/p>\n<\/td>\n<td>\n<p align=\"left\">31.000000<\/p>\n<\/td>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">max<\/p>\n<\/th>\n<td>\n<p align=\"left\">891.000000<\/p>\n<\/td>\n<td>\n<p align=\"left\">1.000000<\/p>\n<\/td>\n<td>\n<p align=\"left\">3.000000<\/p>\n<\/td>\n<td>\n<p align=\"left\">80.000000<\/p>\n<\/td>\n<td>\n<p align=\"left\">8.000000<\/p>\n<\/td>\n<td>\n<p align=\"left\">6.000000<\/p>\n<\/td>\n<td>\n<p align=\"left\">512.329200<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<pre><code class=\"python\"># \u0418 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0443 \u043f\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u043d\u044b\u043c \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0430\u043c  train_df.describe(include='object')  <\/code><\/pre>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th>\n<p align=\"left\">\n<\/th>\n<th>\n<p align=\"left\">Name<\/p>\n<\/th>\n<th>\n<p align=\"left\">Sex<\/p>\n<\/th>\n<th>\n<p align=\"left\">Ticket<\/p>\n<\/th>\n<th>\n<p align=\"left\">Cabin<\/p>\n<\/th>\n<th>\n<p align=\"left\">Embarked<\/p>\n<\/th>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">count<\/p>\n<\/th>\n<td>\n<p align=\"left\">891<\/p>\n<\/td>\n<td>\n<p align=\"left\">891<\/p>\n<\/td>\n<td>\n<p align=\"left\">891<\/p>\n<\/td>\n<td>\n<p align=\"left\">204<\/p>\n<\/td>\n<td>\n<p align=\"left\">889<\/p>\n<\/td>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">unique<\/p>\n<\/th>\n<td>\n<p align=\"left\">891<\/p>\n<\/td>\n<td>\n<p align=\"left\">2<\/p>\n<\/td>\n<td>\n<p align=\"left\">681<\/p>\n<\/td>\n<td>\n<p align=\"left\">147<\/p>\n<\/td>\n<td>\n<p align=\"left\">3<\/p>\n<\/td>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">top<\/p>\n<\/th>\n<td>\n<p align=\"left\">Braund, Mr. Owen Harris<\/p>\n<\/td>\n<td>\n<p align=\"left\">male<\/p>\n<\/td>\n<td>\n<p align=\"left\">347082<\/p>\n<\/td>\n<td>\n<p align=\"left\">G6<\/p>\n<\/td>\n<td>\n<p align=\"left\">S<\/p>\n<\/td>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">freq<\/p>\n<\/th>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<td>\n<p align=\"left\">577<\/p>\n<\/td>\n<td>\n<p align=\"left\">7<\/p>\n<\/td>\n<td>\n<p align=\"left\">4<\/p>\n<\/td>\n<td>\n<p align=\"left\">644<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<pre><code class=\"python\"># \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0442\u0430\u0440\u0433\u0435\u0442\u0430  sns.countplot(x='Survived', data=train_df) plt.title('\u0420\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0432\u044b\u0436\u0438\u0432\u0448\u0438\u0445') plt.show()  <\/code><\/pre>\n<figure class=\"full-width\"><\/figure>\n<h4>\u0414\u0438\u0441\u0431\u0430\u043b\u0430\u043d\u0441\u0430 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u043d\u0435 \u043d\u0435\u0430\u0431\u043b\u044e\u0434\u0430\u0435\u043c<\/h4>\n<pre><code class=\"python\"># \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0442\u0430\u0440\u0433\u0435\u0442\u0430 \u043f\u043e \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0430\u043c  # \u041f\u043e\u043b plt.figure(figsize=(5,4)) sns.countplot(x='Sex', hue='Survived', data=train_df) plt.title('\u041f\u043e\u043b \u0438 \u0432\u044b\u0436\u0438\u0432\u0430\u043d\u0438\u0435') plt.show()  # \u041a\u043b\u0430\u0441\u0441 \u043a\u0430\u044e\u0442\u044b plt.figure(figsize=(5,4)) sns.countplot(x='Pclass', hue='Survived', data=train_df) plt.title('\u041a\u043b\u0430\u0441\u0441 \u043a\u0430\u044e\u0442\u044b \u0438 \u0432\u044b\u0436\u0438\u0432\u0430\u043d\u0438\u0435') plt.show()  # \u041f\u043e\u0440\u0442 \u043f\u043e\u0441\u0430\u0434\u043a\u0438 plt.figure(figsize=(5,4)) sns.countplot(x='Embarked', hue='Survived', data=train_df) plt.title('\u041f\u043e\u0440\u0442 \u043f\u043e\u0441\u0430\u0434\u043a\u0438 \u0438 \u0432\u044b\u0436\u0438\u0432\u0430\u043d\u0438\u0435') plt.show()  <\/code><\/pre>\n<figure class=\"\">\n<div><figcaption>png<\/figcaption><\/div>\n<\/figure>\n<figure class=\"\">\n<div><figcaption>png<\/figcaption><\/div>\n<\/figure>\n<figure class=\"\"><\/figure>\n<h4>\u0412\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u0432\u0441\u0435 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0438 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0432\u0430\u0436\u043d\u044b\u043c\u0438 \u0434\u043b\u044f \u0442\u0430\u0440\u0433\u0435\u0442\u0430. \u0412 \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0433\u0440\u0430\u0444\u0438\u043a\u0438 \u0434\u043b\u044f \u0440\u0430\u0437\u043d\u044b\u0445 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432 \u0431\u044b\u043b\u0438 \u0431\u044b \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u043c\u0438.<\/h4>\n<pre><code class=\"python\"># \u0414\u043b\u044f \u0432\u043e\u0437\u0440\u0430\u0441\u0442\u0430 \u0438 \u043f\u043b\u0430\u0442\u044b \u0437\u0430 \u043f\u0440\u043e\u0435\u0437\u0434 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u044f\u0449\u0438\u043a\u0438 \u0441 \u0443\u0441\u0430\u043c\u0438  # \u0412\u043e\u0437\u0440\u0430\u0441\u0442 plt.figure(figsize=(6,5)) sns.boxplot(x='Survived', y='Age', data=train_df) plt.title('\u0412\u043e\u0437\u0440\u0430\u0441\u0442 \u0438 \u0432\u044b\u0436\u0438\u0432\u0430\u043d\u0438\u0435 (boxplot)') plt.show()  # Fare plt.figure(figsize=(6,5)) sns.boxplot(x='Survived', y='Fare', data=train_df) plt.title('\u0421\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c \u0431\u0438\u043b\u0435\u0442\u0430 \u0438 \u0432\u044b\u0436\u0438\u0432\u0430\u043d\u0438\u0435 (boxplot)') plt.show()  <\/code><\/pre>\n<figure class=\"full-width\">\n<div><figcaption>png<\/figcaption><\/div>\n<\/figure>\n<figure class=\"full-width\">\n<div><figcaption>png<\/figcaption><\/div>\n<\/figure>\n<h4>\u0422\u043e\u0436\u0435 \u0432\u0438\u0434\u043d\u044b \u0440\u0430\u0437\u043b\u0438\u0447\u0438\u044f \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0442\u0430\u0440\u0433\u0435\u0442\u0430<\/h4>\n<pre><code class=\"python\"># \u0421\u0434\u0435\u043b\u0430\u0435\u043c \u0441\u043f\u0438\u0441\u043a\u0438: \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u0438 \u0447\u0438\u0441\u043b\u043e\u0432\u044b\u0435 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0438  categorical_cols = ['Sex', 'Pclass', 'Embarked', 'Cabin'] numeric_cols = ['Age', 'Fare', 'SibSp', 'Parch'] <\/code><\/pre>\n<pre><code class=\"python\"># \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0442\u0435\u043f\u043b\u043e\u0432\u0443\u044e \u043a\u0430\u0440\u0442\u0443 \u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u0438 \u043c\u0435\u0436\u0434\u0443 \u0447\u0438\u0441\u043b\u043e\u0432\u044b\u043c\u0438 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0430\u043c\u0438  plt.figure(figsize=(10,8)) sns.heatmap(train_df.corr(numeric_only=True), annot=True, cmap='coolwarm', fmt=\".2f\") plt.title('\u041a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u044f \u0447\u0438\u0441\u043b\u043e\u0432\u044b\u0445 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432') plt.show()  <\/code><\/pre>\n<figure class=\"full-width\">\n<div><figcaption>png<\/figcaption><\/div>\n<\/figure>\n<h4>\u0412\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u043e \u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u043c\u0443\u043b\u044c\u0442\u0438\u043a\u043e\u043b\u043b\u0438\u043d\u0435\u0430\u0440\u043d\u044b\u0445 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432 \u043d\u0435\u0442, \u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u0438<\/h4>\n<pre><code class=\"python\">### \u0421\u0435\u043a\u0440\u0435\u0442\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0441\u043e Stackovervlow \u0434\u043b\u044f \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u0438 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432  def get_redundant_pairs(df):     pairs_to_drop = set()     cols = df.columns     for i in range(0, df.shape[1]):         for j in range(0, i+1):             pairs_to_drop.add((cols[i], cols[j]))     return pairs_to_drop  def get_top_abs_correlations(df, n=5):     au_corr = df.corr().abs().unstack()     labels_to_drop = get_redundant_pairs(df)     au_corr = au_corr.drop(labels=labels_to_drop).sort_values(ascending=False)     return au_corr[0:n]  print(\"Top Absolute Correlations\") print(get_top_abs_correlations(train_df[numeric_cols], 10)) <\/code><\/pre>\n<pre><code>Top Absolute Correlations SibSp  Parch    0.414838 Age    SibSp    0.308247 Fare   Parch    0.216225 Age    Parch    0.189119 Fare   SibSp    0.159651 Age    Fare     0.096067 dtype: float64 <\/code><\/pre>\n<h4>\u041c\u0443\u043b\u044c\u0442\u0438\u043a\u043e\u043b\u043b\u0438\u043d\u0435\u0430\u0440\u043d\u043e\u0441\u0442\u0438 \u043d\u0435\u0442 &#8212; \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0430\u0435\u043c<\/h4>\n<pre><code class=\"python\"># \u0421\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0438  train_df.isnull().sum()  <\/code><\/pre>\n<pre><code>PassengerId      0 Survived         0 Pclass           0 Name             0 Sex              0 Age            177 SibSp            0 Parch            0 Ticket           0 Fare             0 Cabin          687 Embarked         2 dtype: int64 <\/code><\/pre>\n<pre><code class=\"python\">#\u0423\u0434\u0430\u043b\u044f\u0435\u043c \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0438 \u0432 \u043a\u043e\u043b\u043e\u043d\u043a\u0435 \"Embarked\" #\u0422\u0430\u043a \u043a\u0430\u043a \u0438\u0445 \u0432\u0441\u0435\u0433\u043e \u0434\u0432\u0430 #\u0421\u0435\u0439\u0447\u0430\u0441 \u0434\u043e \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f #\u0422\u0440\u0435\u043d\u0438\u0440\u043e\u0432\u043e\u0447\u043d\u044b\u0445 \u0438 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 #\u041c\u043e\u0436\u043d\u043e \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c  train_df = train_df.dropna(subset=['Embarked']).copy()  <\/code><\/pre>\n<pre><code class=\"python\">#\u0421\u043c\u043e\u0442\u0440\u0438\u043c \u0441\u043d\u043e\u0432\u0430  train_df.isnull().sum()  <\/code><\/pre>\n<pre><code>PassengerId      0 Survived         0 Pclass           0 Name             0 Sex              0 Age            177 SibSp            0 Parch            0 Ticket           0 Fare             0 Cabin          687 Embarked         0 dtype: int64 <\/code><\/pre>\n<h4>\u041f\u043e\u0441\u043b\u0435 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u0442\u044c \u0441\u0442\u0440\u043e\u043a\u0438. \u0423\u0434\u0430\u043b\u044f\u043b\u0438 \u0434\u043e \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u043f\u043e\u0432\u0440\u0435\u0434\u0438\u0442\u044c \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435.<\/h4>\n<h4>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u0433\u043e\u0442\u043e\u0432\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043a \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044e \u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043e\u0431\u0449\u0435\u0433\u043e \u0434\u0430\u0442\u0430\u0444\u0440\u0435\u0439\u043c\u0430.<\/h4>\n<h4>\u041e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0443\u0436\u043d\u043e \u0432\u0441\u0451 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0438\u0441\u043f\u043e\u0440\u0442\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435<\/h4>\n<pre><code class=\"python\">#\u0414\u043e\u0431\u0430\u0432\u0438\u043c \u043a\u043e\u043b\u043e\u043d\u043a\u0443-\u043c\u0435\u0442\u043a\u0443, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0442\u043e\u043c \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043e\u0431\u0440\u0430\u0442\u043d\u043e  train_df['is_train'] = 1 test_df['is_train'] = 0  <\/code><\/pre>\n<pre><code class=\"python\">#\u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0444\u0438\u043a\u0442\u0438\u0432\u043d\u0443\u044e \u043a\u043e\u043b\u043e\u043d\u043a\u0443 `Survived` \u0432 \u0442\u0435\u0441\u0442 (\u0447\u0442\u043e\u0431\u044b \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0431\u044b\u043b\u0430 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u0430\u044f)  test_df['Survived'] = np.nan  <\/code><\/pre>\n<pre><code class=\"python\">#\u0421\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c PassengerId \u0438\u0437 \u0442\u0435\u0441\u0442\u0430 \u0434\u043b\u044f submission  passenger_ids = test_df['PassengerId'].copy()  <\/code><\/pre>\n<h4>(\u043a\u043e\u043b\u043e\u043d\u043a\u0430 \u043d\u0435 \u0432\u0430\u0436\u043d\u0430 \u0434\u043b\u044f \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f, \u043d\u043e \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0432 \u0438\u0442\u043e\u0433\u043e\u0432\u043e\u043c \u0444\u0430\u0439\u043b\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f)<\/h4>\n<pre><code class=\"python\">#\u0423\u0434\u0430\u043b\u044f\u0435\u043c \u043a\u043e\u043b\u043e\u043d\u043a\u0443 PassengerId \u043f\u0435\u0440\u0435\u0434 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435\u043c \u2014 \u043e\u043d\u0430 \u043d\u0435 \u043d\u0443\u0436\u043d\u0430 \u0434\u043b\u044f \u043c\u043e\u0434\u0435\u043b\u0438  train_df = train_df.drop(columns=['PassengerId']) test_df = test_df.drop(columns=['PassengerId']) <\/code><\/pre>\n<pre><code class=\"python\">#\u041e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u0435\u043c \u0442\u0440\u0435\u043d\u0438\u0440\u043e\u0432\u043e\u0447\u043d\u044b\u0435 \u0438 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445  full_df = pd.concat([train_df, test_df], axis=0).reset_index(drop=True)  <\/code><\/pre>\n<pre><code class=\"python\">#\u041f\u0440\u043e\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043a \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0435 Age \u0437\u0430\u043c\u0435\u043d\u044f\u0435\u043c \u043c\u0435\u0434\u0438\u0430\u043d\u043d\u044b\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c \u043f\u043e \u0432\u0441\u0435\u043c \u043f\u0430\u0441\u0441\u0430\u0436\u0438\u0440\u0430\u043c #\u041d\u043e \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u044b\u043b\u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0442\u0440\u0435\u043d\u0438\u0440\u043e\u0432\u043e\u0447\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 #\u041c\u0435\u0434\u0438\u0430\u043d\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043c\u0435\u043d\u0435\u0435 \u0447\u0443\u0432\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043a \u0432\u044b\u0431\u0440\u043e\u0441\u0430\u043c \u0432 \u0434\u0430\u043d\u043d\u044b\u0445  full_df['Age'] = full_df['Age'].fillna(train_df['Age'].median())  <\/code><\/pre>\n<pre><code class=\"python\"># \u0421\u043d\u043e\u0432\u0430 \u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0438, \u043d\u043e \u0443\u0436\u0435 \u0432 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0451\u043d\u043d\u043e\u043c \u0434\u0430\u0442\u0430\u0444\u0440\u0435\u0439\u043c\u0435  full_df.isnull().sum()  <\/code><\/pre>\n<pre><code>Survived     418 Pclass         0 Name           0 Sex            0 Age            0 SibSp          0 Parch          0 Ticket         0 Fare           1 Cabin       1014 Embarked       0 is_train       0 dtype: int64 <\/code><\/pre>\n<pre><code class=\"python\"># \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0435\u0449\u0451 \u0440\u0430\u0437 \u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u0435, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0438\u043d\u044f\u0442\u044c \u0440\u0435\u0448\u0435\u043d\u0438\u0435, \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u0441 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u043c \u043f\u043b\u0430\u0442\u0430 \u0437\u0430 \u043f\u0440\u043e\u0435\u0437\u0434  full_df.head(20) <\/code><\/pre>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th>\n<p align=\"left\">\n<\/th>\n<th>\n<p align=\"left\">Survived<\/p>\n<\/th>\n<th>\n<p align=\"left\">Pclass<\/p>\n<\/th>\n<th>\n<p align=\"left\">Name<\/p>\n<\/th>\n<th>\n<p align=\"left\">Sex<\/p>\n<\/th>\n<th>\n<p align=\"left\">Age<\/p>\n<\/th>\n<th>\n<p align=\"left\">SibSp<\/p>\n<\/th>\n<th>\n<p align=\"left\">Parch<\/p>\n<\/th>\n<th>\n<p align=\"left\">Ticket<\/p>\n<\/th>\n<th>\n<p align=\"left\">Fare<\/p>\n<\/th>\n<th>\n<p align=\"left\">Cabin<\/p>\n<\/th>\n<th>\n<p align=\"left\">Embarked<\/p>\n<\/th>\n<th>\n<p align=\"left\">is_train<\/p>\n<\/th>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">0<\/p>\n<\/th>\n<td>\n<p align=\"left\">0.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">3<\/p>\n<\/td>\n<td>\n<p align=\"left\">Braund, Mr. Owen Harris<\/p>\n<\/td>\n<td>\n<p align=\"left\">male<\/p>\n<\/td>\n<td>\n<p align=\"left\">22.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">A\/5 21171<\/p>\n<\/td>\n<td>\n<p align=\"left\">7.2500<\/p>\n<\/td>\n<td>\n<p align=\"left\">NaN<\/p>\n<\/td>\n<td>\n<p align=\"left\">S<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">1<\/p>\n<\/th>\n<td>\n<p align=\"left\">1.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<td>\n<p align=\"left\">Cumings, Mrs. John Bradley (Florence Briggs Th&#8230;<\/p>\n<\/td>\n<td>\n<p align=\"left\">female<\/p>\n<\/td>\n<td>\n<p align=\"left\">38.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">PC 17599<\/p>\n<\/td>\n<td>\n<p align=\"left\">71.2833<\/p>\n<\/td>\n<td>\n<p align=\"left\">C85<\/p>\n<\/td>\n<td>\n<p align=\"left\">C<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">2<\/p>\n<\/th>\n<td>\n<p align=\"left\">1.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">3<\/p>\n<\/td>\n<td>\n<p align=\"left\">Heikkinen, Miss. Laina<\/p>\n<\/td>\n<td>\n<p align=\"left\">female<\/p>\n<\/td>\n<td>\n<p align=\"left\">26.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">STON\/O2. 3101282<\/p>\n<\/td>\n<td>\n<p align=\"left\">7.9250<\/p>\n<\/td>\n<td>\n<p align=\"left\">NaN<\/p>\n<\/td>\n<td>\n<p align=\"left\">S<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">3<\/p>\n<\/th>\n<td>\n<p align=\"left\">1.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<td>\n<p align=\"left\">Futrelle, Mrs. Jacques Heath (Lily May Peel)<\/p>\n<\/td>\n<td>\n<p align=\"left\">female<\/p>\n<\/td>\n<td>\n<p align=\"left\">35.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">113803<\/p>\n<\/td>\n<td>\n<p align=\"left\">53.1000<\/p>\n<\/td>\n<td>\n<p align=\"left\">C123<\/p>\n<\/td>\n<td>\n<p align=\"left\">S<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">4<\/p>\n<\/th>\n<td>\n<p align=\"left\">0.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">3<\/p>\n<\/td>\n<td>\n<p align=\"left\">Allen, Mr. William Henry<\/p>\n<\/td>\n<td>\n<p align=\"left\">male<\/p>\n<\/td>\n<td>\n<p align=\"left\">35.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">373450<\/p>\n<\/td>\n<td>\n<p align=\"left\">8.0500<\/p>\n<\/td>\n<td>\n<p align=\"left\">NaN<\/p>\n<\/td>\n<td>\n<p align=\"left\">S<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">5<\/p>\n<\/th>\n<td>\n<p align=\"left\">0.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">3<\/p>\n<\/td>\n<td>\n<p align=\"left\">Moran, Mr. James<\/p>\n<\/td>\n<td>\n<p align=\"left\">male<\/p>\n<\/td>\n<td>\n<p align=\"left\">28.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">330877<\/p>\n<\/td>\n<td>\n<p align=\"left\">8.4583<\/p>\n<\/td>\n<td>\n<p align=\"left\">NaN<\/p>\n<\/td>\n<td>\n<p align=\"left\">Q<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">6<\/p>\n<\/th>\n<td>\n<p align=\"left\">0.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<td>\n<p align=\"left\">McCarthy, Mr. Timothy J<\/p>\n<\/td>\n<td>\n<p align=\"left\">male<\/p>\n<\/td>\n<td>\n<p align=\"left\">54.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">17463<\/p>\n<\/td>\n<td>\n<p align=\"left\">51.8625<\/p>\n<\/td>\n<td>\n<p align=\"left\">E46<\/p>\n<\/td>\n<td>\n<p align=\"left\">S<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">7<\/p>\n<\/th>\n<td>\n<p align=\"left\">0.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">3<\/p>\n<\/td>\n<td>\n<p align=\"left\">Palsson, Master. Gosta Leonard<\/p>\n<\/td>\n<td>\n<p align=\"left\">male<\/p>\n<\/td>\n<td>\n<p align=\"left\">2.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">3<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<td>\n<p align=\"left\">349909<\/p>\n<\/td>\n<td>\n<p align=\"left\">21.0750<\/p>\n<\/td>\n<td>\n<p align=\"left\">NaN<\/p>\n<\/td>\n<td>\n<p align=\"left\">S<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">8<\/p>\n<\/th>\n<td>\n<p align=\"left\">1.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">3<\/p>\n<\/td>\n<td>\n<p align=\"left\">Johnson, Mrs. Oscar W (Elisabeth Vilhelmina Berg)<\/p>\n<\/td>\n<td>\n<p align=\"left\">female<\/p>\n<\/td>\n<td>\n<p align=\"left\">27.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">2<\/p>\n<\/td>\n<td>\n<p align=\"left\">347742<\/p>\n<\/td>\n<td>\n<p align=\"left\">11.1333<\/p>\n<\/td>\n<td>\n<p align=\"left\">NaN<\/p>\n<\/td>\n<td>\n<p align=\"left\">S<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">9<\/p>\n<\/th>\n<td>\n<p align=\"left\">1.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">2<\/p>\n<\/td>\n<td>\n<p align=\"left\">Nasser, Mrs. Nicholas (Adele Achem)<\/p>\n<\/td>\n<td>\n<p align=\"left\">female<\/p>\n<\/td>\n<td>\n<p align=\"left\">14.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">237736<\/p>\n<\/td>\n<td>\n<p align=\"left\">30.0708<\/p>\n<\/td>\n<td>\n<p align=\"left\">NaN<\/p>\n<\/td>\n<td>\n<p align=\"left\">C<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">10<\/p>\n<\/th>\n<td>\n<p align=\"left\">1.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">3<\/p>\n<\/td>\n<td>\n<p align=\"left\">Sandstrom, Miss. Marguerite Rut<\/p>\n<\/td>\n<td>\n<p align=\"left\">female<\/p>\n<\/td>\n<td>\n<p align=\"left\">4.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<td>\n<p align=\"left\">PP 9549<\/p>\n<\/td>\n<td>\n<p align=\"left\">16.7000<\/p>\n<\/td>\n<td>\n<p align=\"left\">G6<\/p>\n<\/td>\n<td>\n<p align=\"left\">S<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">11<\/p>\n<\/th>\n<td>\n<p align=\"left\">1.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<td>\n<p align=\"left\">Bonnell, Miss. Elizabeth<\/p>\n<\/td>\n<td>\n<p align=\"left\">female<\/p>\n<\/td>\n<td>\n<p align=\"left\">58.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">113783<\/p>\n<\/td>\n<td>\n<p align=\"left\">26.5500<\/p>\n<\/td>\n<td>\n<p align=\"left\">C103<\/p>\n<\/td>\n<td>\n<p align=\"left\">S<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">12<\/p>\n<\/th>\n<td>\n<p align=\"left\">0.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">3<\/p>\n<\/td>\n<td>\n<p align=\"left\">Saundercock, Mr. William Henry<\/p>\n<\/td>\n<td>\n<p align=\"left\">male<\/p>\n<\/td>\n<td>\n<p align=\"left\">20.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">A\/5. 2151<\/p>\n<\/td>\n<td>\n<p align=\"left\">8.0500<\/p>\n<\/td>\n<td>\n<p align=\"left\">NaN<\/p>\n<\/td>\n<td>\n<p align=\"left\">S<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">13<\/p>\n<\/th>\n<td>\n<p align=\"left\">0.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">3<\/p>\n<\/td>\n<td>\n<p align=\"left\">Andersson, Mr. Anders Johan<\/p>\n<\/td>\n<td>\n<p align=\"left\">male<\/p>\n<\/td>\n<td>\n<p align=\"left\">39.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<td>\n<p align=\"left\">5<\/p>\n<\/td>\n<td>\n<p align=\"left\">347082<\/p>\n<\/td>\n<td>\n<p align=\"left\">31.2750<\/p>\n<\/td>\n<td>\n<p align=\"left\">NaN<\/p>\n<\/td>\n<td>\n<p align=\"left\">S<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<\/tr>\n<tr>\n<th>\n<p align=\"left\">14<\/p>\n<\/th>\n<td>\n<p align=\"left\">0.0<\/p>\n<\/td>\n<td>\n<p align=\"left\">3<\/p>\n<\/td>\n<td>\n<p align=\"left\">Vestrom, Miss. Hulda Amanda Adolfina<\/p>\n<\/td>\n<td>\n<p align=\"left\">female<\/p>\n<\/td>\n<td>\n<p align=\"left\">14.0<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-470114","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/470114","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=470114"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/470114\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=470114"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=470114"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=470114"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}