AIM-PIbd-31-Ievlewa-M-D/lab2/lab2.ipynb

3144 lines
1.5 MiB
Plaintext
Raw Normal View History

2024-10-11 18:41:52 +04:00
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### 1. Датасет: Диабет у индейцев Пима\n",
"https://www.kaggle.com/datasets/uciml/pima-indians-diabetes-database\n",
"##### О наборе данных: \n",
"Этот набор данных был получен из Национального института диабета, болезней органов пищеварения и почек. Цель набора данных - диагностически предсказать, есть ли у пациента сахарный диабет, на основе определенных диагностических измерений, включенных в набор данных. На выбор этих образцов из более обширной базы данных было наложено несколько ограничений. В частности, все пациенты были женщинами в возрасте не менее 21 года, родом из племени пима.\n",
"##### Таким образом:\n",
"* Объект наблюдения - женщины племени пима, возрастом от 21 года.\n",
"* Атрибуты: Pregnancies, Glucose, BloodPressure, SkinThickness, Insulin, BMI, DiabetesPedigreeFunction, Age, Outcome.\n",
"* Проблемная область: Предсказание диабета у пациента на основе измерений."
]
},
{
"cell_type": "code",
2024-10-11 18:46:40 +04:00
"execution_count": 2,
2024-10-11 18:41:52 +04:00
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Количество колонок: 9\n",
"Колонки: Pregnancies, Glucose, BloodPressure, SkinThickness, Insulin, BMI, DiabetesPedigreeFunction, Age, Outcome\n",
"\n",
"<class 'pandas.core.frame.DataFrame'>\n",
"RangeIndex: 768 entries, 0 to 767\n",
"Data columns (total 9 columns):\n",
" # Column Non-Null Count Dtype \n",
"--- ------ -------------- ----- \n",
" 0 Pregnancies 768 non-null int64 \n",
" 1 Glucose 768 non-null int64 \n",
" 2 BloodPressure 768 non-null int64 \n",
" 3 SkinThickness 768 non-null int64 \n",
" 4 Insulin 768 non-null int64 \n",
" 5 BMI 768 non-null float64\n",
" 6 DiabetesPedigreeFunction 768 non-null float64\n",
" 7 Age 768 non-null int64 \n",
" 8 Outcome 768 non-null int64 \n",
"dtypes: float64(2), int64(7)\n",
"memory usage: 54.1 KB\n"
]
},
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>Pregnancies</th>\n",
" <th>Glucose</th>\n",
" <th>BloodPressure</th>\n",
" <th>SkinThickness</th>\n",
" <th>Insulin</th>\n",
" <th>BMI</th>\n",
" <th>DiabetesPedigreeFunction</th>\n",
" <th>Age</th>\n",
" <th>Outcome</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>6</td>\n",
" <td>148</td>\n",
" <td>72</td>\n",
" <td>35</td>\n",
" <td>0</td>\n",
" <td>33.6</td>\n",
" <td>0.627</td>\n",
" <td>50</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>1</td>\n",
" <td>85</td>\n",
" <td>66</td>\n",
" <td>29</td>\n",
" <td>0</td>\n",
" <td>26.6</td>\n",
" <td>0.351</td>\n",
" <td>31</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>8</td>\n",
" <td>183</td>\n",
" <td>64</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>23.3</td>\n",
" <td>0.672</td>\n",
" <td>32</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>1</td>\n",
" <td>89</td>\n",
" <td>66</td>\n",
" <td>23</td>\n",
" <td>94</td>\n",
" <td>28.1</td>\n",
" <td>0.167</td>\n",
" <td>21</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>0</td>\n",
" <td>137</td>\n",
" <td>40</td>\n",
" <td>35</td>\n",
" <td>168</td>\n",
" <td>43.1</td>\n",
" <td>2.288</td>\n",
" <td>33</td>\n",
" <td>1</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" Pregnancies Glucose BloodPressure SkinThickness Insulin BMI \\\n",
"0 6 148 72 35 0 33.6 \n",
"1 1 85 66 29 0 26.6 \n",
"2 8 183 64 0 0 23.3 \n",
"3 1 89 66 23 94 28.1 \n",
"4 0 137 40 35 168 43.1 \n",
"\n",
" DiabetesPedigreeFunction Age Outcome \n",
"0 0.627 50 1 \n",
"1 0.351 31 0 \n",
"2 0.672 32 1 \n",
"3 0.167 21 0 \n",
"4 2.288 33 1 "
]
},
2024-10-11 18:46:40 +04:00
"execution_count": 2,
2024-10-11 18:41:52 +04:00
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"import pandas as pd\n",
"df = pd.read_csv(\".//static//csv//diabetes.csv\", sep=\",\")\n",
"print('Количество колонок: ' + str(df.columns.size)) \n",
"print('Колонки: ' + ', '.join(df.columns)+'\\n')\n",
"\n",
"df.info()\n",
"df.head()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Получение сведений о пропущенных данных\n",
"Типы пропущенных данных:\n",
"\n",
"- None - представление пустых данных в Python\n",
"- NaN - представление пустых данных в Pandas\n",
"- '' - пустая строка"
]
},
{
"cell_type": "code",
2024-10-11 18:46:40 +04:00
"execution_count": 3,
2024-10-11 18:41:52 +04:00
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Pregnancies 0\n",
"Glucose 0\n",
"BloodPressure 0\n",
"SkinThickness 0\n",
"Insulin 0\n",
"BMI 0\n",
"DiabetesPedigreeFunction 0\n",
"Age 0\n",
"Outcome 0\n",
"dtype: int64\n",
"\n",
"Pregnancies False\n",
"Glucose False\n",
"BloodPressure False\n",
"SkinThickness False\n",
"Insulin False\n",
"BMI False\n",
"DiabetesPedigreeFunction False\n",
"Age False\n",
"Outcome False\n",
"dtype: bool\n",
"\n",
"Pregnancies процент пустых значений: %0.00\n",
"Glucose процент пустых значений: %0.00\n",
"BloodPressure процент пустых значений: %0.00\n",
"SkinThickness процент пустых значений: %0.00\n",
"Insulin процент пустых значений: %0.00\n",
"BMI процент пустых значений: %0.00\n",
"DiabetesPedigreeFunction процент пустых значений: %0.00\n",
"Age процент пустых значений: %0.00\n",
"Outcome процент пустых значений: %0.00\n"
]
}
],
"source": [
"# Количество пустых значений признаков\n",
"print(df.isnull().sum())\n",
"print()\n",
"\n",
"# Есть ли пустые значения признаков\n",
"print(df.isnull().any())\n",
"print()\n",
"\n",
"# Процент пустых значений признаков\n",
"for i in df.columns:\n",
" null_rate = df[i].isnull().sum() / len(df) * 100\n",
" print(f\"{i} процент пустых значений: %{null_rate:.2f}\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##### Проверим выбросы и устраним их:"
]
},
{
"cell_type": "code",
2024-10-11 18:46:40 +04:00
"execution_count": 4,
2024-10-11 18:41:52 +04:00
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Колонка Pregnancies:\n",
" Есть выбросы: Да\n",
" Количество выбросов: 4\n",
" Минимальное значение: 0.0\n",
" Максимальное значение: 13.5\n",
" 1-й квартиль (Q1): 1.0\n",
" 3-й квартиль (Q3): 6.0\n",
"\n",
"Колонка Glucose:\n",
" Есть выбросы: Да\n",
" Количество выбросов: 5\n",
" Минимальное значение: 37.125\n",
" Максимальное значение: 199.0\n",
" 1-й квартиль (Q1): 99.0\n",
" 3-й квартиль (Q3): 140.25\n",
"\n",
"Колонка BloodPressure:\n",
" Есть выбросы: Да\n",
" Количество выбросов: 45\n",
" Минимальное значение: 35.0\n",
" Максимальное значение: 107.0\n",
" 1-й квартиль (Q1): 62.0\n",
" 3-й квартиль (Q3): 80.0\n",
"\n",
"Колонка SkinThickness:\n",
" Есть выбросы: Да\n",
" Количество выбросов: 1\n",
" Минимальное значение: 0.0\n",
" Максимальное значение: 80.0\n",
" 1-й квартиль (Q1): 0.0\n",
" 3-й квартиль (Q3): 32.0\n",
"\n",
"Колонка Insulin:\n",
" Есть выбросы: Да\n",
" Количество выбросов: 34\n",
" Минимальное значение: 0.0\n",
" Максимальное значение: 318.125\n",
" 1-й квартиль (Q1): 0.0\n",
" 3-й квартиль (Q3): 127.25\n",
"\n",
"Колонка BMI:\n",
" Есть выбросы: Да\n",
" Количество выбросов: 19\n",
" Минимальное значение: 13.35\n",
" Максимальное значение: 50.550000000000004\n",
" 1-й квартиль (Q1): 27.3\n",
" 3-й квартиль (Q3): 36.6\n",
"\n",
"Колонка DiabetesPedigreeFunction:\n",
" Есть выбросы: Да\n",
" Количество выбросов: 29\n",
" Минимальное значение: 0.078\n",
" Максимальное значение: 1.2\n",
" 1-й квартиль (Q1): 0.24375\n",
" 3-й квартиль (Q3): 0.62625\n",
"\n",
"Колонка Age:\n",
" Есть выбросы: Да\n",
" Количество выбросов: 9\n",
" Минимальное значение: 21.0\n",
" Максимальное значение: 66.5\n",
" 1-й квартиль (Q1): 24.0\n",
" 3-й квартиль (Q3): 41.0\n",
"\n"
]
}
],
"source": [
"numeric_columns = ['Pregnancies', 'Glucose', 'BloodPressure', 'SkinThickness', 'Insulin', 'BMI', 'DiabetesPedigreeFunction', 'Age']\n",
"for column in numeric_columns:\n",
" if pd.api.types.is_numeric_dtype(df[column]): # Проверяем, является ли колонка числовой\n",
" q1 = df[column].quantile(0.25) # Находим 1-й квартиль (Q1)\n",
" q3 = df[column].quantile(0.75) # Находим 3-й квартиль (Q3)\n",
" iqr = q3 - q1 # Вычисляем межквартильный размах (IQR)\n",
"\n",
" # Определяем границы для выбросов\n",
" lower_bound = q1 - 1.5 * iqr # Нижняя граница\n",
" upper_bound = q3 + 1.5 * iqr # Верхняя граница\n",
"\n",
" # Подсчитываем количество выбросов\n",
" outliers = df[(df[column] < lower_bound) | (df[column] > upper_bound)]\n",
" outlier_count = outliers.shape[0]\n",
"\n",
" # Устраняем выбросы: заменяем значения ниже нижней границы на саму нижнюю границу, а выше верхней — на верхнюю\n",
" df[column] = df[column].apply(lambda x: lower_bound if x < lower_bound else upper_bound if x > upper_bound else x)\n",
"\n",
" print(f\"Колонка {column}:\")\n",
" print(f\" Есть выбросы: {'Да' if outlier_count > 0 else 'Нет'}\")\n",
" print(f\" Количество выбросов: {outlier_count}\")\n",
" print(f\" Минимальное значение: {df[column].min()}\")\n",
" print(f\" Максимальное значение: {df[column].max()}\")\n",
" print(f\" 1-й квартиль (Q1): {q1}\")\n",
" print(f\" 3-й квартиль (Q3): {q3}\\n\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Постараемся выявить зависимости Outcome от остальных колонок:"
]
},
{
"cell_type": "code",
2024-10-11 18:46:40 +04:00
"execution_count": 5,
2024-10-11 18:41:52 +04:00
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAq4AAAIjCAYAAADC0ZkAAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAABbhElEQVR4nO3de5zMZf/H8ffM7uyuZXeVdcyyIoTix5YbCSUb24G7UhFL7iSHVG5F3UISkm6VQgd0EqW4lfMxxxxDBzllnU9Ldqy1u7M7398f2w5j9ryzO/ut1/Px2Ifm+l7zvT4zs/Kea67vNRbDMAwBAAAAJZzV1wUAAAAAeUFwBQAAgCkQXAEAAGAKBFcAAACYAsEVAAAApkBwBQAAgCkQXAEAAGAKBFcAAACYAsEVAAAApkBwBQAUyOrVq2WxWLR69WpflwLgb4LgCuTTlClTFB0drYoVK8pms6lSpUpq1aqVPvnkEzmdTl+XhwLq0aOHLBaL6yc0NFQNGzbUhAkTlJKS4uvy4AOHDx9Wnz59FBkZqcDAQFWoUEEdO3bU+vXrC3Xe9957TzNmzPBOkcDfjMUwDMPXRQBm0qxZM1WuXFl33HGHQkNDdf78ef3www+aNWuWHn74YX3xxRe+LhEF0KNHD82aNUsffvihJOn8+fP6+uuvtXr1aj388MOaNWuWjysseZxOp1JTUxUQECCr9a81D7J+/Xp16NBBkvSvf/1L9erV08mTJzVjxgwdOHBAb731lgYMGFCgczdo0EDh4eHMVAMFQHAF8snhcMhms3m0DxgwQJMmTdLBgwcVGRlZ/IWhUHr06KE5c+YoMTHR1eZ0OtW0aVNt3bpVx44dU5UqVTzuZxiGkpOTVapUqeIsF0Xojz/+UL169WQYhtavX6+aNWu6jl26dEnR0dFav3691q5dq+bNm+f7/ARXoOD+Wm+RgWKQVWiV5AqrV848/e9//1NMTIyqVKmiwMBA1axZU6NGjVJ6errbfVu3bu32MXV4eLhiYmL0888/u/WzWCwaMWKEW9v48eNlsVjUunVrt/bk5GSNGDFCtWvXVlBQkCpXrqx//vOfOnDggCQpLi5OFovF4yPLfv36yWKxqEePHq62GTNmyGKxKCAgQGfOnHHrv3HjRlfdW7dudTv21VdfqUmTJipVqpTCw8P12GOP6dixYx7P3W+//abOnTurfPnyKlWqlOrUqaOXXnpJkjRixAi35yarn8wA0Lp1azVo0MDj/AVltVpdz2tcXJykjNf5nnvu0ZIlSxQVFaVSpUpp6tSpkjJmaZ955hlFREQoMDBQtWrV0rhx4zyWkJw9e1bdunVTaGioypYtq9jYWO3cudPj9ejRo4fKlCmjY8eOqWPHjipTpozKly+vf//73x6/Q2+88YaaN2+ucuXKqVSpUmrSpInmzJnj8ZgsFov69++vefPmqUGDBgoMDFT9+vW1ePFij77Hjh1Tr169XL+/NWrU0FNPPaXU1FRJ2a9x3bRpk+6++26FhYUpODhYrVq18vh4/cKFC3rmmWfcPoa/6667tH379lxflx9//FHt27dXaGioypQpozvvvFM//PCD63jm72tOPzl9VD916lSdPHlS48ePdwutklSqVCl9/PHHslgseuWVV1ztmb+nV8us5crfn19++UXff/+9q5Yr/+6eP39ezz77rOt5qVq1qrp37674+HhXn9OnT6tXr16qWLGigoKC1LBhQ3388cdu42b+/X7jjTf07rvv6vrrr1dwcLDatWunI0eOyDAMjRo1SlWrVlWpUqV0//3369y5cx71L1q0SC1btlTp0qUVEhKimJgY/fLLL9k+d0BR8/d1AYBZnT9/Xmlpabpw4YK2bdumN954Q4888oiqVavm6jNjxgyVKVNGzz33nMqUKaOVK1fq5Zdflt1u1/jx493OV7duXb300ksyDEMHDhzQm2++qQ4dOujw4cM51jBmzBiP9vT0dN1zzz1asWKFHnnkEQ0cOFAXLlzQsmXL9PPPP3v8Y5xp//79+uCDD7Idz8/PT5999pmeffZZV9v06dMVFBSk5ORkt74zZsxQz549dcstt2jMmDE6deqU3nrrLa1fv14//vijypYtK0natWuXWrZsKZvNpt69eysyMlIHDhzQt99+q9GjR+uf//ynatWq5Trvs88+qxtvvFG9e/d2td14443Z1lxYmUG/XLlyrrY9e/bo0Ucf1ZNPPqknnnhCderUUVJSklq1aqVjx47pySefVLVq1bRhwwYNHTpUJ06c0MSJEyVlzOLee++92rx5s5566inVrVtX//vf/xQbG5vl+Onp6YqOjlbTpk31xhtvaPny5ZowYYJq1qypp556ytXvrbfe0n333aeuXbsqNTVVs2bN0kMPPaTvvvtOMTExbudct26dvvnmG/Xt21chISF6++239cADD+jw4cOux3n8+HHdeuutOn/+vHr37q26devq2LFjmjNnjpKSkhQQEJBlvStXrlT79u3VpEkTDR8+XFarVdOnT9cdd9yhtWvX6tZbb5Uk9enTR3PmzFH//v1Vr149nT17VuvWrdPu3bvVuHHjbF+PX375RS1btlRoaKief/552Ww2TZ06Va1bt9b333+vpk2b6vbbb9enn37qus/o0aMlyfVmSFKOM6XffvutgoKC1Llz5yyP16hRQ7fddptWrlypS5cu5Wu2feLEiRowYIDKlCnjqqdixYqSpMTERLVs2VK7d+/W448/rsaNGys+Pl7z58/X0aNHFR4erkuXLql169bav3+/+vfvrxo1auirr75Sjx49dP78eQ0cONBtvM8//1ypqakaMGCAzp07p9dff12dO3fWHXfcodWrV+uFF17Q/v379c477+jf//63pk2b5rrv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9Pjjj7vNVOdUZ27S09MVHx+v+Ph410faeXXx4kWVL19e5cuXV61atfTiiy+qWbNmmjt3rlu
"text/plain": [
"<Figure size 800x600 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAArcAAAIjCAYAAAAZajMiAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAACEs0lEQVR4nOzdeXwU9f0/8NfM3tkj900g4Si3IOARQQG5BLy1SqWKiqIVvLBa0Xrg8aOoVaqiaGtBq9ajHlW/iCCiKCByCBbklgACSci52c3eM78/NllZcg1hd2aJr+fjwQN25p2d925i+8pnP/P5CLIsyyAiIiIi6gBErRsgIiIiIooVhlsiIiIi6jAYbomIiIiow2C4JSIiIqIOg+GWiIiIiDoMhlsiIiIi6jAYbomIiIiow2C4JSIiIqIOg+GWiIiIiDoMhlsiopPAiBEjMGLECK3bICJKeAy3RAlswYIFGDduHLKzs2EwGJCTk4Phw4fjtddegyRJWrdHJ+jrr7/GFVdcgfz8fBiNRiQnJ+OMM87AI488grKyMq3b6/DcbjceffRRnHLKKUhKSkJycjLOPvtsvPbaaziRnekXL16Mhx9+OHaNEtFxEeQT+S+YiOKquLgYubm5OPfcc+FwOFBTU4Nvv/0Wb731Fq688kr8+9//1rpFaqcHH3wQjz76KLp27YpJkyaha9eu8Hq92LBhA9577z1kZGRgz549kfrGUdsvv/xSm4Y7mLKyMowaNQrbtm3DpEmTMHz4cHi9Xrz33ntYuXIlrrzySrzxxhvQ6XTH/dwzZszA/PnzTyggE1H76bVugIhatnLlShgMhqhjt912G9LT0/H8889jzpw5KCws1KY5are3334bjz76KK644gr861//gtFojDr/zDPP4JlnntGou1+HKVOmYNu2bfjggw9w4YUXRo7fdtttuPvuu/HUU0/h1FNPxZ/+9CcNuySi9uC0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6HnUmrZsmU4//zzkZubi9tvvx05OTnYtm0bPvnkE9x+++0AgM8//xzjx49H165d8fDDD8Pj8eC5557D0KFDsXHjxsgvVDfffDP+85//YMaMGejTpw8qKyvxzTffYNu2bRg0aBCAcEgeP348Bg8ejIceegiiKGLhwoU499xz8fXXX+P0009vsVePx4MRI0Zg9+7dmDFjBoqKivDuu+/i2muvRU1NDW6//XZkZmbiX//6V+Rr3n//fXzwwQdRx1r6uQOAjz/+GABwzTXXNHter9fjqquuwuzZs7Fq1SqMHj1a2RsN4KabbsKhQ4ewbNmyqH4aTZ06FYsWLcL48eNxww03IBgM4uuvv8a3336LIUOGAABuuOEGvPrqq7j88stx1113Ye3atZgzZ05kpPlou3fvxlVXXYWbbroJv//97/HUU0/hggsuwIIFC3DffffhlltuARAO7FdccQV27NgR+aV469atGDp0KPLz83HvvffCarXinXfewcUXX4z33nsPl1xyieLXTZRQZCJKeD179pQBRP5cc801ciAQiKqpr69v8nU33XSTnJSUJHu93six4cOHy8OHD4+qu++++2QAcnl5eeQYAPmhhx6KPL7nnnvkrKwsefDgwVFf/89//lMGID/99NNNri9JkizLsrx3714ZgLxw4cLIuSuuuELu16+fXFBQIE+ZMiVyfOHChTIA+Xe/+53cv3//yHG32y07HA75qquukgHI69atk2VZlv1+v5yVlSX369dP9ng8kfpPPvlEBiA/+OCDkWPnnHOObLfb5X379jXb57G6dOkS1dvRhg8fLvft27fZc63573//KwOQ582b16SHI0eORP05+nt87Pet8X3au3dv1POsWLFCBiCvWLFClmVZDgaDclFRkdylSxe5urq6yTUbDRw4UM7KypIrKysjxzZv3iyLoihfc801kWPJycny9OnTW3x9kiTJPXr0kMeNGxf1/PX19XJRUZE8ZsyYFr9WlmV53rx5MgD59ddfjxzz+/1ycXGxbLPZZKfT2eRrHnroIfl4/u/s4osvlgE0eT+O9v7778sA5GeffVaW5abva6PmfranT5/ebD9ffPGFDEC+7bbbmpxrfK82bdokA5BvuOGGqPN//OMfZQDyF198ETnWpUsXGYC8evXqyLHPPvtMBiBbLJaon/OXXnqpSf+jRo2S+/fvH/W/D5IkyWeddZbco0ePFt8bokTHaQlEJ4GFCxdi2bJleOONNzB16lS88cYbUaOJAGCxWCL/rqurQ0VFBc4++2zU19dj+/btUbWBQAAVFRU4cuQI1qxZgw8++ACnnHIKMjIymr3+wYMH8dxzz+GBBx5oMtrYePPTrbfe2uTrjv449mgbNmzAu+++izlz5kRNrTja1Vdfje3bt0c+rn3vvfeQnJyMUaNGRdWtX78e5eXluOWWW2A2myPHJ06ciF69euH//u//AABHjhzBypUrcf3110eNeLfWZ1tCoRAqKipQUVEBv9+v6GucTicANHkfa2trkZmZGfVn06ZN7erraN9//z327t2LO+64IzKC3ajxdR8+fBibNm3Ctddei7S0tMj5U045BWPGjMHixYsjx1JSUrB27VocOnSo2ett2rQJu3btwlVXXYXKysrI++N2uzFq1CisXLmy1ZU+Fi9ejJycHPzud7+LHDMYDLjtttvgcrnw1VdftedtiFJXVwcAsNvtLdY0nmv8fsXCe++9B0EQ8NBDDzU51/i9aHyvZ86cGXX+rrvuAoDIz3OjPn36oLi4OPL4jDPOAACce+65UT/njcd/+uknAEBVVRW++OILXHHFFZH/vaioqEBlZSXGjRuHXbt2NTuth+hkwHBLdBIoLi7G6NGjcdVVV+Ef//gHHnnkESxcuDBqDuPWrVtxySWXIDk5GQ6HA5mZmfj9738PIBycjrZ69WpkZmYiKysLZ511FoLBIN59990WQ95DDz2EvLw83HTTTU3O7dmzBz179oR
"text/plain": [
"<Figure size 800x600 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAArcAAAIjCAYAAAAZajMiAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAACHEElEQVR4nOzdd3hUVf4G8PdOn7RJAukEEmroCAgEkCIlC9ixYKOIosLasMGigooC9p+KIoqI3VUWVlc6oghEEBCUTkJCgJAESJmU6XN/fwwZGJJJJmFy7yS+n+fJI3PumXu/M0l235w59xxBFEURRERERERNgELuAoiIiIiI/IXhloiIiIiaDIZbIiIiImoyGG6JiIiIqMlguCUiIiKiJoPhloiIiIiaDIZbIiIiImoyGG6JiIiIqMlguCUiIiKiJoPhloioHn7++WcIgoCff/5Z8mvPmTMHgiBIfl0iosaA4ZaoHhYtWoS0tDTExMRArVYjNjYWgwcPxqeffgqn0yl3eVRPEydOhCAI7i+VSoXExESMGzcOBw4ckLu8GiUlJXnUHh0djauuugorVqyQu7S/vXPnzuHJJ59Ehw4doNPpEBkZibS0NPzvf/+7rPN++eWXeOutt/xTJFETopK7AKLGaNmyZYiLi8Ozzz6LsLAwFBcX47fffsPEiROxevVqfPXVV3KXSPWk1Wrx0UcfAQDsdjsyMzOxaNEirFmzBgcOHEB8fLzMFXrXo0cPPP744wCA3NxcfPDBB7jpppvw/vvv44EHHpC5ur+nw4cPY9iwYThz5gwmTZqE3r17o7i4GF988QWuvfZaPPHEE3j11Vfrde4vv/wS+/btw6OPPurfookaOYZbonrYvHkz1Gq1R9vDDz+MZs2a4d1338W8efOQlJQkT3F0WVQqFe666y6Ptn79+uGaa67Bjz/+iPvuu0+mymqXkJDgUfv48ePRtm1bvPnmm17Drd1uh9PphEajkarMy1ZeXo7g4GC5y6iVzWbDzTffjKKiImzevBl9+/Z1H3vsscdw55134rXXXkPv3r1x2223yVgpUdPCaQlE9XBpsK1UGWgVigu/Wv/9738xZswYxMfHQ6vVok2bNnjxxRfhcDg8njtkyBCPj5WbN2+OMWPGYN++fR79BEHAnDlzPNpeffVVCIKAIUOGeLSbzWbMmTMH7du3h06nQ1xcHG666SZkZmYCALKzsyEIAj755BOP502bNg2CIGDixInutk8++QSCIECj0eDMmTMe/dPT091179y50+PYt99+i169ekGv16N58+a46667cOrUqSrv3aFDh3DrrbciKioKer0eHTp0wKxZswBcmGNa01fl3NchQ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bu3Indu3djxIgRAICxY8di//79eOihh5CUlISCggKsX78eOTk59f5EY+rUqYiKisJzzz2H8vJyAMBnn32GCRMmIC0tDQsWLEBFRQXef/99DBw4EH/88UeN18rPz0f//v1RUVHh/tRl2bJluO666/Ddd9/hxhtvRMeOHfHZZ5+5n7N48WIcPHgQb775prutW7duXq/xww8/AHCNoFfHYDDg+uuvx7Jly5CRkeHxM16bWbNmoaSkBCdPnnTXExISAsC3331RFHHddddh06ZNmDx5Mnr06IG1a9fiySefxKlTpzxeIwD8+uuv+P777zFt2jQAwLx583DNNdfgqaeewnvvvYepU6eiqKgIr7zyCu655x789NNP7uf+9NNPGDVqFHr16oXZs2dDoVBg6dKluPrqq/Hrr7+iT58+Pr9uIp+IRFRvHTp0EAG4v8aPHy/abDaPPhUVFVWed//994tBQUGi2Wx2tw0ePFgcPHiwR79//etfIgCxoKDA3QZAnD17tvvxU089JUZHR4u9evXyeP7HH38sAhDfeOONKtd3Op2iKIpiVlaWCEBcunSp+9itt94qdunSRUxMTBQnTJjgbl+6dKkIQLz99tvFrl27utvLy8vFsLAw8Y477hABiL///rsoiqJotVrF6OhosUuXLqLJZHL3/9///icCEJ977jl326BBg8TQ0FDx+PHj1dZ5qVatWnnUdrHBgweLnTt3rvZYbSZMmODx/az8SkhIEHft2uXRd9OmTSIAcdOmTaIo1u319ujRQ4yOjhbPnTvnbtu7d6+oUCjE8ePHu9tuuOEGUafTebwvBw4cEJVKpXjp/3y3atVKHDlypHjmzBnxzJkz4t69e8Vx48aJAMSHHnpIFMUL3++wsDCPnylRFMVhw4aJXbt29fiZdDqdYv/+/cV27dq527p37y6OGTPG63tYVFQkAhBfffVVr31EserP8cWvo7qfu4EDB4p2u93dXlpaKoaHh4v33Xefx/Pz8vJEg8FQpf1Sjz76qAhA/PXXXz3OmZycLCYlJYkOh6PKcyZMmCC2atWqxvNerEePHqLBYKixzxtvvCECEL///ntRFC+83qysLI9+l/68iaIojhkzptp6fPndX7lypQhAnDt3rsfxm2++WRQEQczIyHC3ARC1Wq1HTR988IEIQIyNjRWNRqO7febMmR71O51OsV27dmJaWprH73NFRYWYnJwsjhgxosb3h6g+OC2B6DIsXboU69evxxdffIHJkyfjiy++8BhNBAC9Xu/+d2lpKc6ePYurrroKFRUVOHTokEdfm82Gs2fP4syZM0hPT8eKFSvQrVs3NG/evNrrnzp1Cu+88w6effZZ96hNpeXLl6N58+Z46KGHqjzP2zJSu3btwrfffot58+Z5TK242N13341Dhw65px8sX74cBoMBw4YN8+i3c+dOFBQUYOrUqdDpdO72MWPGICUlxf3x75kzZ7B582bcc889HiPeNdVZG4fDgbNnz+Ls2bOwWq11eq5Op8P69euxfv16rF27Fh988AFCQkIwevRoHDlyxOvzfH29p0+fxp49ezBx4kRERka6+3Xr1g0jRozAqlWr3K9h7dq1uOGGGzzel44dOyI
"text/plain": [
"<Figure size 800x600 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAq4AAAIjCAYAAADC0ZkAAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAAB20UlEQVR4nO3dd3hUVf4G8PdOn7RJI5VAIr0pAoKhiCWQRVZBUSwoiCi6siiirqBLU/lFxbYqgiDFhgVdWVFKAEEBA1JEOhIkgIEkhJRJmT7n90fIwJA2SSZzM/h+nicPzrln7v1mJuCbM+ecKwkhBIiIiIiImjmF3AUQEREREXmCwZWIiIiI/AKDKxERERH5BQZXIiIiIvILDK5ERERE5BcYXImIiIjILzC4EhEREZFfYHAlIiIiIr/A4EpEREREfoHBlYjoIps2bYIkSfjqq69q7bd06VJIkoSsrKwmqyUrKwuSJOG1116rs+/MmTMhSVK9r5GYmIi///3vDSmPiMjnGFyJLjF//nykpqYiOjoaarUaMTExGDhwID766CM4nU65y6NGWLlyJQYOHIioq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jx6NixI7Kzs/HVV1+hvLwcGo0Gubm56Nu3L8rLy12fFn344Ye49dZb8dVXX1WZvpCWlga9Xo8pU6YgMzMT77zzDtRqNRQKBQoLCzFz5kxs27YNS5cuRVJSEqZPn+567uzZszFt2jSMHDkSDz30EM6ePYt33nkH1113ndu/A0ReI4ioWh06dBAAXF+jR48WNpvNrU95eXmV5z3yyCMiICBAmM1mV9vAgQPFwIED3fo999xzAoDIy8tztQEQM2bMcD3+17/+JaKiokTPnj3dnr948WIBQLzxxhtVru90OoUQQhw/flwAEEuWLHEdGzlypOjatatISEgQY8aMcbUvWbJEABD33HOP6Natm6u9rKxMhISEiHvvvVcAEDt27BBCCGG1WkVUVJTo2rWrMJlMrv7fffedACCmT5/uarvuuutEcHCwOHHiRLV1Xqp169ZutV1s4MCBokuXLtUeq8v06dMFABEYGCiGDBkiZs+eLXbt2lWl38aNGwUAsXz5clFSUiIGDhwoIiMjxa+//urWr/I1O378uFvtAMRPP/3kasvLyxNarVY89dRT1dY1Z86cKuepVPkeRkREiIKCAlf7//73PwFArFy50tU2Y8YMcfE/6UePHhUKhULcdtttwuFwuJ334te+devWYujQoUIIIf7zn/8ISZLEiy++2OA6brrpJtGtWze3n3+n0yn69u0r2rVr52q76qqrXNetTmFhoQAg5syZU2OfmnTv3l1ERUWJc+fOudp+++03oVAoxOjRo6t9Tm0/d5cqKioSAMSwYcNq7XfrrbcKAMJoNAohhBgzZoxo3bp1lX6XvndCCBEYGFhtPaNHjxYKhcL1d/File/rpEmTBACxefNm17GSkhKRlJQkEhMTXT8PlT/rXbt2FVar1dX3nnvuEZIkiSFDhridPzk52a3+rKwsoVQqxezZs9367du3T6hUqirtRN7AqQJENViyZAnWrVuHTz/9FOPGjcOnn37qNhoDAHq93vXfJSUlyM/Px4ABA1BeXo7Dhw+79bXZbMjPz8fZs2eRkZGBb775BldeeaXbgpyLZWdn45133sG0adMQFBTkduzrr79GZGQkJk6cWOV5NS0U2rVrF5YvX460tDS36Q4Xu//++3H48GHXlICvv/4aBoMBN910k1u/nTt3Ii8vD4899pjbYqChQ4eiY8eOrlGms2fP4qeffsKDDz7oNlJdW511cTgcyM/PR35+vttHo3WZNWsWli1bhquvvhpr167F888/j549e6JHjx5uHyFXKi4uxuD
"text/plain": [
"<Figure size 800x600 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAArcAAAIjCAYAAAAZajMiAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAACLbElEQVR4nOzde5ycZX3//9d933Oe2fMxWTbZkAAhJJxP4SyHBERaBVpRixBRWwytQKsVUSRov7FqxVo51CqgVWof1lp/IpCEgyAQTkEOiQSyIUtCsufzzM7pPvz+mN0le0iyhM3MJHk/H488NnPPtTOfnQz6nmuv63MZnud5iIiIiIgcAMxCFyAiIiIiMl0UbkVERETkgKFwKyIiIiIHDIVbERERETlgKNyKiIiIyAFD4VZEREREDhgKtyIiIiJywFC4FREREZEDhsKtiIiIiBwwFG5FRGQCwzC49dZbR2/fd999GIZBS0tLwWoSEZkKhVuR/dDdd9/N0qVLqaurw+/3U19fz9lnn81Pf/pTXNctdHmyl66++mpisVihyzjgZLNZvv/973PSSSdRUlJCLBbjpJNO4vvf/z7ZbHavH/eZZ57h1ltvpa+vb/qKFZH3TeFWZD/0k5/8hGg0yle/+lV+/OMf8+Uvf5mGhgauvvpqPvGJTxS6PDkAXXnllSSTSWbPnl3oUt6TRCLBBRdcwOc//3nq6+v55je/ybe//W1mzpzJ5z//eS644AISicRePfYzzzzDihUrFG5Fioyv0AWIyHv35JNP4vf7x1z7u7/7O6qqqvjBD37AypUraWpqKkxxckCyLAvLsgpdxnt244038sQTT/Bv//ZvXHfddaPXr732Wu644w6uu+46/uEf/oG77rqrgFWKyHTSzK3Ifmh8sB0xEmhN893/tH/zm99w8cUXM3PmTILBIHPnzuXrX/86juOM+d5zzjkHwzBG/1RXV3PxxRezfv36MePGr8UE+Pa3v41hGJxzzjljrqdSKW699VYOP/xwQqEQM2bM4NJLL2Xz5s0AtLS0YBgG991335jvW758OYZhcPXVV49eG1nzGQgE6OzsHDN+7dq1o3W/+OKLY+775S9/yQknnEA4HKa6upq/+qu/Yvv27RNeu40bN/KXf/mX1NTUEA6HOeKII7j55psBuPXWW8e8NpP9+f3vfz/6Oi5cuHDC4++tpqYmPvShD/HUU09x8sknEwqFOPTQQ/npT386Zlw2m2XFihUcdthhhEIhqqqqOOOMM1izZs3omHPOOWfCvxHklkPs6cPQZGtup1rbriQSCf7+7/+exsZGgsEgRxxxBN/5znfwPG90zJ5e98l+nhHvvPMOP/7xjzn33HPHBNsRy5cv5wMf+AA/+tGPeOedd4BdvydHahl5799666184QtfAGDOnDmj9ez8+vzsZz/j5JNPJhKJUFFRwVlnncXq1avHPOadd97JUUcdRTAYZObMmSxfvnzCTPDIe+rVV1/l7LPPJhKJMG/ePP7nf/4HgCeeeIJTTjll9H37yCOPTKh9+/btfOpTn6Kuro5gMMhRRx3FPffcs8vXTmR/pplbkf1YX18ftm0zODjIunXr+M53vsMVV1zBrFmzRsfcd999xGIxbrzxRmKxGI899hi33HILAwMDfPvb3x7zePPnz+fmm2/G8zw2b97Md7/7XT74wQ+ydevW3dawcuXKCdcdx+FDH/oQjz76KFdccQWf//znGRwcZM2aNaxfv565c+dO+njNzc38x3/8xy6fz7Isfvazn3HDDTeMXrv33nsJhUKkUqkxY++77z6WLVvGSSedxMqVK2lvb+df//Vfefrpp/njH/9IeXk5AK+++ipnnnkmfr+fz372szQ1NbF582Z++9vf8k//9E9ceumlzJs3b/Rxb7jhBo488kg++9nPjl478sgjd1nz+9Xc3Mzll1/ONddcw1VXXcU999zD1VdfzQknnMBRRx0F5MLWypUr+fSnP83JJ5/MwMAAL774Ii+99BIXXHBBQWubjOd5/Nmf/RmPP/4411xzDcceeyyrVq3iC1/4Atu3b+f2228H4D//8z9Hv+cPf/gDP/zhD7n99tuprq4GoK6ubpfP8dBDD+E4Dp/85Cd3OeaTn/wkjz/+OA8//DCf/vSnp/xzX3rppbz55pv813/915h6ampqAFixYgW33norp512GrfddhuBQIDnnnuOxx57jCVLlgC5f7MVK1Zw/vnnc+211/LGG29w11138cILL/D000+P+RDb29vLhz70Ia644gr+4i/+grvuuosrrriCn//851x//fX8zd/8DR//+Mf59re/zeWXX862bdsoKSkBoL29nVNPPRXDMLjuuuuoqanhoYce4pprrmFgYIDrr79+yj+3yH7BE5H91hFHHOEBo38++clPetlsdsyYoaGhCd/313/9114kEvFSqdTotbPPPts7++yzx4z78pe/7AFeR0fH6DXA+9rXvjZ6+4tf/KJXW1vrnXDCCWO+/5577vEA77vf/e6E53dd1/M8z9uyZYsHePfee+/ofX/5l3/pLVy40GtsbPSuuuqq0ev33nuvB3gf+9jHvEWLFo1eTyQSXmlpqffxj3/cA7wXXnjB8zzPy2QyXm1trbdw4UIvmUyOjn/ggQc8wLvllltGr5111lleSUmJ9/bbb09a53izZ88eU9vOzj77bO+oo46a9L49ueqqq7xoNDrhuQDvySefHL3W0dHhBYNB7+///u9Hrx1zzDHexRdfvNvHn+zfeOR5Z8+ePeba+H/nkdd/y5Yt77m2yfzf//2fB3jf+MY3xly//PLLPcMwvObm5gnfM1kNu3P99dd7gPfHP/5xl2NeeuklD/BuvPFGz/Mmf0+OGP+afPvb3560nk2bNnmmaXof+chHPMdxxtw38p7q6OjwAoGAt2TJkjFjfvCDH3iAd88994xeO/vssz3Au//++0evbdy40QM80zS9Z599dvT6qlWrJtR/zTXXeDNmzPC6urrG1HLFFVd4ZWVlk/5vhMj+TMsSRPZj9957L2vWrOHnP/8511xzDT//+c/HzCYChMPh0b8PDg7S1dXFmWeeydDQEBs3bhwzNpvN0tXVRWdnJ2vXruXXv/41Rx999Ois1Hjbt2/n3/7t3/jqV786YZf/r371K6qrq/nbv/3bCd9nGMakj7du3Tp++ctfsnLlyjFLK3Z25ZVXsnHjxtHlB7/61a8oKyvjvPPOGzPuxRdfpKOjg8997nOEQqHR6xdffDHz58/nd7/7HQCdnZ08+eSTfOpTnxoz4727OvfEcRy6urro6uoik8ns1WPsbMGCBZx55pmjt2tqajjiiCN46623Rq+Vl5ezYcMGNm3a9L6fb7prm8yDDz6IZVn83d/93Zjrf//3f4/neTz00EPvu7bBwUGA0RnMyYzcNzAw8L6fb8T//d//4bout9xyy4T38ch76pFHHiGTyXD99dePGfOZz3yG0tLS0ffniFgsxhVXXDF6+4gjjqC8vJwjjzySU045ZfT6yN9HXn/P8/jVr37FJZdcgud5o+/Lrq4uli5dSn9/Py+99NK0/ewixUDhVmQ/tnjxYs4//3w+/vGP86Mf/YjbbruNe++9l6effnp0zIYNG/jIRz5CWVkZpaWl1NTU8Fd/9VcA9Pf3j3m8Z555hpqaGmpraznttNOwbZtf/vKXuwx5X/va15g5cyZ//dd/PeG+zZs3c8QRR+DzTX3105e+9CXOPPNMPvShD+1yTE1NDRdffPHoesF77rmHq666akKIePvtt4FcCBhv/vz5o/ePhIDpXCe7ceNGampqxqzfvf/++/f68caHboCKigp6e3tHb99222309fVx+OGHs2jRIr7whS/w6quv7vVzTmdtk3n77beZOXPmhOA5srxj5N/n/Rh57JGQO5mpBOD3avPmzZimyYIFC3Y5Zlfvz0AgwKGHHjrh5z/kkEMm/HdYVlZGY2PjhGvA6Ovf2dlJX18fP/zhD0ffkyN/li1bBkBHR8de/JQixUvhVuQAcvnllwPw3HPPAbn1sGeffTavvPIKt912G7/97W9Zs2YN//zP/wwwoSfu0Uc
"text/plain": [
"<Figure size 800x600 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAq4AAAIjCAYAAADC0ZkAAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZA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QIMGzYMFosFOTk5+PnPf47Dhw+3eO22b9+Oq6++Grm5ubBYLOjXrx8efvhhAMBjjz0W9dq09rV8+fLI63j8R/OxKigoAIBWg9vll18Ok8mEBQsWRB2fP38+rr766qggeDJefPFFDBw4ECaTCUVFRZg6dSrq6uoi54//d9PaV3tmzJiBzMxM/PWvf23R61lnnYUHH3wQmzdvxjvvvBM5XlJSEvVv49hemv8NLl++HGeeeSYA4Kabbor0cuy/ta+++goXX3wxMjMzYbVaMXjwYDz//PNRz/npp5/ivPPOg9VqRUZGBi6//HJs27Ytqqb538f333+Pn//850hPT0dubi4eeeQRCCFw8OBBXH755XA4HCgoKMAzzzzTonefz4fp06ejd+/eMJlMKC4uxgMPPACfz9fu60f0Y8BfWYlOEXV1dQgGg3A6nVi/fj3+7//+Dz/72c/QrVu3SM28efNgs9lw7733wmaz4dNPP8Wjjz6KhoYG/OlPf4p6vv79++Phhx+GEAK7d+/Gn//8Z1x88cU4cOBAuz3MnDmzxfFQKIRLLrkEy5Ytw89+9jPcddddcDqdWLJkCbZs2YJevXq1+ny7du3C3/72tzavp9Pp8MYbb+Cee+6JHJs7dy7MZjO8Xm9U7bx583DTTTfhzDPPxMyZM1FRUYHnn38eX3zxBb755htkZGQAADZt2oTzzjsPBoMBt9xyC0pKSrB792588MEHePLJJ3HllVeid+/ekee95557MGDAANxyyy2RYwMGDGiz5xNVVVUFIPwa7tmzBw8++CCys7NbnZealpaGyy+/HG+99RZuu+02AMC3336L7777Dq+88go2bdp00n089thjmDFjBsaOHYvbbrsNO3bswJw5c7B27Vp88cUXMBgMePjhh/GrX/0q0vc999yDW265Beedd16Hz79z507s2LEDN954IxwOR6s1N9xwA6ZPn44PP/wQP/vZz1T3PmDAAPzhD3/Ao48+GtXPOeecAwBYsmQJLrnkEhQWFuKuu+5CQUEBtm3bhg8//BB33XUXAGDp0qWYOHEievbsicceewwejwd/+ctfMHLkSGzYsKHFpxrXXHMNBgwYgKeeegofffQRnnjiCWRlZeHll1/GhRde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sXd999d2TUvVnze15WVoaNGzfixhtvRFZWVuT84MGDMW7cOHz88cctnrd55BkIfzIwfPhwCCFw8803R45nZGSgX79+2LNnT+TYggULMGDAAPTv3z/y76aqqgoXXnghAOCzzz6Ly89NlKo4VYDoFFFaWhr5+3XXXYeePXvi4Ycfxs0334yRI0cCAL777jv87//+Lz799NMW//Gvr6+Pevzll18iNzc38rhPnz54//332wxw06dPR1FREX7zm99EzUEEgN27d6Nfv34ndEPN7373O5x33nm45JJLcMcdd7Rak5ubi0mTJuG1117D8OHD8dprr2HKlCktgu7+/fsBoNW70fv3749Vq1YBQCRAxHNe6vbt2yOvoyzL6N27N6ZPn47rrruuw+/V6XQYO3Zs1LGLL74Yffr0wUMPPYR///vfLb7HYDDgqquuwvz583HWWWfh4MGDqq7VnrZeP6PRiJ49e0bOx6I5sDYH2LY4nU7k5eXFfL1mzXOs23vP2/v3M2DAACxatAhutxtWqzVy/PhffNLT02E2m1v84peenh61zNfOnTuxbdu2qP/
"text/plain": [
"<Figure size 800x600 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAArMAAAIjCAYAAAAQgZNYAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAACYoklEQVR4nOzdd3xUVfo/8M+9d3omk0IKSQgEAoqKCoIiAmJB+WJZ68+CX5qK2EvWxqog665YEdf1q7s2LKur62JHiihrQ12liUongIH0TDK93Ht+f0wyMGSSTMJkZoKf9+uFYe48M/dhJonPnPuccyQhhAARERERUQ8kJzsBIiIiIqKuYjFLRERERD0Wi1kiIiIi6rFYzBIRERFRj8ViloiIiIh6LBazRERERNRjsZglIiIioh6LxSwRERER9VgsZomIiIiox2IxS0QJccopp+CUU07p9OPKy8shSRIee+yx+Cd1CGh5fRYuXBg+dv/990OSpOQldQiL9noTUXKxmKVu9eyzz2LChAnIz8+HXq9H7969MW7cOLzyyivQNC3Z6VEXTZs2DZIkhf9YrVYMGDAAF198Mf7973+n/Hv7888/4/7770d5eXm3nueUU06JeJ2ys7Nx/PHH48UXX0z51ygRFi5cGPH67P/n7rvvTmpur7/+OhYsWJDUHJLpq6++wgUXXID8/HwYjUaUlJRg5syZ2LVrV5ef0+124/7778fKlSvjlygRAF2yE6BD28svv4yCggLcd999sNlssNvt+OabbzBt2jR8/PHHeOONN5KdInWR0WjE888/DwDweDzYuXMnPvjgA1x88cU45ZRT8N5778Fms4Xjly1blqxUW/n5558xd+5cnHLKKSgpKenWc/Xp0wfz5s0DANTU1OCVV17BVVddhc2bN+Ohhx7qlnPee++9SS8GO+OPf/wj+vfvH3FsyJAhScom5PXXX8eGDRtw6623Rhzv168fPB4P9Hp9chJLgKeeegq33HILBgwYgJtuugkFBQX45Zdf8Pzzz+PNN9/E4sWLcdJJJ3X6ed1uN+bOnQsAXbpKQ9QWFrPUrT7//PNWv/Rvvvlm9OrVC3/9618xb968bi8mqHvodDr87//+b8SxP/3pT3jooYcwa9YszJgxA2+++Wb4PoPBkOgUU0JGRkbE6zRz5kwcfvjh+Otf/4oHHnigW4oinU4HnS5+v95dLhfS0tLi9nwHmjhxIkaMGNFtzx9PkiTBZDIlO41u89VXX+HWW2/FmDFjsGTJElgslvB91113HUaPHo2LL74YP/30E7KyspKYKdE+bDOgbtXW/6hbClhZ3vct+N577+Hss89GYWEhjEYjSktL8cADD0BV1YjHHnjpNicnB2effTY2bNgQESdJEu6///6IY48++igkSWo1KuD1enH//ffjsMMOg8lkQkFBAS688EJs27YNQNt9cjfccAMkScK0adPCx1ounRoMBtTU1ETEr1q1Kpz3999/H3Hfv/71LwwfPhxmsxk5OTn43//9X1RUVLR67TZu3IhLLrkEubm5MJvNOPzww3HPPfcA2Ncr2d6flkt8p5xySreMft19990488wz8a9//QubN28OHz+wZ9bv92P27NkYPnw4MjIykJaWhrFjx+Kzzz5r87mfeOIJ9OvXD2azGePGjWv1ngOh1+fiiy9GdnY2TCYTRowYgffffz98/8KFC/H//t//AwCceuqprV4XAPj4448xduxYpKWlIT09HWeffTZ++umniPNUVlZi+vTp6NOnD4xGIwoKCnDeeed12LpgsVhw4oknwuVyhb8/7HY7br31VhQXF8NoNGLgwIF4+OGHW7Ui2O12TJs2DRkZGcjMzMTUqVNht9tbnSNaz6zH48HNN9+MnJwcpKen43e/+x0qKipa/Zy0PPbnn3/GpEmTkJWVhTFjxoTvf+2118Lfp9nZ2bjsssuwe/fuVjl8++23+J//+R9kZGTAYrFg3Lhx+Oqrr9p9baKJ9nMMhH6HRPu5++qrr1BWVobc3FykpaXhggsuaPVzCITe43HjxiE9PR02mw3HH388Xn/9dQCh79WPPvoIO3fuDH9/tPzOaut3waeffhr+nsnMzMR5552HX375JSKm5bXdunUrpk2bhszMTGRkZGD69Olwu90xvR4d/Z44sAUo2p/2vkcfeOABSJKEl19+OaKQBYDS0lI88sgj2Lt3L/72t7+Fj7fVDz9t2rSI1y03NxcAMHfu3HAu+7+37f1ua7FmzRpMnDgRNpsNVqsVp59+Or755puImJbvhS+//BI333wzcnNzkZmZiZkzZ8Lv98Nut2PKlCnIyspCVlYW7rzzTgghIp5D0zQsWLAARx11FEwmE/Lz8zFz5kw0NDS0+dpR8nBklhLCbrcjGAzC4XDghx9+wGOPPYbLLrsMffv2DccsXLgQVqsVZWVlsFqt+PTTTzF79mw0NTXh0UcfjXi+wYMH45577oEQAtu2bcP8+fNx1llntdvPZbfbw5d796eqKs455xysWLECl112GW655RY4HA4sX74cGzZsQGlpadTn27p1K5577rk2z6coCl577TXcdttt4WMvvfQSTCYTvF5vROzChQsxffp0HH/88Zg3bx6qqqrw5JNP4quvvsKaNWuQmZkJAFi/fj3Gjh0LvV6Pa665BiUlJdi2bRs++OAD/PnPf8aFF16IgQMHhp/3tttuwxFHHIFrrrkmfOyII45oM+d4mTx5MpYtW4bly5fjsMMOixrT1NSE559/HpdffjlmzJgBh8OBF154ARMmTMB3332HoUOHRsS/8sorcDgcuOGGG+D1evHkk0/itNNOw48//oj8/HwAwE8//YTRo0ejqKgId999N9LS0vDWW2/h/PPPx7///W9ccMEFOPnkk3HzzTfjL3/5C/7whz+EX4+Wr6+++iqmTp2KCRMm4OGHH4bb7cYzzzyDMWPGYM2aNeH/OV900UX46aefcNNNN6GkpATV1dVYvnw5du3a1eHVhu3bt0NRFGRmZsLtdmPcuHGoqKjAzJkz0bdvX3z99deYNWsW9u7dG+7bFELgvPPOw5dffolrr70WRxxxBN555x1MnTo1pvdk2rRpeOuttzB58mSceOKJ+M9//oOzzz67zfj/9//+HwYNGoQHH3ww/D/6P//5z7jvvvtwySWX4Oqrr0ZNTQ2eeuopnHzyyRHfp59++ikmTpyI4cOHY86cOZBlGS+99BJOO+00fPHFFzjhhBMiztXY2Ija2tqIYzk5OTH9uw500003ISsrC3PmzEF5eTkWLFiAG2+8MeIqwcKFC3HllVfiqKOOwqxZs5CZmYk1a9ZgyZIlmDRpEu655x40Njbi119/xRNPPAEAsFqtbZ7zk08+wcSJEzFgwADcf//98Hg8eOqppzB69GisXr261ffDJZdcgv79+2PevHlYvXo1nn/+eeTl5eHhhx9u998Wy++JmTNnYvz48eHHTJ48GRdccAEuvPDC8LGWovJAbrcbK1aswNixY1u1fbS49NJLcc011+DDDz/sVCtLbm4unnnmGVx33XUR+RxzzDEAOv7dBoR+vseOHQubzYY777wTer0ef/vb33DKKafgP//5D0aOHBlxzptuugm9e/fG3Llz8c033+Dvf/87MjMz8fXXX6Nv37548MEHsXjxYjz66KMYMmQIpkyZEn7szJkzw6/3zTffjB07duCvf/0r1qxZg6+++uqQbjPpkQRRAhx++OECQPjPlClTRCAQiIhxu92tHjdz5kxhsViE1+sNHxs3bpwYN25cRNwf/vAHAUBUV1eHjwEQc+bMCd++8847RV5enhg+fHjE41988UUBQMyfP7/V+TVNE0IIsWPHDgFAvPTSS+H7LrnkEjFkyBBRXFwspk6dGj7+0ksvCQDi8ssvF0cffXT4uMvlEjabTUyaNEkAEP/973+FEEL4/X6Rl5cnhgwZIjweTzj+ww8/FADE7Nmzw8dOPvlkkZ6eLnbu3Bk1zwP169cvIrf9jRs3Thx11FFR7+vI1KlTRVpaWpv3r1mzRgAQt912W8T59n/dg8Gg8Pl8EY9raGgQ+fn54sorrwwfa3ntzWa
"text/plain": [
"<Figure size 800x600 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAq4AAAIjCAYAAADC0ZkAAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAAB2M0lEQVR4nO3deXhTZd4+8PtkT5om3egGXZAdRB1AoawiSIfBXdxHUXB0FHEBHUVGcX3RQdTxh+LGrqgjDu4VENkpKCDDvlVKgW50TZs0+/n90TYampTUpDkJ3p/r4sI+59ucb1Ped+4+fc7zCKIoiiAiIiIiinAyqRsgIiIiIgoEgysRERERRQUGVyIiIiKKCgyuRERERBQVGFyJiIiIKCowuBIRERFRVGBwJSIiIqKowOBKRERERFGBwZWIiIiIogKDKxERERFFBQZXoij29ttvIzc3FykpKVAqlUhNTcWIESOwZMkSuN1uqdujELjxxhshCAIef/xxqVsJm8rKSjz22GPo0aMHNBoNEhISkJubi6+//jqo1122bBlef/310DRJRJIQRFEUpW6CiH6fnJwcpKWl4bLLLoPBYEBNTQ22bt2Kjz/+GDfddBM++ugjqVukIJhMJqSkpCA1NRUulwvHjx+HIAhSt9WuDh06hFGjRuH06dO46667MGDAANTU1ODDDz/Erl278Oijj2L27Nm/67WvuOIK7N27F4WFhaFtmojChsGVKIo5HA4olcoW41OmTMHcuXNx7NgxZGdnh78xComFCxfi3nvvxcqVK3HZZZdh3bp1GDFihNRttRuHw4F+/frhl19+wQ8//ICBAwd6rrlcLtx222345JNPPD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mDVrltdyh9+6/fbbcfDgQc+SgM8++wxGoxGjRo3yqtu+fTvKy8tx//33Q6PReMbHjRuHnj17en7Vffr0aWzYsAETJ070mqlurc+zcblcqKioQEVFBex2e5s+98MPP8S4ceMQGxsLAOjWrRv69+/fYrnAd999h5ycHFx00UWesYSEBNx2221edatXr0ZNTQ1uueUWT08VFRWQy+UYOHAg1q5d22o/3377LS655BIMHTrUM6bX63HPPfegsLAQ+/fvb9PX50tdXZ3n6/Wn+brJZAr6fs0C+Tf67bffQi6X48EHH/S6Pm3aNIiiiLy8PK/xUaNGec1gNy99uP76672+xubxX375BQCwa9cuHDlyBLfeeisqKys93yez2YxRo0Zhw4YN3DGE/tC4VIDoHJCTk+P571tvvRXnnXceZsyYgUmTJmHIkCEAgH379uGf//wnfvjhhxb/o19bW+v18ZYtW9ChQwfPx926dcPnn3/uN8DNnDkT6enpuPfee7F8+XKvawUFBejRowcUisD/380TTzyBYcOG4YorrsADDzzgs6ZDhw4YN24cFixYgAEDBmDBggWYMGFCi6B7/PhxAECPHj1avEbPnj2xadMmAL8Gh2DXpf7WwYMHPe+jTCZD165dMXPmTNx6662tft6BAwfw888/44477sDRo0c945deeinefPNNmEwmGAwGAI1f32+//83O/DX6kSNHAACXXXaZz3s2v54/x48fb7HuFPh1acTx48eDfu9iY2NRUVHRak1dXZ2nNlQC+Td6/PhxpKent7jvb7/+3zrzhx+j0QgAyMjI8DleXV0N4Nfv04QJE/z2Ultbi/j4eL/Xic5lDK5E56Dx48djxowZ2LZtG4YMGYKamhqMGDECBoMBzz33HLp06QKNRoOdO3fi8ccfbzGDc8EFF2DOnDkAGmci33jjDVx66aXYuXMnUlNTvWoPHDiARYsW4YMPPvD7sFhbrFq1Ct9
"text/plain": [
"<Figure size 800x600 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"import matplotlib.pyplot as plt\n",
" # Создание диаграмм зависимости\n",
"for column in numeric_columns:\n",
" plt.figure(figsize=(8, 6)) # Установка размера графика\n",
" if pd.api.types.is_numeric_dtype(df[column]): # Проверяем, является ли колонка числовой\n",
" # Проверяем, содержит ли колонка только два уникальных значения (0 и 1)\n",
" if df[column].nunique() == 2 and set(df[column].unique()).issubset({0, 1}):\n",
" # Если да, то строим столбчатую диаграмму\n",
" counts = df[column].value_counts() # Считаем количество повторений каждого значения\n",
" counts.plot(kind='bar') # Создаем столбчатую диаграмму\n",
" plt.title(f'Количество значений для {column}')\n",
" plt.xlabel(column)\n",
" plt.ylabel('Количество повторений')\n",
" else:\n",
" # Если колонка числовая, создаем диаграмму рассеяния\n",
" plt.scatter(df['Outcome'], df[column], alpha=0.5) # Создаем диаграмму рассеяния\n",
" plt.title(f'Зависимость {column} от Outcome')\n",
" plt.xlabel('Outcome (0 = нет, 1 = да)')\n",
" plt.ylabel(column)\n",
" plt.xticks([0, 1]) # Установка меток по оси X\n",
" plt.grid() # Добавление сетки для удобства восприятия\n",
" else:\n",
" # Если колонка не числовая, строим столбчатую диаграмму\n",
" counts = df[column].value_counts() # Считаем количество повторений каждого значения\n",
" counts.plot(kind='bar') # Создаем столбчатую диаграмму\n",
" plt.title(f'Количество значений для {column}')\n",
" plt.xlabel(column)\n",
" plt.ylabel('Количество повторений')\n",
"\n",
" plt.show() # Отображение графика"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Разобьем наш набор на выборки относительно параметра Outcome:"
]
},
{
"cell_type": "code",
2024-10-11 18:46:40 +04:00
"execution_count": 6,
2024-10-11 18:41:52 +04:00
"metadata": {},
"outputs": [],
"source": [
"# Функция для создания выборок\n",
"from sklearn.model_selection import train_test_split\n",
"\n",
"def split_stratified_into_train_val_test(\n",
" df_input,\n",
" stratify_colname=\"y\",\n",
" frac_train=0.6,\n",
" frac_val=0.15,\n",
" frac_test=0.25,\n",
" random_state=None,\n",
"):\n",
"\n",
" if frac_train + frac_val + frac_test != 1.0:\n",
" raise ValueError(\n",
" \"fractions %f, %f, %f do not add up to 1.0\"\n",
" % (frac_train, frac_val, frac_test)\n",
" )\n",
"\n",
" if stratify_colname not in df_input.columns:\n",
" raise ValueError(\"%s is not a column in the dataframe\" % (stratify_colname))\n",
"\n",
" X = df_input # Contains all columns.\n",
" y = df_input[\n",
" [stratify_colname]\n",
" ] # Dataframe of just the column on which to stratify.\n",
"\n",
" # Split original dataframe into train and temp dataframes.\n",
" df_train, df_temp, y_train, y_temp = train_test_split(\n",
" X, y, stratify=y, test_size=(1.0 - frac_train), random_state=random_state\n",
" )\n",
"\n",
" # Split the temp dataframe into val and test dataframes.\n",
" relative_frac_test = frac_test / (frac_val + frac_test)\n",
" df_val, df_test, y_val, y_test = train_test_split(\n",
" df_temp,\n",
" y_temp,\n",
" stratify=y_temp,\n",
" test_size=relative_frac_test,\n",
" random_state=random_state,\n",
" )\n",
"\n",
" assert len(df_input) == len(df_train) + len(df_val) + len(df_test)\n",
"\n",
" return df_train, df_val, df_test"
]
},
{
"cell_type": "code",
2024-10-11 18:46:40 +04:00
"execution_count": 7,
2024-10-11 18:41:52 +04:00
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Outcome\n",
"0 500\n",
"1 268\n",
"Name: count, dtype: int64\n",
"\n",
"Обучающая выборка: (460, 9)\n",
"Outcome\n",
"0 299\n",
"1 161\n",
"Name: count, dtype: int64\n"
]
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAf8AAADECAYAAACROyhkAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAAA4AklEQVR4nO3dd1wT9/8H8FcSAgTC3ooICqKCE0cdgAMHYl2t1GodqNXWttba1tZf3bb122Ld1lktKtY9WuvEusUtKFUUFBBR2SAEQiD5/P7ApISEKXhA3s/HIw/l8rnPvfO5y+d9d5+7C48xxkAIIYQQncHnOgBCCCGEvFmU/AkhhBAdQ8mfEEII0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zLL7/UWrYy7cFY8XoqSSaTMU9PT9anTx+1uvh8Phs+fLjGtqhc51lZWczExIR17dqV5efnay0jk8mYra0t8/T0VCtz5MgRBoDNmzdPNW38+PGsadOmavVs3LiRAWDXrl3T+pkZYywiIoIBYJ9//nmZZRhjrG3btszS0lL1d8m2Lal0HOWd9vfx8WEmJiYsISFBbXrJ78WwYcOYvr4+e/TokWras2fPmImJCfPx8VFNU/YPpb9X3bp1Yzwej3300UeqaUVFRczR0VEt/qps69pUt/0ZY6x9+/bM1taWpaenq6ZFRkYyPp/Pxo0bp5oGgAFgZ8+eVU3Ly8tjrVq1Yvb29kwmkzHGGDtx4gQDwI4dO6a2nLZt26p95qCgIObk5KQRT+n1VXqbZ4yx8PBwBoBt27ZNNU3
"text/plain": [
"<Figure size 200x200 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Контрольная выборка: (154, 9)\n",
"Outcome\n",
2024-10-11 18:46:40 +04:00
"0 100\n",
"1 54\n",
2024-10-11 18:41:52 +04:00
"Name: count, dtype: int64\n"
]
},
{
"data": {
2024-10-11 18:46:40 +04:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAgsAAADECAYAAAARfmKGAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAAA4TElEQVR4nO3dd3QU1dsH8O/uZrPppDcIJBBqKIFQpIbeojQBFZQuARRE8IeiYqii4osgTVGBSBFpgiCGKkrvoRNCSOgEEkhIL7v3/SPummU3m0KSCcn3c05Ozs7cmXmm7rP3zp2RCSEEiIiIiPIglzoAIiIiKtuYLBAREZFJTBaIiIjIJCYLREREZBKTBSIiIjKJyQIRERGZxGSBiIiITGKyQERERCYxWSAiIioGGo0GcXFxuHHjhtShFDsmC0REVKYdOnQIBw4c0H0+cOAADh8+LF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uVz07dvX4FjU7vOEhARha2srWrRoIdLS0oyWyczMFK6urqJ+/fp6ZXbs2CEAiM8++0w3bOjQoaJatWp681m+fLkAIE6cOGF0nYUQIjw8XAAQ7733Xp5lhBCiYcOGwtHRUfc597bN7dk4jB2rWu3atRO2trbi5s2besNznxd9+vQR5ubmIioqSjfs3r17wtbWVrRr1043THt9ePa8atmypZDJZGLMmDG6YdnZ2aJKlSp68RfmWDemqNv/2WlPnTolbGxsxIABAwyOHX9/f+Hq6iri4+N1w86dOyfkcrkYMmSIbpj2uH306JHe9CdPnhQ
2024-10-11 18:41:52 +04:00
"text/plain": [
"<Figure size 200x200 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Тестовая выборка: (154, 9)\n",
"Outcome\n",
2024-10-11 18:46:40 +04:00
"0 101\n",
"1 53\n",
2024-10-11 18:41:52 +04:00
"Name: count, dtype: int64\n"
]
},
{
"data": {
2024-10-11 18:46:40 +04:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAekAAADECAYAAAC7i9nLAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAAA0iUlEQVR4nO3dd1gU19cH8O9W+tKbFUSxo4jltWJXNMESY+wlFmLUmJjExCR2jTEaK2pMYi+JqBF/sfeo2BVQVAgiKCjSpLeF3fv+QXbDsgssCMyyez7Pw5M4c+fOmTuzc3bu3JnlMcYYCCGEEKJz+FwHQAghhBDNKEkTQgghOoqSNCGEEKKjKEkTQgghOoqSNCGEEKKjKEkTQgghOoqSNCGEEKKjKEkTQgghOoqSNCGEkFqNMYY3b94gMjKS61CqHCVpQgghGoWFhSEwMFD575CQEJw4cYK7gIrJzMzEd999h6ZNm0IsFsPW1hbu7u6IiIjgOrQqVaEkvWvXLvB4POWfsbEx3N3dMWvWLCQ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VmZiazsrJi06ZNU5n++vVrZmlpqTJdm3YtrmHDhmzixIlq06v6+EtMTGRisZj1799f5XPh7+/PALAdO3Yop5U8vk6ePMkAsIEDB6p9JjXRdHx+8803DABLTExUTgPAZs6cWWo9iuMqOjpa5d8tWrRQORcozv/Fzy9t27ZlDg4OLCUlRTktNDSU8fl8NmHCBOU0xXnG19dXZd0ff/wxA8BCQ0NV4lUcH/Pnz2cCgYAFBgaqLFfRXFCWSnV39+3
2024-10-11 18:41:52 +04:00
"text/plain": [
"<Figure size 200x200 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"# Вывод распределения количества наблюдений по меткам (классам)\n",
"print(df.Outcome.value_counts())\n",
"print()\n",
"\n",
"data = df.copy()\n",
"\n",
"df_train, df_val, df_test = split_stratified_into_train_val_test(\n",
" data, stratify_colname=\"Outcome\", frac_train=0.60, frac_val=0.20, frac_test=0.20\n",
")\n",
"\n",
"print(\"Обучающая выборка: \", df_train.shape)\n",
"print(df_train.Outcome.value_counts())\n",
"counts = df_train['Outcome'].value_counts()\n",
"plt.figure(figsize=(2, 2))# Установка размера графика\n",
"plt.pie(counts, labels=counts.index, autopct='%1.1f%%', startangle=90)# Построение круговой диаграммы\n",
"plt.title('Распределение классов Outcome в обучающей выборке')# Добавление заголовка\n",
"plt.show()# Отображение графика\n",
"\n",
"print(\"Контрольная выборка: \", df_val.shape)\n",
"print(df_val.Outcome.value_counts())\n",
"counts = df_val['Outcome'].value_counts()\n",
"plt.figure(figsize=(2, 2))\n",
"plt.pie(counts, labels=counts.index, autopct='%1.1f%%', startangle=90)\n",
"plt.title('Распределение классов Outcome в контрольной выборке')\n",
"plt.show()\n",
"\n",
"print(\"Тестовая выборка: \", df_test.shape)\n",
"print(df_test.Outcome.value_counts())\n",
"counts = df_test['Outcome'].value_counts()\n",
"plt.figure(figsize=(2, 2))\n",
"plt.pie(counts, labels=counts.index, autopct='%1.1f%%', startangle=90)\n",
"plt.title('Распределение классов Outcome в тестовой выборке')\n",
"plt.show()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Сбалансируем распределение:"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"1. Балансировка данных оверсемплингом. Это метод, увеличивающий число наблюдений в меньшинственном классе для достижения более равномерного распределения классов."
]
},
{
"cell_type": "code",
2024-10-11 18:46:40 +04:00
"execution_count": 8,
2024-10-11 18:41:52 +04:00
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Обучающая выборка: (460, 9)\n",
"Outcome\n",
"0 299\n",
"1 161\n",
"Name: count, dtype: int64\n",
2024-10-11 18:46:40 +04:00
"Обучающая выборка после oversampling: (585, 9)\n",
2024-10-11 18:41:52 +04:00
"Outcome\n",
"0 299\n",
2024-10-11 18:46:40 +04:00
"1 286\n",
2024-10-11 18:41:52 +04:00
"Name: count, dtype: int64\n"
]
},
{
"data": {
2024-10-11 18:46:40 +04:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAqIAAADECAYAAABEM0OdAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAAA98UlEQVR4nO3deVhU1f8H8PfMMOygIKsbIIgbKolLqYiWmoqZmmHaopaplW2a5vItt8xSS80ltXLXTCW1zNwtl3DfcwMFF1RkkX0ZmDm/P/jNxDADDjhwWd6v5+HhmTv3nvu5Z87c+cw5956RCSEEiIiIiIjKmVzqAIiIiIioemIiSkRERESSYCJKRERERJJgIkpEREREkmAiSkRERESSYCJKRERERJJgIkpEREREkmAiSkRERESSsJA6ACIiIjJOpVIhKSkJGo0GtWvXljocIrNjjygREVU769atQ0xMjO7xqlWrEBsbK11ABZw6dQqDBw+Gi4sLrKys4OnpiZdeeknqsIjKRIkS0VWrVkEmk+n+rK2t4e/vj9GjRyMuLq6sYiSqNo4ePYp+/frB3d0dVlZW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z44YdFbhsVFYUffvihRPvTnqdycnKwe/duzJ07F9bW1pgxY0apjyExMRFHjhzBkSNH8OabbyIoKAj79+/HxIkTERMTg6VLl+rWLcnrZkqbLezOnTvo0aMHGjdujE2bNsHCIj9dMEfbDgwMxNixY/WWrVmzBnv37tVbZuoxmnIeL6isP3N
2024-10-11 18:41:52 +04:00
"text/plain": [
"<Figure size 200x200 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>Pregnancies</th>\n",
" <th>Glucose</th>\n",
" <th>BloodPressure</th>\n",
" <th>SkinThickness</th>\n",
" <th>Insulin</th>\n",
" <th>BMI</th>\n",
" <th>DiabetesPedigreeFunction</th>\n",
" <th>Age</th>\n",
" <th>Outcome</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
2024-10-11 18:46:40 +04:00
" <td>11.000000</td>\n",
" <td>120.000000</td>\n",
" <td>80.000000</td>\n",
" <td>37.000000</td>\n",
" <td>150.000000</td>\n",
" <td>42.300000</td>\n",
" <td>0.785000</td>\n",
" <td>48.000000</td>\n",
2024-10-11 18:41:52 +04:00
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
2024-10-11 18:46:40 +04:00
" <td>5.000000</td>\n",
" <td>78.000000</td>\n",
" <td>48.000000</td>\n",
" <td>0.000000</td>\n",
" <td>0.000000</td>\n",
" <td>33.700000</td>\n",
" <td>0.654000</td>\n",
" <td>25.000000</td>\n",
2024-10-11 18:41:52 +04:00
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>0.000000</td>\n",
2024-10-11 18:46:40 +04:00
" <td>138.000000</td>\n",
" <td>60.000000</td>\n",
" <td>35.000000</td>\n",
" <td>167.000000</td>\n",
" <td>34.600000</td>\n",
" <td>0.534000</td>\n",
" <td>21.000000</td>\n",
" <td>1</td>\n",
2024-10-11 18:41:52 +04:00
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
2024-10-11 18:46:40 +04:00
" <td>4.000000</td>\n",
" <td>114.000000</td>\n",
" <td>64.000000</td>\n",
2024-10-11 18:41:52 +04:00
" <td>0.000000</td>\n",
" <td>0.000000</td>\n",
2024-10-11 18:46:40 +04:00
" <td>28.900000</td>\n",
" <td>0.126000</td>\n",
" <td>24.000000</td>\n",
" <td>0</td>\n",
2024-10-11 18:41:52 +04:00
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>1.000000</td>\n",
2024-10-11 18:46:40 +04:00
" <td>80.000000</td>\n",
" <td>55.000000</td>\n",
" <td>0.000000</td>\n",
" <td>0.000000</td>\n",
" <td>19.100000</td>\n",
" <td>0.258000</td>\n",
" <td>21.000000</td>\n",
2024-10-11 18:41:52 +04:00
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>...</th>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" </tr>\n",
" <tr>\n",
2024-10-11 18:46:40 +04:00
" <th>580</th>\n",
" <td>4.004270</td>\n",
" <td>138.800854</td>\n",
" <td>76.017081</td>\n",
" <td>35.000000</td>\n",
" <td>161.394022</td>\n",
" <td>32.197438</td>\n",
" <td>0.395452</td>\n",
" <td>24.203416</td>\n",
2024-10-11 18:41:52 +04:00
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
2024-10-11 18:46:40 +04:00
" <th>581</th>\n",
2024-10-11 18:41:52 +04:00
" <td>3.000000</td>\n",
2024-10-11 18:46:40 +04:00
" <td>173.000000</td>\n",
" <td>82.028247</td>\n",
" <td>47.788146</td>\n",
" <td>318.125000</td>\n",
" <td>38.361866</td>\n",
" <td>1.186696</td>\n",
" <td>24.957629</td>\n",
2024-10-11 18:41:52 +04:00
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
2024-10-11 18:46:40 +04:00
" <th>582</th>\n",
" <td>1.650334</td>\n",
" <td>117.398663</td>\n",
" <td>72.200446</td>\n",
" <td>25.501114</td>\n",
" <td>0.000000</td>\n",
" <td>29.710468</td>\n",
" <td>0.222644</td>\n",
" <td>29.948775</td>\n",
2024-10-11 18:41:52 +04:00
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
2024-10-11 18:46:40 +04:00
" <th>583</th>\n",
" <td>8.457245</td>\n",
" <td>99.085511</td>\n",
" <td>72.628266</td>\n",
" <td>36.227731</td>\n",
" <td>219.915380</td>\n",
" <td>38.051128</td>\n",
" <td>0.691292</td>\n",
" <td>43.114311</td>\n",
2024-10-11 18:41:52 +04:00
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
2024-10-11 18:46:40 +04:00
" <th>584</th>\n",
" <td>7.795549</td>\n",
" <td>107.065951</td>\n",
" <td>64.102226</td>\n",
" <td>19.262983</td>\n",
" <td>255.197032</td>\n",
" <td>32.750453</td>\n",
" <td>0.729442</td>\n",
" <td>36.992581</td>\n",
2024-10-11 18:41:52 +04:00
" <td>1</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
2024-10-11 18:46:40 +04:00
"<p>585 rows × 9 columns</p>\n",
2024-10-11 18:41:52 +04:00
"</div>"
],
"text/plain": [
" Pregnancies Glucose BloodPressure SkinThickness Insulin \\\n",
2024-10-11 18:46:40 +04:00
"0 11.000000 120.000000 80.000000 37.000000 150.000000 \n",
"1 5.000000 78.000000 48.000000 0.000000 0.000000 \n",
"2 0.000000 138.000000 60.000000 35.000000 167.000000 \n",
"3 4.000000 114.000000 64.000000 0.000000 0.000000 \n",
"4 1.000000 80.000000 55.000000 0.000000 0.000000 \n",
2024-10-11 18:41:52 +04:00
".. ... ... ... ... ... \n",
2024-10-11 18:46:40 +04:00
"580 4.004270 138.800854 76.017081 35.000000 161.394022 \n",
"581 3.000000 173.000000 82.028247 47.788146 318.125000 \n",
"582 1.650334 117.398663 72.200446 25.501114 0.000000 \n",
"583 8.457245 99.085511 72.628266 36.227731 219.915380 \n",
"584 7.795549 107.065951 64.102226 19.262983 255.197032 \n",
2024-10-11 18:41:52 +04:00
"\n",
" BMI DiabetesPedigreeFunction Age Outcome \n",
2024-10-11 18:46:40 +04:00
"0 42.300000 0.785000 48.000000 1 \n",
"1 33.700000 0.654000 25.000000 0 \n",
"2 34.600000 0.534000 21.000000 1 \n",
"3 28.900000 0.126000 24.000000 0 \n",
"4 19.100000 0.258000 21.000000 0 \n",
2024-10-11 18:41:52 +04:00
".. ... ... ... ... \n",
2024-10-11 18:46:40 +04:00
"580 32.197438 0.395452 24.203416 1 \n",
"581 38.361866 1.186696 24.957629 1 \n",
"582 29.710468 0.222644 29.948775 1 \n",
"583 38.051128 0.691292 43.114311 1 \n",
"584 32.750453 0.729442 36.992581 1 \n",
2024-10-11 18:41:52 +04:00
"\n",
2024-10-11 18:46:40 +04:00
"[585 rows x 9 columns]"
2024-10-11 18:41:52 +04:00
]
},
2024-10-11 18:46:40 +04:00
"execution_count": 8,
2024-10-11 18:41:52 +04:00
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"from imblearn.over_sampling import ADASYN\n",
"\n",
"ada = ADASYN()\n",
"\n",
"print(\"Обучающая выборка: \", df_train.shape)\n",
"print(df_train.Outcome.value_counts())\n",
"\n",
"X_resampled, y_resampled = ada.fit_resample(df_train, df_train[\"Outcome\"])\n",
"df_train_adasyn = pd.DataFrame(X_resampled)\n",
"\n",
"print(\"Обучающая выборка после oversampling: \", df_train_adasyn.shape)\n",
"print(df_train_adasyn.Outcome.value_counts())\n",
"\n",
"counts = df_train_adasyn['Outcome'].value_counts()\n",
"plt.figure(figsize=(2, 2))\n",
"plt.pie(counts, labels=counts.index, autopct='%1.1f%%', startangle=90)\n",
"plt.title('Распределение классов Outcome в тренировочной выборке после ADASYN')\n",
"plt.show()\n",
"\n",
"df_train_adasyn"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"2. Балансировка данных андерсемплингом. Этот метод помогает сбалансировать выборку, уменьшая количество экземпляров класса большинства, чтобы привести его в соответствие с классом меньшинства."
]
},
{
"cell_type": "code",
2024-10-11 18:46:40 +04:00
"execution_count": 9,
2024-10-11 18:41:52 +04:00
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Обучающая выборка после undersampling: (322, 9)\n",
"Outcome\n",
"0 161\n",
"1 161\n",
"Name: count, dtype: int64\n"
]
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAtwAAADECAYAAACss/a2AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAAA+PklEQVR4nO3dd3gUVdsG8Ht30xtpkEJLTCD0RIPwUkIAIUCCCIg0C1VAiiAIin5IFxUUkCKK0oRXqsIrIh2khSIdKQZMEAKkQUIKu0l2z/dH3DWT3YRNWYYk9++6csHOTnnmzNmZZ8+cOasQQggQEREREZFFKOUOgIiIiIioImPCTURERERkQUy4iYiIiIgsiAk3EREREZEFMeEmIiIiIrIgJtxERERERBbEhJuIiIiIyIKYcBMRERERWZCV3AEQERGRadnZ2bh//z50Oh18fX3lDoeISogt3EREVOmsXbsWcXFxhterVq1CfHy8fAHl8/vvv6N///7w9PSEra0tfHx88PLLL8sdFj2l/Pz8MHDgQLnDeCpMmzYNCoVCMu1pKZ9iJdyrVq2CQqEw/NnZ2aFu3boYPXo0EhISLBUjUaVx9OhR9OjRA15eXrC1tYWfnx+GDx+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mo8Ks21AcirI+np6Rg1ahTUajUWLlyI9u3b4+LFi/Dy8rJImU+ePBmfffYZXnzxRXTq1Annz59Hp06djBouzCKKYeXKlQKA2Lt3r0hKShK3bt0S69evFx4eHsL
"text/plain": [
"<Figure size 200x200 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"from imblearn.under_sampling import RandomUnderSampler\n",
"\n",
"rus = RandomUnderSampler()# Создание экземпляра RandomUnderSampler\n",
"\n",
"# Применение RandomUnderSampler\n",
"X_resampled, y_resampled = rus.fit_resample(df_train.drop(columns=['Outcome']), df_train['Outcome'])\n",
"\n",
"# Создание нового DataFrame\n",
"df_train_undersampled = pd.DataFrame(X_resampled)\n",
"df_train_undersampled['Outcome'] = y_resampled # Добавление целевой переменной\n",
"\n",
"# Вывод информации о новой выборке\n",
"print(\"Обучающая выборка после undersampling: \", df_train_undersampled.shape)\n",
"print(df_train_undersampled['Outcome'].value_counts())\n",
"\n",
"# Визуализация распределения классов\n",
"counts = df_train_undersampled['Outcome'].value_counts()\n",
"plt.figure(figsize=(2, 2))\n",
"plt.pie(counts, labels=counts.index, autopct='%1.1f%%', startangle=90)\n",
"plt.title('Распределение классов Outcome в тренировочной выборке после Undersampling')\n",
"plt.show()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### 2. Датасет: Данные по инсультам\n",
"https://www.kaggle.com/datasets/fedesoriano/stroke-prediction-dataset\n",
"##### О наборе данных: \n",
"По данным Всемирной организации здравоохранения (ВОЗ), инсульт является второй по значимости причиной смертности во всем мире, на его долю приходится примерно 11% от общего числа смертей.\n",
"Этот набор данных используется для прогнозирования вероятности инсульта у пациента на основе входных параметров, таких как пол, возраст, различные заболевания и статус курильщика. Каждая строка в данных содержит соответствующую информацию о пациенте.\n",
"\n",
"Атрибуты:\n",
"1) id: уникальный идентификатор\n",
"2) gender: \"Male\", \"Female\" или \"Other\"\n",
"3) age: возраст пациента\n",
"4) hypertension: 0, если у пациента нет артериальной гипертензии, 1, если у пациента есть артериальная гипертензия\n",
"5) heart_disease: 0, если у пациента нет сердечных заболеваний, 1, если у пациента есть сердечные заболевания\n",
"6) ever_married: \"No\" или \"Yes\"\n",
"7) work_type: \"children\", \"Govt_jov\", \"Never_worked\", \"Private\" or \"Self-employed\"\n",
"8) Residence_type: \"Rural\" or \"Urban\"\n",
"9) avg_glucose_level: средний уровень глюкозы в крови\n",
"10) bmi: индекс массы тела\n",
"11) smoking_status: \"formerly smoked\", \"never smoked\", \"smokes\" или \"Unknown\"*\n",
"12) stroke: 1, если у пациента был инсульт, или 0, если нет.\n",
"##### Таким образом:\n",
"* Объект наблюдения - Реальные пациенты.\n",
"* Атрибуты: id, gender, age, hypertension, heart_disease, ever_married, work_type, Residence_type, avg_glucose_level, bmi, smoking_status, stroke.\n",
"* Проблемная область: Прогнозирование вероятности инсульта у пациента."
]
},
{
"cell_type": "code",
2024-10-11 18:46:40 +04:00
"execution_count": 10,
2024-10-11 18:41:52 +04:00
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Количество колонок: 12\n",
"Колонки: id, gender, age, hypertension, heart_disease, ever_married, work_type, Residence_type, avg_glucose_level, bmi, smoking_status, stroke\n",
"\n",
"<class 'pandas.core.frame.DataFrame'>\n",
"RangeIndex: 5110 entries, 0 to 5109\n",
"Data columns (total 12 columns):\n",
" # Column Non-Null Count Dtype \n",
"--- ------ -------------- ----- \n",
" 0 id 5110 non-null int64 \n",
" 1 gender 5110 non-null object \n",
" 2 age 5110 non-null float64\n",
" 3 hypertension 5110 non-null int64 \n",
" 4 heart_disease 5110 non-null int64 \n",
" 5 ever_married 5110 non-null object \n",
" 6 work_type 5110 non-null object \n",
" 7 Residence_type 5110 non-null object \n",
" 8 avg_glucose_level 5110 non-null float64\n",
" 9 bmi 4909 non-null float64\n",
" 10 smoking_status 5110 non-null object \n",
" 11 stroke 5110 non-null int64 \n",
"dtypes: float64(3), int64(4), object(5)\n",
"memory usage: 479.2+ KB\n"
]
},
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>id</th>\n",
" <th>gender</th>\n",
" <th>age</th>\n",
" <th>hypertension</th>\n",
" <th>heart_disease</th>\n",
" <th>ever_married</th>\n",
" <th>work_type</th>\n",
" <th>Residence_type</th>\n",
" <th>avg_glucose_level</th>\n",
" <th>bmi</th>\n",
" <th>smoking_status</th>\n",
" <th>stroke</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>9046</td>\n",
" <td>Male</td>\n",
" <td>67.0</td>\n",
" <td>0</td>\n",
" <td>1</td>\n",
" <td>Yes</td>\n",
" <td>Private</td>\n",
" <td>Urban</td>\n",
" <td>228.69</td>\n",
" <td>36.6</td>\n",
" <td>formerly smoked</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>51676</td>\n",
" <td>Female</td>\n",
" <td>61.0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>Yes</td>\n",
" <td>Self-employed</td>\n",
" <td>Rural</td>\n",
" <td>202.21</td>\n",
" <td>NaN</td>\n",
" <td>never smoked</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>31112</td>\n",
" <td>Male</td>\n",
" <td>80.0</td>\n",
" <td>0</td>\n",
" <td>1</td>\n",
" <td>Yes</td>\n",
" <td>Private</td>\n",
" <td>Rural</td>\n",
" <td>105.92</td>\n",
" <td>32.5</td>\n",
" <td>never smoked</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>60182</td>\n",
" <td>Female</td>\n",
" <td>49.0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>Yes</td>\n",
" <td>Private</td>\n",
" <td>Urban</td>\n",
" <td>171.23</td>\n",
" <td>34.4</td>\n",
" <td>smokes</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>1665</td>\n",
" <td>Female</td>\n",
" <td>79.0</td>\n",
" <td>1</td>\n",
" <td>0</td>\n",
" <td>Yes</td>\n",
" <td>Self-employed</td>\n",
" <td>Rural</td>\n",
" <td>174.12</td>\n",
" <td>24.0</td>\n",
" <td>never smoked</td>\n",
" <td>1</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" id gender age hypertension heart_disease ever_married \\\n",
"0 9046 Male 67.0 0 1 Yes \n",
"1 51676 Female 61.0 0 0 Yes \n",
"2 31112 Male 80.0 0 1 Yes \n",
"3 60182 Female 49.0 0 0 Yes \n",
"4 1665 Female 79.0 1 0 Yes \n",
"\n",
" work_type Residence_type avg_glucose_level bmi smoking_status \\\n",
"0 Private Urban 228.69 36.6 formerly smoked \n",
"1 Self-employed Rural 202.21 NaN never smoked \n",
"2 Private Rural 105.92 32.5 never smoked \n",
"3 Private Urban 171.23 34.4 smokes \n",
"4 Self-employed Rural 174.12 24.0 never smoked \n",
"\n",
" stroke \n",
"0 1 \n",
"1 1 \n",
"2 1 \n",
"3 1 \n",
"4 1 "
]
},
2024-10-11 18:46:40 +04:00
"execution_count": 10,
2024-10-11 18:41:52 +04:00
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"import pandas as pd\n",
"df = pd.read_csv(\".//static//csv//stroke.csv\", sep=\",\")\n",
"print('Количество колонок: ' + str(df.columns.size)) \n",
"print('Колонки: ' + ', '.join(df.columns)+'\\n')\n",
"\n",
"df.info()\n",
"df.head()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Получение сведений о пропущенных данных\n",
"Типы пропущенных данных:\n",
"\n",
"- None - представление пустых данных в Python\n",
"- NaN - представление пустых данных в Pandas\n",
"- '' - пустая строка"
]
},
{
"cell_type": "code",
2024-10-11 18:46:40 +04:00
"execution_count": 11,
2024-10-11 18:41:52 +04:00
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"id 0\n",
"gender 0\n",
"age 0\n",
"hypertension 0\n",
"heart_disease 0\n",
"ever_married 0\n",
"work_type 0\n",
"Residence_type 0\n",
"avg_glucose_level 0\n",
"bmi 201\n",
"smoking_status 0\n",
"stroke 0\n",
"dtype: int64\n",
"\n",
"id False\n",
"gender False\n",
"age False\n",
"hypertension False\n",
"heart_disease False\n",
"ever_married False\n",
"work_type False\n",
"Residence_type False\n",
"avg_glucose_level False\n",
"bmi True\n",
"smoking_status False\n",
"stroke False\n",
"dtype: bool\n",
"\n",
"id процент пустых значений: %0.00\n",
"gender процент пустых значений: %0.00\n",
"age процент пустых значений: %0.00\n",
"hypertension процент пустых значений: %0.00\n",
"heart_disease процент пустых значений: %0.00\n",
"ever_married процент пустых значений: %0.00\n",
"work_type процент пустых значений: %0.00\n",
"Residence_type процент пустых значений: %0.00\n",
"avg_glucose_level процент пустых значений: %0.00\n",
"bmi процент пустых значений: %3.93\n",
"smoking_status процент пустых значений: %0.00\n",
"stroke процент пустых значений: %0.00\n"
]
}
],
"source": [
"# Количество пустых значений признаков\n",
"print(df.isnull().sum())\n",
"print()\n",
"\n",
"# Есть ли пустые значения признаков\n",
"print(df.isnull().any())\n",
"print()\n",
"\n",
"# Процент пустых значений признаков\n",
"for i in df.columns:\n",
" null_rate = df[i].isnull().sum() / len(df) * 100\n",
" print(f\"{i} процент пустых значений: %{null_rate:.2f}\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##### Пропущенные данные существуют. Необходимо заполнить пропуски медианными значениями.\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Заполнение пропущенных данных:"
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"(5110, 12)\n",
"id False\n",
"gender False\n",
"age False\n",
"hypertension False\n",
"heart_disease False\n",
"ever_married False\n",
"work_type False\n",
"Residence_type False\n",
"avg_glucose_level False\n",
"bmi False\n",
"smoking_status False\n",
"stroke False\n",
"dtype: bool\n"
]
},
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>id</th>\n",
" <th>gender</th>\n",
" <th>age</th>\n",
" <th>hypertension</th>\n",
" <th>heart_disease</th>\n",
" <th>ever_married</th>\n",
" <th>work_type</th>\n",
" <th>Residence_type</th>\n",
" <th>avg_glucose_level</th>\n",
" <th>bmi</th>\n",
" <th>smoking_status</th>\n",
" <th>stroke</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>5105</th>\n",
" <td>18234</td>\n",
" <td>Female</td>\n",
" <td>80.0</td>\n",
" <td>1</td>\n",
" <td>0</td>\n",
" <td>Yes</td>\n",
" <td>Private</td>\n",
" <td>Urban</td>\n",
" <td>83.75</td>\n",
" <td>27.7</td>\n",
" <td>never smoked</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>5106</th>\n",
" <td>44873</td>\n",
" <td>Female</td>\n",
" <td>81.0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>Yes</td>\n",
" <td>Self-employed</td>\n",
" <td>Urban</td>\n",
" <td>125.20</td>\n",
" <td>40.0</td>\n",
" <td>never smoked</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>5107</th>\n",
" <td>19723</td>\n",
" <td>Female</td>\n",
" <td>35.0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>Yes</td>\n",
" <td>Self-employed</td>\n",
" <td>Rural</td>\n",
" <td>82.99</td>\n",
" <td>30.6</td>\n",
" <td>never smoked</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>5108</th>\n",
" <td>37544</td>\n",
" <td>Male</td>\n",
" <td>51.0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>Yes</td>\n",
" <td>Private</td>\n",
" <td>Rural</td>\n",
" <td>166.29</td>\n",
" <td>25.6</td>\n",
" <td>formerly smoked</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>5109</th>\n",
" <td>44679</td>\n",
" <td>Female</td>\n",
" <td>44.0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>Yes</td>\n",
" <td>Govt_job</td>\n",
" <td>Urban</td>\n",
" <td>85.28</td>\n",
" <td>26.2</td>\n",
" <td>Unknown</td>\n",
" <td>0</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" id gender age hypertension heart_disease ever_married \\\n",
"5105 18234 Female 80.0 1 0 Yes \n",
"5106 44873 Female 81.0 0 0 Yes \n",
"5107 19723 Female 35.0 0 0 Yes \n",
"5108 37544 Male 51.0 0 0 Yes \n",
"5109 44679 Female 44.0 0 0 Yes \n",
"\n",
" work_type Residence_type avg_glucose_level bmi smoking_status \\\n",
"5105 Private Urban 83.75 27.7 never smoked \n",
"5106 Self-employed Urban 125.20 40.0 never smoked \n",
"5107 Self-employed Rural 82.99 30.6 never smoked \n",
"5108 Private Rural 166.29 25.6 formerly smoked \n",
"5109 Govt_job Urban 85.28 26.2 Unknown \n",
"\n",
" stroke \n",
"5105 0 \n",
"5106 0 \n",
"5107 0 \n",
"5108 0 \n",
"5109 0 "
]
},
"execution_count": 12,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"fillna_df = df.fillna(0)\n",
"\n",
"print(fillna_df.shape)\n",
"\n",
"print(fillna_df.isnull().any())\n",
"\n",
"# Замена пустых данных на 0\n",
"df[\"bmi\"] = df[\"bmi\"].fillna(0)\n",
"\n",
"# Вычисляем медиану для колонки \"bmi\"\n",
"median_bmi = df[\"bmi\"].median()\n",
"\n",
"# Заменяем значения 0 на медиану\n",
"df.loc[df[\"bmi\"] == 0, \"bmi\"] = median_bmi\n",
"\n",
"df.tail()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Удалим наблюдения с пропусками:"
]
},
{
"cell_type": "code",
"execution_count": 13,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"(5110, 12)\n",
"id False\n",
"gender False\n",
"age False\n",
"hypertension False\n",
"heart_disease False\n",
"ever_married False\n",
"work_type False\n",
"Residence_type False\n",
"avg_glucose_level False\n",
"bmi False\n",
"smoking_status False\n",
"stroke False\n",
"dtype: bool\n"
]
},
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>id</th>\n",
" <th>gender</th>\n",
" <th>age</th>\n",
" <th>hypertension</th>\n",
" <th>heart_disease</th>\n",
" <th>ever_married</th>\n",
" <th>work_type</th>\n",
" <th>Residence_type</th>\n",
" <th>avg_glucose_level</th>\n",
" <th>bmi</th>\n",
" <th>smoking_status</th>\n",
" <th>stroke</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>5105</th>\n",
" <td>18234</td>\n",
" <td>Female</td>\n",
" <td>80.0</td>\n",
" <td>1</td>\n",
" <td>0</td>\n",
" <td>Yes</td>\n",
" <td>Private</td>\n",
" <td>Urban</td>\n",
" <td>83.75</td>\n",
" <td>27.7</td>\n",
" <td>never smoked</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>5106</th>\n",
" <td>44873</td>\n",
" <td>Female</td>\n",
" <td>81.0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>Yes</td>\n",
" <td>Self-employed</td>\n",
" <td>Urban</td>\n",
" <td>125.20</td>\n",
" <td>40.0</td>\n",
" <td>never smoked</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>5107</th>\n",
" <td>19723</td>\n",
" <td>Female</td>\n",
" <td>35.0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>Yes</td>\n",
" <td>Self-employed</td>\n",
" <td>Rural</td>\n",
" <td>82.99</td>\n",
" <td>30.6</td>\n",
" <td>never smoked</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>5108</th>\n",
" <td>37544</td>\n",
" <td>Male</td>\n",
" <td>51.0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>Yes</td>\n",
" <td>Private</td>\n",
" <td>Rural</td>\n",
" <td>166.29</td>\n",
" <td>25.6</td>\n",
" <td>formerly smoked</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>5109</th>\n",
" <td>44679</td>\n",
" <td>Female</td>\n",
" <td>44.0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>Yes</td>\n",
" <td>Govt_job</td>\n",
" <td>Urban</td>\n",
" <td>85.28</td>\n",
" <td>26.2</td>\n",
" <td>Unknown</td>\n",
" <td>0</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" id gender age hypertension heart_disease ever_married \\\n",
"5105 18234 Female 80.0 1 0 Yes \n",
"5106 44873 Female 81.0 0 0 Yes \n",
"5107 19723 Female 35.0 0 0 Yes \n",
"5108 37544 Male 51.0 0 0 Yes \n",
"5109 44679 Female 44.0 0 0 Yes \n",
"\n",
" work_type Residence_type avg_glucose_level bmi smoking_status \\\n",
"5105 Private Urban 83.75 27.7 never smoked \n",
"5106 Self-employed Urban 125.20 40.0 never smoked \n",
"5107 Self-employed Rural 82.99 30.6 never smoked \n",
"5108 Private Rural 166.29 25.6 formerly smoked \n",
"5109 Govt_job Urban 85.28 26.2 Unknown \n",
"\n",
" stroke \n",
"5105 0 \n",
"5106 0 \n",
"5107 0 \n",
"5108 0 \n",
"5109 0 "
]
},
"execution_count": 13,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"dropna_df = df.dropna()\n",
"\n",
"print(dropna_df.shape)\n",
"\n",
"print(fillna_df.isnull().any())\n",
"df.tail()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##### Проверим выбросы и усредним их:"
]
},
{
"cell_type": "code",
2024-10-11 18:46:40 +04:00
"execution_count": 14,
2024-10-11 18:41:52 +04:00
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Колонка age:\n",
" Есть выбросы: Нет\n",
" Количество выбросов: 0\n",
" Минимальное значение: 0.08\n",
" Максимальное значение: 82.0\n",
" 1-й квартиль (Q1): 25.0\n",
" 3-й квартиль (Q3): 61.0\n",
"\n",
"Колонка avg_glucose_level:\n",
2024-10-11 18:46:40 +04:00
" Есть выбросы: Да\n",
" Количество выбросов: 627\n",
2024-10-11 18:41:52 +04:00
" Минимальное значение: 55.12\n",
2024-10-11 18:46:40 +04:00
" Максимальное значение: 271.74\n",
2024-10-11 18:41:52 +04:00
" 1-й квартиль (Q1): 77.245\n",
" 3-й квартиль (Q3): 114.09\n",
"\n",
"Колонка bmi:\n",
2024-10-11 18:46:40 +04:00
" Есть выбросы: Да\n",
" Количество выбросов: 126\n",
" Минимальное значение: 10.3\n",
" Максимальное значение: 97.6\n",
2024-10-11 18:41:52 +04:00
" 1-й квартиль (Q1): 23.8\n",
" 3-й квартиль (Q3): 32.8\n",
"\n"
]
}
],
"source": [
"numeric_columns = ['age', 'avg_glucose_level', 'bmi']\n",
"for column in numeric_columns:\n",
" if pd.api.types.is_numeric_dtype(df[column]): # Проверяем, является ли колонка числовой\n",
" q1 = df[column].quantile(0.25) # Находим 1-й квартиль (Q1)\n",
" q3 = df[column].quantile(0.75) # Находим 3-й квартиль (Q3)\n",
" iqr = q3 - q1 # Вычисляем межквартильный размах (IQR)\n",
"\n",
" # Определяем границы для выбросов\n",
" lower_bound = q1 - 1.5 * iqr # Нижняя граница\n",
" upper_bound = q3 + 1.5 * iqr # Верхняя граница\n",
"\n",
" # Подсчитываем количество выбросов\n",
" outliers = df[(df[column] < lower_bound) | (df[column] > upper_bound)]\n",
" outlier_count = outliers.shape[0]\n",
"\n",
" print(f\"Колонка {column}:\")\n",
" print(f\" Есть выбросы: {'Да' if outlier_count > 0 else 'Нет'}\")\n",
" print(f\" Количество выбросов: {outlier_count}\")\n",
" print(f\" Минимальное значение: {df[column].min()}\")\n",
" print(f\" Максимальное значение: {df[column].max()}\")\n",
" print(f\" 1-й квартиль (Q1): {q1}\")\n",
" print(f\" 3-й квартиль (Q3): {q3}\\n\")\n",
"\n",
" # Устраняем выбросы: заменяем значения ниже нижней границы на саму нижнюю границу, а выше верхней — на верхнюю\n",
" df[column] = df[column].apply(lambda x: lower_bound if x < lower_bound else upper_bound if x > upper_bound else x)\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Постараемся выявить зависимости Stroke от остальных колонок:"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Разобьем наш набор на выборки относительно параметра Stroke:"
]
},
{
"cell_type": "code",
2024-10-11 18:46:40 +04:00
"execution_count": 15,
2024-10-11 18:41:52 +04:00
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAsAAAAJHCAYAAACemuCPAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR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pHPnzuny5cu5vn+1a9dWVlaWTpw4oTp16txyHxEREdq2bZskqX379jZ/ss7Wq1evf+w1e/zzO++8o7i4OJvw+few5uj3PduYMWNy/Y+PG4eVZMvMzNR///tfde/eXfXr17/lscXFxem9997Tu+++a/dFnOfPn1eNGjXyVJuX3/EmTZqoaNGiGjt2rMqUKWMdAnHj+5ebP/74Q0FBQfLy8rJZXr16dZvnR44ckWEYGjVqlEaNGpXrts6ePasKFSpYn1euXNlmfalSpSRJf/75p3XfknK8F2XLlrXWZrP3sw8JCcm1DihMCMDAHeDNN9/UY489Jkl6//331axZM40YMULvvPNOvreZkJAgSQoMDMxT/YEDBzR//nx9/vnnKlq0aI71DRo00JgxYzRu3DgtWLDgptvJysrSgw8+qGHDhuW6/q677spTP/nx1ltvqUGDBrp+/bp++eUXvfbaaypSpEiuQS+/Zs+erfPnz2v//v2aNGmS+vbtq88//9ymZvTo0WrRooXNsoceesjm+euvv65Ro0apV69emjBhgvz9/eXm5qbBgwfbhDNnve99+vSx/s5l+/uZzht99NFHOn78uFasWHHTmmyvvvqqatSooaioKG3cuPEf67Ndu3ZNZ86
"text/plain": [
"<Figure size 800x600 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAq4AAAIjCAYAAADC0ZkAAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAABXbUlEQVR4nO3deXwU9f3H8ffskd3cB5CEcAVBQQVBQBER8UCoovU+URCp2oontVarIuKBR1U8UItW1Ao/LbXUVgVBBA9EVBAEFQoURDkSQsid7G525/dHzOqSDazsZJc1r+fjwQN39p2ZTzbtw7eT78wYpmmaAgAAAA5wtngPAAAAAESC4goAAICEQHEFAABAQqC4AgAAICFQXAEAAJAQKK4AAABICBRXAAAAJASKKwAAABICxRU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c1+TrDMMLub/ny5Zo9e7amTJnS7BrFyy67TGvXrg0uCXj99deVmZmpk08+OST3+eefq7i4WNdcc43cbndw+8iRI9WzZ0+99dZbkqSdO3fqgw8+0BVXXBFypnpvc+6L3+9XSUmJSkpK5PV6I/66n/6sqqurVVJSomOPPVamaeqLL76QJG3btk2rV6/W6NGjQz7zoUOHqnfv3iH7mz17tjIzM3XKKacE5ykpKVH//v2VlpamRYsWNTvL9u3btXLlSl1++eXKyckJbj/iiCN0yimn6O233474+9qbrKwsLVu2TNu2bdvvfYwZMybks4v0Z/9TixYt0ogRI3TyySfrn//8p1wulyTJNE29/vrrOuOMM2SaZsjnOGLECJWXlweXNQCIDMUVaKUGDRqkYcOG6ZJLLtHzzz+vyZMna8aMGVqyZEkw89VXX+nss89WZmamMjIy1K5dO1166aWSpPLy8pD9ffzxx2rXrp1yc3N17LHHqr6+XrNnz262wN11110qKCjQ1Vdf3eS9jRs3qkePHnI4Il/NdOutt2rIkCE6/fTTm820a9dOI0eODK4vfOGFFzRmzJgmRffbb7+VJPXo0aPJPnr27Bl8/3//+58k7fe61HDWrl2rdu3ahayXnTVr1j6/bsuWLcGimJaWpnbt2mno0KGSfvxZNc7901/PN9pz2/r161VeXq7c3NzgPI1/qqqqVFxc3Owse/v8Dj30UJWUlKi6unqf39O+PPTQQ1qzZo06deqko48+WpMmTQr+TCLVtWvXkNeR/uwb1dXVaeTIkTryyCP197//XUlJScH3du7cqbKyMk2fPr3JZzh27FhJ2uvnCKAp1rgCkCSdd955uv3227Vs2TINHjxYZWVlGjp0qDIyMjR58mR169ZNbrdbK1as0B//+Mcm93w94ogj9Mgjj0hq+Bf2E088oRNOOEErVqxQfn5+SPabb77Riy++qFdeeWWv6yQjNX/+fL377rtaunTpPrNXXHGFRo8ereuuu04ffPCBnn/+eX344YdRz2CVwsLC4DrdXbt26YknntBll12mgw46SMccc0zYr/H7/TrllFNUWlqqP/7xj+rZs6dSU1O1detWXX755ft1f95AIKDc3FzNnDkz7Pvt2rX72fu02gUXXKAhQ4Zozpw5mj9/vh5++GE9+OCD+uc//6lTTz01on389Gzr/nC5XDrttNP0xhtvaN68eSH/4dT4uV966aUaM2ZM2K8/4ogjojo+0NpQXAFIUvDqc7vdLqnhqutdu3bpn//8p44//vhgbtOmTWG/Pjs7W8OGDQu+PuGEE1RQUKAZM2botttuC8nedttt6tu3ry688MKw++rWrZuWLVsmn8+3z2JrmqZuvfVWnX322c0Wu5869dRT5Xa7ddFFF+m4445Tt27dmhTXLl26SJLWrVunk04
"text/plain": [
"<Figure size 800x600 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAsAAAAIeCAYAAAC1G7mwAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAABIsElEQVR4nO3deVxUZf//8fcIggsCoiDukiu4leidaOaGomFqapsWmpppmFtleude3i5lLqlZ1le8y3Ipcy2X3FPcc1+ywnAJ1BQRF1Tm/P7wx9yOoDI0A9Z5PR+PeTyc61xzzuecmYG3h+tcx2IYhiEAAADAJPLkdgEAAABATiIAAwAAwFQIwAAAADAVAjAAAABMhQAMAAAAUyEAAwAAwFQIwAAAADAVAjAAAABMhQAMAAAAUyEAAwDuKyUlRZMmTbI9T0pK0rRp03KvoL/o+PHjslgsev/993O7lH8Mi8WiESNG5HYZQJYQgAEXiYmJkcVi0c6dOzMsmzlzpiwWi9q2bau0tLRcqA5wTP78+TVkyBDNmTNHJ06c0IgRI7R06dLcLsu0rly5ohEjRmj9+vW5XQrwt+Se2wUAZvPtt9+qV69eatCggebOnSs3N7fcLgm4Lzc3N40cOVJRUVGyWq3y9vbW8uXLc7ss07py5YpGjhwpSWrUqFHuFvP/Xb16Ve7uxAr8PfBJBXLQ+vXr9fzzzyskJERLly5Vvnz5crskIMtef/11Pfvsszpx4oSCg4Pl6+ub2yWZjtVq1fXr13O7jEzx8wx/JwyBAHLInj171KZNGxUvXlwrV66Uj49Phj4LFixQaGio8ufPr6JFi+qFF17QqVOnMl2fxWLJ9HH8+HG7PneOyXvvvfdksVjszhqNGDFCFoslwzbKlSunLl262LUlJSWpX79+Kl26tDw9PVWhQgWNGzdOVqvVrp/VatXkyZNVvXp15cuXT/7+/mrRooVtSMjd6k9/pNe3fv16u3ZPT09VqlRJY8aMkWEYdtv86aef1LJlS3l7e8vLy0tNmzbV1q1bMz1+tzt69KiaNGmiwMBAeXp6qnTp0urZs6fOnz9v65Nex9dff53h9V5eXnbH6fz583rjjTdUvXp1eXl5ydvbWy1bttTevXvtXufs436vca3VqlWze8/T9+fOP6FHRkZm+NzcXmepUqUUFhYmd3d3BQYGZrqOu2nUqFGm73Vm40bThxDd7XOR7qefflKLFi3k7+9v169Vq1ZZqkmSPvnkE5UvX16enp6qU6eOduzYYVs2a9YsWSwW/fTTTxle95///Edubm6272ijRo1UrVo17dq1S/Xq1VP+/PkVFBSkGTNmZHhtamqqhg8frgoVKtg+cwMHDlRqaqpdP4vFot69e2vOnDmqWrWqPD09NWPGDPn7+0uSRo4cmelxPHLkiDp06CA/Pz/ly5dPtWvX1pIlSzI9xps3b9aAAQPk7++vggUL6qmnntLZs2ft+u7cuVMREREqWrSobb+6du2aodY738usfCcdqQNwFs4AAzng119/VYsWLeTp6amVK1eqePHiGfrExMTopZdeUp06dTRmzBglJiZq8uTJ2rx5s3766adMz7Y99dRTateunSRp06ZN+uSTT+5ZR1JSksaMGZPt/bhy5YoaNmyoU6dO6ZVXXlGZMmW0ZcsWDR48WH/88YfdRVLdunVTTEyMWrZsqe7du+vmzZvatGmTtm7dqtq1a+vzzz+39U2vfeLEiSpatKgkqVixYnbb/ve//63g4GBdvXpV8+bN07///W8FBASoW7dukqSDBw+qQYMG8vb21sCBA5U3b159/PHHatSokTZs2KBHH330rvt1+fJllSpVSk8++aS8vb114MABTZs2TadO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
"text/plain": [
"<Figure size 800x600 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAsAAAAIeCAYAAAC1G7mwAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAABMg0lEQVR4nO3deVxUZf//8feIAioOiLK5o7jhlluKmiuKhrl3Z1maaaZpbplLuZthtpiWW5t0d+ttWZYl5ZKmlaK57/q1wnADNQPEFAXO749+zO0IKoMzYp7X8/GYR8x1rjnnc86M+u7iOtdYDMMwBAAAAJhEgfwuAAAAALiTCMAAAAAwFQIwAAAATIUADAAAAFMhAAMAAMBUCMAAAAAwFQIwAAAATIUADAAAAFMhAAMAAMBUCMAAgGxSU1P11ltv2Z4nJSVp7ty5+VfQbTp27JgsFotef/31/C7F5SZPniyLxWLXVqFCBT355JP5UxBwFyIAA04SHR0ti8Wi7du3Z9v23nvvyWKxqEuXLsrIyMiH6gDHFC5cWOPHj9fixYt1/PhxTZ48WV9//XV+l3XPOXjwoCZPnqxjx47ldymAqRTM7wKAe90XX3yhQYMG6YEHHtDSpUvl5uaW3yUBt+Tm5qYpU6aod+/eyszMlNVqVUxMTH6Xdc85ePCgpkyZopYtW6pChQouO86RI0dUoABjXkAWAjDgQhs2bNCjjz6q0NBQff311/L09MzvkoBce/755/XII4/o+PHjql69unx8fPK7pHvG5cuX5e7ufseO5+HhcceOBfwT8L+DgIvs3r1bnTt3VlBQkFavXi1vb+9sfZYtW6b69eurcOHCKlmypB5//HGdPHkyx/1ZLJYcH9f+6tRisWjy5Ml2r3vttddksVjUsmVLW1tOcwSlnOcJJiUlafjw4Spbtqw8PDwUEhKiV199VZmZmXb9MjMzNXv2bNWqVUuenp7y8/NT+/btbVNCblR/1iOrvg0bNti1e3h4qEqVKoqKipJhGHbH3LVrlzp06CCr1SovLy+1adNGW7ZsyfH6XevIkSNq3bq1AgMD5eHhobJly2rgwIE6f/68rU9WHZ999lm213t5edldp/Pnz2vUqFGqVauWvLy8ZLVa1aFDB+3Zs8fudc6+7jeb11qzZk279zzrfDZs2GDXLzIyMtvn5to6y5Qpo7CwMBUsWFCBgYE57uNGWrZsmeN7ff1nVPrfFKIbfS6y7Nq1S+3bt5efn59dv44dO+aqJkl69913ValSJXl4eKhhw4batm1btj6HDx9Wjx495OvrK09PTzVo0EBfffWVXZ/cvu9Z137p0qUaP368SpcurSJFimjOnDl6+OGHJUmtWrWynUtur68k/fTTT2rYsKE8PT1VqVIlLVy4MMd+13/Grl69qilTpqhy5cry9PRUiRIl1KxZM61du9Zl10GS3n77bdWoUUNFihRR8eLF1aBBAy1ZssSuz8mTJ/XUU08pICBAHh4eqlGjhj788MNcXxMgNxgBBlzg119/Vfv27eXh4aHVq1crKCgoW5/o6Gj17dtXDRs2VFRUlBITEzV79mxt2rRJu3btynG0rWvXrurWrZsk6ccff9S777570zqSkpIUFRWV5/P466+/1KJFC508eVLPPPOMypUrp82bN2vcuHE6ffq03U1S/fr1U3R0tDp06KD+/fsrPT1dP/74o7Zs2aIGDRro448/tvXNqn3WrFkqWbKkJCkgIMDu2C+++KKqV6+uS5cu6ZNPPtGLL74of39/9evXT5J04MABPfDAA7JarRo9erQKFSqkhQsXqmXLltq4caMaNWp0w/O6ePGiypQpo4ceekhWq1X79+/X3LlzdfLkyTzNc/3tt9/05Zdf6uGHH1ZwcLASExO1cOFCtWjRQgcPHlSpUqUc2p8j1/12/PDDD/rmm29y1feNN95QYmKiw8coU6aM7TOYmpqqQYMG3bT/tZ+J6dOn221LTk5Whw4dZBiGRo4cqbJly0qSRowYket6lixZogsXLuiZZ56RxWLRzJkz1a1bN/32228qVKiQpL8/W02bNlXp0qU1duxYFS1aVJ9++qm6dOmizz//XF27dpXk+Ps+bdo0ubu7a9SoUUpLS1O7du00dOhQzZkzx/Z5l2T7763s27dP7dq1k5+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NmzfP1ufChQt2537u3LlsfTw8PGw3GGVkZOiPP/6Ql5eXqlatqp07d9r6Ofu6Z/nrr7+y1Xir1UaWL1+ubdu2acaMGTftJ/09cunt7a2hQ4fesu+1Ll++nOt577n5jF+4cEGSVKJECYfquNYjjzyi4sWL254/8MADkv4exZT+/nX++vXr9a9//cvuvf/jjz8UERGho0eP2qYp5fZ9z9KnTx8VLlw4z7VfKyMjQ6tXr1aXLl1Urlw5W3v16tUVERFxy9f7+PjowIEDOnr0aI7bXXEdfHx8dOLEiRynnEiSYRj6/PPP9dBDD8kwDLvPc0REhJKTk3O8rkBeMAUCcLLz589r6dKl6tq1qw4ePKhhw4apXbt2dnOAf//9d0lS1apVs72+WrVq+umnn+zakpKSJClbkL2ZSZMmqVSpUnrmmWeyzWMNCwuTxWLRuHHj9PLLL9v2e/283qNHj2rv3r3y8/PL8RhnzpyR9PeUj1KlSsnX1zfX9d1Kly5dbD8XKFBA48ePV/fu3SVJZ8+e1V9//ZXj9atevboyMzN1/Phx1ahR46bHiIiI0NatWyVJ7du31yeffJKtz1NPPXXLWrPmP8+bN09xcXF24fPasObs655l0qRJOf7Px41+FZ6RkaEXX3xRvXr1Uu3atW96bnFxcVq4cKHmz5/v8E2c586dU+XKlXPVNzef8QYNGqhQoUKaPHmySpYsaZsCcf31u5lrw6IkWxj+888/JUm//PKLDMPQhAkTNGHChBz3cebMGZUuXTrX73uW4ODgXNd5K2fPntWlS5dyvL5Vq1a
"text/plain": [
"<Figure size 800x600 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAsAAAAIrCAYAAADhrC+uAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAABUpElEQVR4nO3deVxU9f7H8feAMqIC5sJiIpK4oai5XMV9IdE0Na3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2K/3/9+J///ufHnnkEfn5+alcuXJ65ZVXZBiGTp48qS5dusjX11eBgYGaPn263f2vXr2qsWPHqn79+vLz81OJEiXUvHlzffPNN3Z117+WZsyYocqVK8tqtergwYO2Hg4ePKjevXvrrrvusv0ydKPXdEGeF0l6//33VblyZXl7e+sf//iHNm/eXKDnBbgdTIEAXOzYsWNq3769rFar1qxZo6CgoDw18+fP1+OPP66GDRsqNjZWZ8+e1cyZM7Vlyxbt2rVLpUqVynOfBx98UN26dZMkbd68We+///5N+0hNTVVsbOxtn8elS5fUsmVLnTp1SgMGDFDFihX13XffafTo0Tpz5ozdm6T69eun+fPnq0OHDnryySeVlZWlzZs3a+vWrWrQoIE+/fRTW21u72+99ZbKli0rSQoICLB77Jdeekk1atTQ5cuXtWjRIr300kvy9/dXv379JEkHDhxQ8+bN5evrqxdffFFFixbVe++9p1atWmnjxo1q1KjRDc/r4sWLqlChgh544AH5+vpq//79mj17tk6dOnVb81x/+uknrVixQg8//LBCQ0N19uxZvffee2rZsqUOHjyo8uXLO3Q8R573P2PTpk3673//W6Da6dOn6+zZsw4/RoUKFWyvwYyMDA0aNOim9de/JiZPnmy3Ly0tTR06dJBhGBoxYoSCg4MlScOHDy9QLwMGDLD9uxs6dKgSExP1zjvvaNeuXdqyZYuKFi2qHj16KCYmRt9//70aNmxou++JEye0detWTZs2zTY2efJkvfLKK/rnP/+pJ598UufOndPbb7+tFi1a5Pk3/Ouvv6pDhw7q2bOnHnnkkTyv91vp0aOHatSooSlTpiguLk6vvvqqSpcurffee09t2rTR66+/rgULFuj5559Xw4YN1aJFC0lSenq6PvzwQ/Xq1UtPPfWULly4oI8++kjR0dHavn276tata/c48+bN05UrV9S/f39ZrVaVLl3atu/hhx9WlSpV9Nprr+X5ZfR6BX1ePvroIw0YMEBNmjTRsGHD9NNPP6lz584qXbq07XsLOJUBwOnmzZtnSDJWrlxpVK5c2ZBktGvXLt/aq1evGv7+/katWrWMy5cv28ZXrlxpSDLGjh1rV3/t2jVDkj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qVqwo6ffnLycnR//85z/tjhcYGKgqVarkmWJgtVr1+OOPO9x3rieffNL2taenpxo0aCDDMGx/EZGkUqVKqVq1avrpp5/sar28vCT9PgXk/PnzysrKUoMGDexem7m6d++ucuXK5dvDwIEDb9lnQZ+X3J+BAwcOtPUn/f7zM7/pYoAzMAUCcKHz58/r888/14MPPqiDBw/q2WefVbt27ex+qJ84cUKSVK1atTz3r169ur799lu7sdTUVEnKE2RvZty4cSpfvrwGDBiQZx5rZGSkLBaLRo8erVdffdV23D/O6z169Kj27t17w/8QU1JSJP0+5aN8+fJ2fy79s7p27Wr72sPDQ2PGjFH37t0lSefOndOlS5fyff5q1KihnJwcnTx5UjVr1rzpY0RHR2vbtm2SpPbt22vRokV5ap544olb9po7//ndd99VYmKiXfi8Pqw5+3nPNW7cuHx/+bjRn9mzs7P10ksvqU+fPqpdu/ZNzy0
"text/plain": [
"<Figure size 800x600 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAsAAAAJ4CAYAAABrtlX3AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAABrpklEQVR4nO3deVRU9ePG8WdAQRQBSRBNRRQ3XHItcd8SlyLTFpdS0zJNM8VM/VaumVvlkpatWrlmaZqWG+WO5m7uSyhuoGWIuIDA/f3RcX5NoDE2w6D3/TpnznHu/czMM8OUj5fP/VyLYRiGAAAAAJNwc3UAAAAAICdRgAEAAGAqFGAAAACYCgUYAAAApkIBBgAAgKlQgAEAAGAqFGAAAACYCgUYAAAApkIBBgAAgKlQgAEADpWcnKzJkydb7ycmJmr69OmuC3QXGzFihCwWi37//XdXRwHuKRRgIBeYNWuWLBaLtm/fnmnfJ598IovForZt2yo9Pd0F6QD7eHl56Y033tCcOXN06tQpjRgxQt9//72rY5nag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jr2ZfdKkSSpcuLAkqUiRIjav/b///U8VK1bUtWvXtGDBAv3vf/9TYGCgevToIUnav3+/GjRoIB8fH7322mvKmzevPvroIzVu3Fjr1q3TQw89dMv3deXKFRUvXlyPPvqofHx8tG/fPk2fPl1nzpy5o3muv/32m7777js9+eSTCgkJUUJCgj766CM1atRIBw4cULFixex6Pns+9/9i/fr1+uGHH7I19t13381WUfun4sWLW7+DycnJ6t27923H//07MWbMGJt9ly5dUqtWrWQYhqKiolSiRAlJ0oABA/41R4MGDTRv3jzr/YsXL2r//v1yc3PThg0bVLVqVUl/fTcDAgJUsWJFSfZ/z1566SUFBARo2LBhtzwCfPz4cTVt2lT+/v5avXq19f3eTsOGDdWvXz9NnTrV+t+GJFWsWFHPPvusvvzyS61cudLmHwLx8fH66aefNHz4cJvnWrdunRYsWKB+/frJ09NTH3zwgVq2bKlffvlFlStXliQlJCSoTp061sIcEBCgH3/8UT169FBSUpL69+//r5kBpzMAuNzMmTMNScayZcuMMmXKGJKMFi1aZDk2NTXVCAwMNCpXrmxcu3bNun3ZsmWGJGPYsGE242/cuGFIMkaOHJnp9WJjY63bJBnDhw+33n/ttdeMwMBAo2bNmkajRo2s20eOHGlIMjIyMmxeJzg42Ojatav1/ujRo40CBQoYR44csRk3ZMgQw93d3YiLizMMwzB++uknQ5LRr1+/TO/1n69xq+w3/fzzz4Yk4+eff7Zuu379uuHm5ma89NJL1m1t27Y1PDw8jOPHj1u3nT171ihYsKDRsGHDTM/7b1566SXD29s7U46FCxdmGlugQAGbz+n69etGenq6zZjY2FjD09PTGDVqlHWboz/32NhYQ5IxceLETBkrVapk8zPP6nN96KGHjFatWmX63gwfPtz4+18t58+fNwoWLGgd+/fnuJ26desalStXtt6/cOFCpte66ZNPPjEkGSdPnrRua9Sokc17WLlypSHJmDdvns1jg4ODjTZt2tw2y8KFCw1JxoEDBwzDMIylS5canp6eRmRkpPH0009bx1WtWtV4/PHHrfez+z27+Z2uX7++kZaWZvPaNz/PCxcuGAcPHj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mzevRowYoV27dt3y88tKkSJFVLZsWWvZ3bBhgxo0aKCGDRvq7Nmz+u2337Rp0yZlZGRYC/CdfM/+WTb/7tFHH1XBggW1cuVK+fj4/Gtme3Tp0kXXrl3T4sWLJf01z33Hjh169tlnM40tW7Zspm3lypXT1atXdeHCBV24cEGJiYn
"text/plain": [
"<Figure size 800x600 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAsAAAAI/CAYAAAB5628jAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAABUZ0lEQVR4nO3deVhUdf//8dcAgqgsoiKYiIgb7ommZO57LrnUfWuWuHSrJVlauZS7pWaZS5rWXbe2WJpmWlpuuOb2M9dcMjXMFTcExAUFzu+PLubbBCqDMw52no/rmutiPuc9Z95nHOHF4XM+YzEMwxAAAABgEm6ubgAAAAC4nwjAAAAAMBUCMAAAAEyFAAwAAABTIQADAADAVAjAAAAAMBUCMAAAAEyFAAwAAABTIQADAADAVAjAAGBSKSkpmjp1qvV+YmKiZs6c6bqGHlDHjx+XxWLR3Llz71rbo0cPlS5d2uk9AbgzAjBgh7lz58pisejnn3/Osu2///2vLBaLOnTooPT0dBd0B9jH29tbw4cP17x583Ty5EmNHj1a33//vavbuicWi8Xm5uvrq4YNG2r58uWubu0f64cfftDo0aNd3QZgFw9XNwD8E3z77bd6/vnnVb9+fc2fP1/u7u6ubgm4K3d3d40ZM0bdu3dXRkaGfH19/xFBsXnz5urevbsMw9Aff/yhWbNmqV27dvrxxx/VsmVLhz9faGiorl+/rnz58jl83w+CH374QTNnziQE44FCAAbu0fr169W1a1dVqlRJ33//vfLnz+/qloAce+WVV/Tvf/9bJ0+eVEREhPz9/V3d0j0rX768nnnmGev9zp07q1KlSpo2bZpTArDFYuH/PfCAYQoEcA/27NmjJ554QsHBwVq5cqX8/Pyy1CxcuFCRkZHy9vZW0aJF9cwzz+j06dPZ7u/vf77NvB0/ftym5u9nWt555x1ZLBY1atTIOjZ69GhZLJYsz1G6dGn16NHDZiwxMVEvv/yyQkJC5OXlpbJly+rtt99WRkaGTV1GRoamTZumqlWrKn/+/CpWrJhatWplnRJyu/4zb5n9rV+/3mbcy8tL5cuX14QJE2QYhs1z7t69W61bt5avr68KFSqkpk2batu2bdm+fn91+PBhNWnSREFBQfLy8lJISIj69eunhIQEa01mH4sWLcry+EKFCtm8TgkJCXr11VdVtWpVFSpUSL6+vmrdurX27t1r8zhHv+6Z80vffffdLPusUqWKzb955vGsX7/epq5NmzZZ3jd/7bNkyZKKioqSh4eHgoKCst3H7TRq1Cjbf+vszgZmTiG63fsi0+7du9WqVSsVK1bMpq5t27Y56unvIiIiVLRoUR07dsxmPDU1VaNGjVLZsmWt75HBgwcrNTXVpm716tV67LHH5O/vr0KFCqlChQp6/fXXrdtvNwd4yZIlqlKlivLnz68qVaro22+/zba/jIwMTZ06VZUrV1b+/PlVvHhx9e3bV5cvX7apK126tNq2bauffvpJjzzyiPLnz68yZcros88+y7LPxMREDRw4UKVLl5aXl5dKliyp7t276+LFi3Yf/5306NHDOm/8r/9WhmGodOnSeuKJJ7I85saNG/Lz81Pfvn0l/d/7dsGCBXr99dcVFBSkggULqn379jp58mSWx2/fvl2tWrWSn5+fChQooIYNG2rz5s057hmQOAMM5NqxY8fUqlUreXl5aeXKlQoODs5SM3fuXPXs2VO1a9fWhAkTdO7cOU2bNk2bN2/W7t27sz3b1rFjR3Xq1EmStGnTJn300Ud37CMxMVETJkzI9XFcu3ZNDRs21OnTp9W3b1+VKlVKW7Zs0bBhw3T27Fmbi6R69+6tuXPnqnXr1nruueeUlpamTZs2adu2bapVq5Y+//xza21m71OmTFHRokUlScWLF7d57tdff10RERG6fv269YdfYGCgevfuLUk6cOCA6tevL19fXw0ePFj58uXThx9+qEaNGmnDhg2qU6fObY/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nnn41WrVpleQ0///xzw83Nzdi0aZPN42fPnm1IMjZv3mwYhmFMmTLFkGRcuHDhts+Z+W80Z84c61iNGjWM4OBgIzEx0Tq2atUqQ5IRGhpqHdu0aZMhyZg3b57NPlesWJFlPDQ01JBkbNy40Tp2/vx5w8vLy3jllVesYyNHjjQkGYsXL87Sa+b7MqfHnxP9+/c3sosThw8fNiQZs2bNshlv3769Ubp0aWsvme/bhx56yEhOTrbWff3114YkY9q0adbey5UrZ7Rs2dLm/9e1a9eMsLAwo3nz5jnuGWAKBJALPXr00MmTJ/X0009r1apVWrhwYZaan3/+WefPn9cLL7xgMz+wTZs2qlixYpaLjW7evClJ8vLyynEfp0+f1vvvv68RI0aoUKFCNtsCAwMlSadOnbrjPhYuXKj69eurcOHCunjxovXWrFkzpaena+PGjZKkb775RhaLRaNGjcqyj+z+5J8TSUlJunjxok6cOKFJkyYpIyNDTZo0kSSlp6dr1apV6tChg8qUKWN9THBwsJ5++mn99NNPSk5OztFznDt3TrGxsVq+fLkaNGiQpebKlSs2x/7XPxNn8vLykpubm7W3S5cuWf8cvmvXLmudo1/3TNeuXcvS491WG1m8eLF27NihiRMn3rFOksaNGyc/Pz8NGDDgrrV/dePGjRzPf83Je/zKlSuSpCJFitjVx1998sknKlasmAIDA1WrVi3FxsZq8ODBGjRokLVm4cKFioiIUMWKFW1e08z337p16yTJ+leapUuXZpkSdDtnz57Vnj17FB0dbTMtqnnz5qpUqZJN7cKFC+Xn56fmzZvb9BEZGalChQpZ+8hUqVIl1a9f33q/WLFiqlChgn7//Xfr2DfffKPq1aurY8eOWXrL/L+a0+O/F+XLl1edOnU0b94861hCQoJ+/PFHdevWLcv3je7du8vHx8d6/8knn1RwcLD1Lxh79uzRkSNH9PTTT+vSpUvWnq9
"text/plain": [
"<Figure size 800x600 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAArcAAAIjCAYAAAAZajMiAAAAOXRFWHR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6uhqLFy/GgAEDsGPHjnP+aU0g3x933HEHhg0b5n3NDTfcgHHjxmH8+PHeYwkJCfVeY8KECdi7dy/uueceZGRkoLi4GOvWrUN+fj4yMjKwYMEC3HPPPTCbzd5/TCYlJfmc484770RCQgJmzZqFqqoqAJ5/cM6ePRvDhg3DX/7yFxw4cACLFy/GDz/8gM2bN9c7ALBixQpcc801uO666/DWW29Bo9Fg79696N+/P9LS0jB9+nSEh4fjo48+wtVXX41PPvkE48aNO6fPlagWQUQB69ixowDg/XXjjTcKp9PpU1NdXV3rdXfccYcICwsTNpvNe2zgwIFi4MCBPnV/+9vfBABRXFzsPQZAPP74497HjzzyiEhMTBS9evXyef1bb70lAIgXX3yx1vUVRRFCCJGXlycAiKVLl3qfmzhxoujatatIT08XN910k/f40qVLBQAxefJk0a1bN+/xqqoqERkZKa6//noBQPzwww9CCCEcDodITEwUXbt2FVar1Vu/YsUKAUDMmjXLe+zyyy8XERER4siRI3X2ebY2bdr49HamgQMHii5dutT5nD91/V3NnTtXSJLk01u/fv1Er169fOq+//57AUC8++67Qggh7Ha7iIuLE3369PH5mnj77bcFgFp/1w0pLCwUWq1WXH311T7Hn3jiCQHA57PYsGGDACA2bNjgPVbf53X211wgXzPLly8XAMRTTz3l8/w111wjJEkSOTk5QgghXnrpJQFAnDhxot739c9//lPIsiy+/vprn+NLliwRAMTmzZvrfe3ZHn/8cXHm/8IOHz4sNBqNePrpp33qfvrpJ6HVar3HFUURaWlpYsKECT51H330kQAgNm3aJIQQorKyUkRHR4vbb7/dp66wsFBERUX5HD+7l7qcy/fHmc7+/m/IqVOnBADx3HPPNVjXpUuXOr8ea77nBwwYIFwul/d4cXGx0Ov1Yvjw4cLtdnuPv/rqqwKAeOutt7zHzvx+/OSTT4ROpxO33367z+uGDh0qunXr5vPfQ0VRxKWXXirat28f0HslaginJRCdg6VLl2LdunV4//33cdttt+H999/3GU0EAJPJ5P1zZWUlSkpKcNlll6G6uho///yzT63T6URJSQlOnDiBLVu24NNPP0X37t0RHx9f5/ULCgrwyiuvYObMmTCbzT7PffLJJ4iPj8c999xT63X1LVO0fft2fPzxx5g7d67P1Ioz3XDDDfj555+90w8++eQTREVFYejQoT5127ZtQ3FxMe68804YjUbv8dGjR6NTp074/PPPAQAnTpzApk2bcOutt/qMeDfUpz9utxslJSUoKSmBw+EI+HVn/l1VVVWhpKQEl156KYQQ2LFjh/e56667Dtu3b/f5Uf2yZctgMBgwduxYAJ73f/LkSdx+++3Qan/7odiUKVO8I7uBWr9+PVwuF+68806f43X93Z6PQL5mVq5cCY1Gg3vvvdfn+QcffBBCCKxatQoAvKPyn332Wb0riHz88cfo3LkzOnXq5P37KikpwZAhQwAAGzZsaPR7+c9//gNFUTBx4kSfcycnJ6N9+/bec0uShGuvvRYrV66ExWLxvn7ZsmVIS0vDgAEDAHimWJSVlWHy5Mk+59NoNOjbt+859xro98f5MJlM0Ov12Lhxo89UmXN1++23e0evAeCLL76Aw+HA/fff7/Pfidtvvx2RkZF19v7hhx/iuuuuwx133IG///3v3teVlpbiyy+/xMSJE73/fSwpKcHJkyeRnZ2NQ4cO1TmNiehcMNwSnYN+/fph2LBhuP766/GPf/wDc+bMwdKlS31+9Lp
"text/plain": [
"<Figure size 800x600 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAq4AAAIjCAYAAADC0ZkAAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAABmPUlEQVR4nO3deXhU9d3//9c5syeTPSQhEHYRFdGKiriiItStWmmtS6ui33q3N9oqd1u1VgWXG1vbauu+FXvfyq21LfprqywqS7VoFYuICxUEQQiEANkns53z+2OSkSEJjMwkh5Dn47pyhfmcd855Z/C6fPGZz/kcw7ZtWwAAAMB+znS6AQAAACAdBFcAAAD0CgRXAAAA9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qMbGRi1cuFCrVq3S8OHDOz3fmjVr9Pjjj3d5PZfLpaefflrXX399cmz27Nny+/1qbW1NqX3qqac0depUHXPMMZo1a5a2bt2q3/zmN3rjjTf0r3/9S4WFhZKklStX6qSTTpLH49HVV1+tIUOGaO3atfrLX/6iu+66SxdccIFGjBiRPO/111+vQw45RFdffXVy7JBDDumy5y9j586dOuuss3ThhRfq4osv1h/+8Ad9//vfl9fr1ZVXXplSO2vWLAUCAd14441as2aN7r//fnk8HpmmqZ07d2rGjBl688039dRTT2no0KG69dZbv1Qvtm3ra1/7mhYtWqSrrrpKRx55pObPn68f//jH2rRpk+69915J0v/+7/8mf+bvf/+7HnvsMd17770qLS2VJJWXl3d5jQ8++EDnnHOOxowZo9tvv10+n09r1qzRG2+8ISnxvt5+++269dZbdfXVV+ukk06SJB1//PHJc2zfvl1nnnmmLrroIn37299WeXm5QqGQJkyYoDVr1uiaa67R0KFD9fzzz+uKK65QXV2dfvjDH3baTzwe15VXXqnnnntOc+fO1dlnny1Juuuuu3TLLbfowgsv1P/7f/9P27Zt0/3336+TTz455b8lAGmwAfRJBx98sC0p+XXZZZfZ0Wg0paalpaXDz/3Hf/yHnZOTY7e2tibHTjnlFPuUU05JqfvpT39qS7JramqSY5Ls2267Lfn6Jz/5iV1WVmaPHTs25ed/97vf2ZLsX//61x2ub1mWbdu2vW7dOluSPXv27OSxCy+80B49erRdVVVlX3755cnx2bNn25Lsiy++2D788MOT483NzXZ+fr59ySWX2JLst99+27Zt245EInZZWZk9evRoOxQKJev/+te/2pLsW2+9NTl28skn23l5efZnn33WaZ+7Gzx4cEpvuzrllFPsww47rNNje3PKKafYkuxf/epXybFwOGwfeeSRdllZmR2JRGzbtu1FixbZkuzRo0cnx2zbti+++GLbMAz7zDPPTDnv+PHj7cGDB6f9O7R74YUXbEn2nXfemTL+jW98wzYMw16zZk2Hn2n/e1q3bl0av7Ft33vvvbYke9u2bV3WvP322x3+O2nX/p498sgjKeP33XefLcl++umnk2ORSMQeP368H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Z1OOeUU5efn6/bbb9fw4cPl9/v17rvv6oYbbugQDsaMGaNf/epXkhIzkb/97W81YcIEvfvuu6qoqEip/eijj/TUU0/p6aef7vJmsS9jwYIFeuWVV7Rs2bK91l555ZW67LLLdO2112rp0qV64okn9Pe//z3jHrJlyJAhyXW627dv129/+1t95zvf0bBhw3Tcccdl7Toul+tLjdu73FC1vwgEAlq6dKkWLVqkv/3tb5o3b56ee+45nXbaaVqwYEGXv8vu58jU5MmTNW/ePP3iF7/QhAkTUmbpLcuSYRh6+eWXO+1n908bAOwZwRWAJCkUCkn6IrgsXrxY27d
"text/plain": [
"<Figure size 800x600 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAsAAAAKLCAYAAAD4sD5AAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAABvjklEQVR4nO3deXRM9+PG8WcSWQRJbFlUBLFHbKGaql0TS6mlrbW0pZbaSquqVXuttVVbLV9LtZRSpS21hKC1FbHvexShKJEgJLm/P3rMr9MEmZgYMu/XOXOO+dxPZp5JRjzufO69JsMwDAEAAAAOwsneAQAAAIBHiQIMAAAAh0IBBgAAgEOhAAMAAMChUIABAADgUCjAAAAAcCgUYAAAADgUCjAAAAAcCgUYAAAADoUCDAAOKj4+XpMmTTLfv3r1qj7//HP7BcpiTCaTevTocd85p06dkslk0uzZsx9NKACSKMCAVWbPni2TyaTt27en2jZ9+nSZTCY1bdpUycnJdkgHWCd79uwaOHCg5s6dqzNnzmjIkCH6+eef7R0Lj6lNmzZpyJAhunr1aoYf44svvqDs47GQzd4BgKzgxx9/VLdu3VS9enXNnz9fzs7O9o4EPJCzs7OGDh2q9u3bKyUlRZ6enlq2bJm9YzmUwMBA3bx5Uy4uLvaO8kCbNm3S0KFD9dprr8nb2ztDj/HFF18oX758eu2112yaDbAWBRh4SOvWrVPr1q1VpkwZ/fzzz3J3d7d3JCDd3nnnHbVs2VJnzpxR6dKlM1xskDEmk4nfGYAdsAQCeAi7du3Siy++KH9/f61cuVJeXl6p5ixcuFChoaHKnj278uXLp3bt2uns2bNpPp7JZErzdurUKYs5Q4YMsfi6cePGyWQyqVatWuaxIUOGyGQypXqOwoULp9r7cvXqVb399tsKCAiQm5ubihUrpjFjxiglJcViXkpKiiZPnqyQkBC5u7srf/78ql+/vnlJyL3y373dzbdu3TqLcTc3N5UoUUKjRo2SYRgWz7lz5041aNBAnp6eypkzp+rWrastW7ak+f37t8OHD6tOnTry8/OTm5ubAgIC1LVrV125csU8526ORYsWpfr6nDlzWnyfrly5onfffVchISHKmTOnPD091aBBA+3evdvi62z9fb+7RvSTTz5J9Zhly5a1+JnffT3r1q2zmNeoUaNU75t/5yxYsKDCwsKULVs2+fn5pfkY91KrVq00f9b/fY9K/7+E6F7vi7t27typ+vXrK3/+/BbzXnjhhQfmmT9/vkJDQ5UrVy55enoqJCREkydPTpXh999/V69evZQ/f355e3urS5cuun37tq5evar27dsrd+7cyp07t957771U78mEhAS988475p9byZIl9cknn6Sal5YRI0bIyclJU6ZMkZT2GuDXXntNOXPm1NmzZ9W0aVPlzJlT+fPn17vvvptqedXly5f16quvytPTU97e3urQoYN2796doXXFU6ZMUXBwsDw8PJQ7d25VrlxZ8+bNk/TP+6Vfv36SpCJFiqT63TRr1izVqVNHPj4+cnNzU5kyZTR16lSLxy9cuLD279+v9evXp/rZ3+vvzd2f179/B27fvl0RERHKly+fsmfPriJFiuiNN96w6rUC7AEGMuj48eOqX7++3NzctHLlSvn7+6eaM3v2bL3++uuqUqWKRo0apQsXLmjy5MnauHGjdu7cmebetmbNmql58+aSpN9++03Tpk27b46rV69q1KhRGX4dN27cUM2aNXX27Fl16dJFhQoV0qZNmzRgwACdP3/e4iCpjh07avbs2WrQoIE6deqkpKQk/fbbb9qyZYsqV66sb775xjz3bvaJEycqX758kiRfX1+L5/7ggw9UunRp3bx5UwsWLNAHH3wgHx8fdezYUZK0f/9+Va9eXZ6ennrvvffk4uKir776SrVq1dL69etVtWrVe76uhIQEFSxYUI0bN5anp6f27dunzz//XGfPns3QOtcTJ05oyZIlevnll1WkSBFduHBBX331lWrWrKkDBw6oQIECVj2eNd/3h7FhwwYtX748XXPHjx+vCxcuWP0cBQsWNL8H4+Pj1a1bt/vO//d74uOPP7bYdu3aNTVo0ECGYahv374KCAiQJPXp0+eBOVavXq3WrVurbt26GjNmjCTp4MGD2rhxo3r37m0xt2fPnvLz89PQoUO1ZcsWTZs2Td7e3tq0aZMKFSqkkSNHavny5Ro3bpzKli2r9u3bS5IMw1CTJk0UFRWljh07qkKFClq5cqX69euns2fPauLEiffMN3DgQI0cOVJfffWV3nzzzfu+luTkZEVERKhq1ar65JNPFBkZqfHjxysoKMj8/U1JSVHjxo31xx9/qFu3bipVqpSWLl2qDh06PPB79V/Tp09Xr1699NJLL6l37966deuW9uzZo61bt6pNmzZq3ry5jhw5ou+++87i55c/f35J0tSpUxUcHKwmTZooW7Zs+vnnn/XWW28pJSVF3bt3lyRNmjRJPXv2VM6cOfXhhx9KSv074UEuXryo8PBw5c+fX++//768vb116tQpLV682OrXDAdnAEi3WbNmGZKMX375xQgKCjIkGeHh4WnOvX37tuHj42OULVvWuHnzpnn8l19+MSQZgwYNsph/584dQ5IxdOjQVM938uRJ85gkY/Dgweb77733nuHj42OEhoYaNWvWNI8PHTrUkGSkpKRYPE9gYKDRoUMH8/3hw4cbOXLkMI4cOWIx7/333zecnZ2NmJgYwzAMY+3atYYko1evXqle63+f417Z74qKijIkGVFRUeaxW7duGU5OTsZbb71lHmvatKnh6upqHD9+3Dx27tw5I1euXEaNGjVSPe6DvPXWW0bOnDlT5Vi4cGGquTly5LD4Pt26dctITk62mHPy5EnDzc3NGDZsmHnM1t/3kydPGpKMcePGpcoYHBxs8TNP6/tatWpVo0GDBqneN4MHDzb+/U/AxYsXjVy5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": [
"<Figure size 800x600 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"import matplotlib.pyplot as plt\n",
"# Список колонок для построения графиков\n",
"columns = ['gender', 'age', 'hypertension', 'heart_disease', 'ever_married',\n",
" 'work_type', 'Residence_type', 'avg_glucose_level', 'bmi',\n",
" 'smoking_status']\n",
"\n",
"# Создание диаграмм зависимости\n",
"for column in columns:\n",
" plt.figure(figsize=(8, 6)) # Установка размера графика\n",
" if pd.api.types.is_numeric_dtype(df[column]): # Проверяем, является ли колонка числовой\n",
" # Проверяем, содержит ли колонка только два уникальных значения (0 и 1)\n",
" if df[column].nunique() == 2 and set(df[column].unique()).issubset({0, 1}):\n",
" # Если да, то строим столбчатую диаграмму\n",
" counts = df[column].value_counts() # Считаем количество повторений каждого значения\n",
" counts.plot(kind='bar') # Создаем столбчатую диаграмму\n",
" plt.title(f'Количество значений для {column}')\n",
" plt.xlabel(column)\n",
" plt.ylabel('Количество повторений')\n",
" else:\n",
" # Если колонка числовая, создаем диаграмму рассеяния\n",
" plt.scatter(df['stroke'], df[column], alpha=0.5) # Создаем диаграмму рассеяния\n",
" plt.title(f'Зависимость {column} от stroke')\n",
" plt.xlabel('stroke (0 = нет, 1 = да)')\n",
" plt.ylabel(column)\n",
" plt.xticks([0, 1]) # Установка меток по оси X\n",
" plt.grid() # Добавление сетки для удобства восприятия\n",
" else:\n",
" # Если колонка не числовая, строим столбчатую диаграмму\n",
" counts = df[column].value_counts() # Считаем количество повторений каждого значения\n",
" counts.plot(kind='bar') # Создаем столбчатую диаграмму\n",
" plt.title(f'Количество значений для {column}')\n",
" plt.xlabel(column)\n",
" plt.ylabel('Количество повторений')\n",
"\n",
" plt.show() # Отображение графика"
]
},
{
"cell_type": "code",
2024-10-11 18:46:40 +04:00
"execution_count": 16,
2024-10-11 18:41:52 +04:00
"metadata": {},
"outputs": [],
"source": [
"# Функция для создания выборок\n",
"from sklearn.model_selection import train_test_split\n",
"\n",
"def split_stratified_into_train_val_test(\n",
" df_input,\n",
" stratify_colname=\"y\",\n",
" frac_train=0.6,\n",
" frac_val=0.15,\n",
" frac_test=0.25,\n",
" random_state=None,\n",
"):\n",
"\n",
" if frac_train + frac_val + frac_test != 1.0:\n",
" raise ValueError(\n",
" \"fractions %f, %f, %f do not add up to 1.0\"\n",
" % (frac_train, frac_val, frac_test)\n",
" )\n",
"\n",
" if stratify_colname not in df_input.columns:\n",
" raise ValueError(\"%s is not a column in the dataframe\" % (stratify_colname))\n",
"\n",
" X = df_input # Contains all columns.\n",
" y = df_input[\n",
" [stratify_colname]\n",
" ] # Dataframe of just the column on which to stratify.\n",
"\n",
" # Split original dataframe into train and temp dataframes.\n",
" df_train, df_temp, y_train, y_temp = train_test_split(\n",
" X, y, stratify=y, test_size=(1.0 - frac_train), random_state=random_state\n",
" )\n",
"\n",
" # Split the temp dataframe into val and test dataframes.\n",
" relative_frac_test = frac_test / (frac_val + frac_test)\n",
" df_val, df_test, y_val, y_test = train_test_split(\n",
" df_temp,\n",
" y_temp,\n",
" stratify=y_temp,\n",
" test_size=relative_frac_test,\n",
" random_state=random_state,\n",
" )\n",
"\n",
" assert len(df_input) == len(df_train) + len(df_val) + len(df_test)\n",
"\n",
" return df_train, df_val, df_test"
]
},
{
"cell_type": "code",
2024-10-11 18:46:40 +04:00
"execution_count": 17,
2024-10-11 18:41:52 +04:00
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"stroke\n",
"0 4861\n",
"1 249\n",
"Name: count, dtype: int64\n",
"\n",
"Обучающая выборка: (3066, 12)\n",
"stroke\n",
"0 2917\n",
"1 149\n",
"Name: count, dtype: int64\n"
]
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAeYAAADECAYAAABKgIJGAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dp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PTGQC2cOFCzbDExEQmEAjYN998ozXunTt3mFAo1BkeExPDALAff/xRM2zhwoWs/M9y/vx5BoDt2rVLa9yjR4/qDPf09GSDBw/WiX3atGns5Z/65djnzJnDHB0dWWBgoNY8/emnnxifz2fnz5/XGn/jxo0MALt48aJOe+UFBQVp6vv999+ZUChks2fP1lu2OvODsbLfqTy5XM5atmzJ+vTpo1UXn89nb731ls6yqP7NX7x4wSwtLVnnzp1ZUVGR3jJyuZw5Ojqyli1bapU5fPgwA8AWLFigGTZhwgTm6empVc/mzZsZAHblyhW908wYY9nZ2RUu4+W9vLyrqdfL7t27M4VCoRmelpbGxGIx69+/v9Y8CA8PZwDY1q1bNcOCgoJYQEAAY4yxiIgIJhKJ2OTJk7XG69u3L2vVqhUrLi7WDFOpVKxr167M19e30tjV6/G2bdu0hru6urJBgwZVOu6BAwcYALZ06VKt4SNHjmQ8Ho/FxsYyxv5eVvr27as1H9TzZ+3atZphXbp0YZ07d9aq79dff2UA2JkzZxhjjD1+/FhnPpVvp7yXl0nGGBswYABr0qSJ1rDy68Pt27cZj8djY8aM0SqzaNEiBoAdOnRIM0z
"text/plain": [
"<Figure size 200x200 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Контрольная выборка: (1022, 12)\n",
"stroke\n",
"0 972\n",
"1 50\n",
"Name: count, dtype: int64\n"
]
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAfMAAADECAYAAACLB8jqAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAAA3FElEQVR4nO3dd1xTVxsH8F8SQhIIyJ4iIKAooiiideJeWGsdaNWqtI46X0e1Wl9nbX2tWrGuauuq0NZB1dZWxb33nogKDvbeEEjO+wdNakhYClxinu/nw0dzc+45z115cs8994bHGGMghB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DgQQaALViwQDVt1KhRzNnZWa2ezZs3MwDsypUrWpeZMcbS0tJK3cdfV3J/V1Iel+3bt2dFRUWq6YmJiczQ0JD16NFDbR2sW7eOAWBbt25VTfP392deXl6MMcbCwsKYUChkY8eOVZuva9euzNvbm+Xn56umKRQK1rZtW+bh4VFm7MrjeNu2bWrTHRwcWJ8+fSo8r0KhYMOHD2dGRkbs8uXLauX279/PALClS5eqTR80aBDj8XjsyZMnqmkA2KRJkzTaCggI0NiGStr2RSXlNvD19WUymUw1/dtvv2UA2IEDBxhjldsmjFXsmCjrM1JbjFevXlWbru2zrH///szQ0JA9ffpUNS02NpaZmJiwjh07atQZFRXFGCv+7K9Xrx7r3bu31u1dWkzK+Rlj7PHjxwwA+/bbb1XTRo0axYyNjcusq+QyAGAA2KlTp1TTcnNzWaNGjZidnZ1qOwUHBzMALCQkRFVOJpOxNm3aMKlUqsolyvX
"text/plain": [
"<Figure size 200x200 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Тестовая выборка: (1022, 12)\n",
"stroke\n",
"0 972\n",
"1 50\n",
"Name: count, dtype: int64\n"
]
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAdEAAADECAYAAADArxsHAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAAA200lEQVR4nO3dd1gU1/oH8O82dpfeqwgIIopYgqJiwa6gIUYNMWpi18R2jSa5amIs0WuMxhJbNLFF/RkLscQbG3YJscTeEBAsSG/CUpbdPb8/uLthWUBAlnHh/TwPj+7smXPemZ2dd+fMnBkeY4yBEEIIIdXG5zoAQgghxFBREiWEEEJqiJIoIYQQUkOURAkhhJAaoiRKCCGE1BAlUUIIIaSGKIkSQgghNURJlBBCCKkhIdcBEEIIqd8KCwuRmZkJoVAIe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u9q6m/l126dGEKhUIzPTU1lRkZGbG+fftqrYN169YxAGzr1q2aaUFBQczX15cxxlh4eDgTiURswoQJWvP16tWL+fn5scLCQs00lUrFAgMDWdOmTSuNXf093rZtm9Z0Z2dnFhISUum8pZW3Pah98803zMTEhD169Ehr+uzZs5lAIGBPnz5ljDF25swZBoBNnz5dp47S+wM19fqNj4/XeW/16tUMANu1a5dmmlwuZ506dWKmpqaa/VBVl3/GjBkMgNb3LTc3l3l4eDB3d3fN56He1509e1ZTrkOHDiw4OFjnu12e8uYvLCxkfD6fTZ48WTNNvb7
"text/plain": [
"<Figure size 200x200 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"# Вывод распределения количества наблюдений по меткам (классам)\n",
"print(df.stroke.value_counts())\n",
"print()\n",
"\n",
"data = df.copy()\n",
"\n",
"df_train, df_val, df_test = split_stratified_into_train_val_test(\n",
" data, stratify_colname=\"stroke\", frac_train=0.60, frac_val=0.20, frac_test=0.20\n",
")\n",
"\n",
"print(\"Обучающая выборка: \", df_train.shape)\n",
"print(df_train.stroke.value_counts())\n",
"counts = df_train['stroke'].value_counts()\n",
"plt.figure(figsize=(2, 2))# Установка размера графика\n",
"plt.pie(counts, labels=counts.index, autopct='%1.1f%%', startangle=90)# Построение круговой диаграммы\n",
"plt.title('Распределение классов stroke в обучающей выборке')# Добавление заголовка\n",
"plt.show()# Отображение графика\n",
"\n",
"print(\"Контрольная выборка: \", df_val.shape)\n",
"print(df_val.stroke.value_counts())\n",
"counts = df_val['stroke'].value_counts()\n",
"plt.figure(figsize=(2, 2))\n",
"plt.pie(counts, labels=counts.index, autopct='%1.1f%%', startangle=90)\n",
"plt.title('Распределение классов stroke в контрольной выборке')\n",
"plt.show()\n",
"\n",
"print(\"Тестовая выборка: \", df_test.shape)\n",
"print(df_test.stroke.value_counts())\n",
"counts = df_test['stroke'].value_counts()\n",
"plt.figure(figsize=(2, 2))\n",
"plt.pie(counts, labels=counts.index, autopct='%1.1f%%', startangle=90)\n",
"plt.title('Распределение классов stroke в тестовой выборке')\n",
"plt.show()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Сбалансируем распределение:"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"1. Балансировка данных оверсемплингом. Это метод, увеличивающий число наблюдений в меньшинственном классе для достижения более равномерного распределения классов."
]
},
{
"cell_type": "code",
2024-10-11 18:46:40 +04:00
"execution_count": 18,
2024-10-11 18:41:52 +04:00
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
2024-10-11 18:46:40 +04:00
"Обучающая выборка после oversampling: (5830, 17)\n",
2024-10-11 18:41:52 +04:00
"stroke\n",
"0 2917\n",
2024-10-11 18:46:40 +04:00
"1 2913\n",
2024-10-11 18:41:52 +04:00
"Name: count, dtype: int64\n"
]
},
{
"data": {
2024-10-11 18:46:40 +04:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAosAAAH4CAYAAAAitKflAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAABZE0lEQVR4nO3dd3xT9eLG8SfpntAyyh4yBQQEAWWKIlNxI+BAuArOq8IdjquA8yr+BBRwXQcioqAC18EQRAVFQGXvVTaFAi0ddOb8/qjNbWgDbUn7TdLP+/XKC5px8iQ5OXnyPSM2y7IsAQAAAEWwmw4AAAAA70VZBAAAgFuURQAAALhFWQQAAIBblEUAAAC4RVkEAACAW5RFAAAAuEVZBAAAgFuURQAALoDD4VBiYqL27NljOgpQJiiLAJxsNpseeugh0zEASdKKFSv0ww8/OP/+4Ycf9PPPP5sLVMDRo0f16KOPqn79+goODla1atXUokULnT592nQ0wONKVBY//PBD2Ww25yk0NFRNmzbVQw89pISEhLLKCFQIK1asUL9+/VS7dm2FhoaqXr16uu666/TJJ584r5Oenq5x48a5fIAC/urAgQN64IEHtH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oLC5Mkff/99+rXr5/at2+vsWPHym6364MPPtBVV12l5cuXq2PHjoWmW6dOHb300kuSpNTUVN1///1F3vfTTz+tQYMG6Z577tHx48f1xhtvqHv37lq7dq0qV65c6DYjR45Ut27dJElffvml5s6d63L5qFGj9OGHH2r48OH661//qr1792rKlClau3atfv75ZwUFBRX5PJREUlKS87EV5HA4NHDgQK1YsUIjR47UxRdfrI0bN2rixInasWOH5s2bV6L7+eCDD/Svf/1L//d//+dctXq28z0fkydP1sCBA3X77bcrKytLn376qW699VZ9/fXXGjBggPN648eP17hx49S5c2c9++yzCg4O1qpVq/T999+rd+/ekvI++EaMGKGWLVvqiSeeUOXKlbV27VotXLjQmS//ue/QoYNeeuklJSQkaPLkyfr5558LvaZVq1bVxIkTJUkHDx7U5MmT1b9/fx04cKDI1z5f/fr1tXTpUh08eFB16tQp8jrVqlXTm2++qfvvv1833nijc3Vc/io6Ke+DuE+fPuratateffVVhYeHy7IsDRw4UMuWLdNf/vIXtW3bVosWLdLf//53HTp0yJm3KP/617/04osv6u2339a9994rSZoxY4aGDRumPn366OWXX1Z6errefPNNde3aVWvXri3WB/nEiRNVtWpVnT59Wu+//77uvfdeNWjQwO0qoO7du2vGjBnOv1944QVJcvmg6dy5s/P/ubm56tu3ry6//HK98sorWrhwocaOHaucnBw9++yzzuuZfG8VfCznW155eh4cN26cxo8fr169eun+++/X9u3b9eabb2rNmjUee9zu3HPPPZo+fbpuueUWjRkzRqtWrdJLL72krVu3FnqvF5STk1NksTiXbt26aeTIkXI4HNq0aZMmTZqkw4cPF+sLnDsnTpxQRkaG7r//fl111VW67777tHv3bk2dOlWrVq3SqlWrFBISIqlkr1tx59mCsrOzdfPNN2v//v36+eefVbNmTedlFzpvh4SEFPoSt2bNGr3++usu5xX3MW7YsEHdunVTUFCQRo4cqQYNGmj37t366quvnO/ngvJfO0naunWrXnzxRZfLPbEcmjlzpnr27KkaNWpo8ODBevzxx/XVV1/p1ltvPe9t80VGRurGG2/Ue++9py1btqhly5Ylmn79+vWd1+3SpYsCA93XssDAQL3zzjvq3LmznnvuOVWvXl1//PGHFi5cWOQ
2024-10-11 18:41:52 +04:00
"text/plain": [
"<Figure size 600x600 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"from imblearn.over_sampling import ADASYN\n",
"from sklearn.compose import ColumnTransformer\n",
"from sklearn.preprocessing import OneHotEncoder\n",
"\n",
"categorical_features = ['gender', 'ever_married', 'work_type', 'Residence_type'] # Ваши категориальные признаки\n",
"numeric_features = ['age', 'hypertension', 'heart_disease', 'avg_glucose_level', 'bmi'] # Ваши числовые признаки\n",
"\n",
"# Создание пайплайна для обработки категориальных данных\n",
"preprocessor = ColumnTransformer(\n",
" transformers=[\n",
" ('cat', OneHotEncoder(), categorical_features), # OneHotEncoder для категориальных данных\n",
" ('num', 'passthrough', numeric_features) # Оставляем числовые колонки без изменений\n",
" ]\n",
")\n",
"\n",
"# Создание экземпляра ADASYN\n",
"ada = ADASYN()\n",
"\n",
"# Преобразование данных с помощью пайплайна\n",
"X = preprocessor.fit_transform(df_train.drop(columns=['stroke']))\n",
"y = df_train['stroke']\n",
"\n",
"# Применение ADASYN\n",
"X_resampled, y_resampled = ada.fit_resample(X, y)\n",
"\n",
"# Создание нового DataFrame\n",
"df_train_adasyn = pd.DataFrame(X_resampled)\n",
"# Восстанавливаем названия столбцов для DataFrame\n",
"ohe_columns = preprocessor.named_transformers_['cat'].get_feature_names_out(categorical_features)\n",
"new_column_names = list(ohe_columns) + numeric_features\n",
"df_train_adasyn.columns = new_column_names\n",
"\n",
"# Добавление целевой переменной\n",
"df_train_adasyn['stroke'] = y_resampled\n",
"\n",
"# Вывод информации о новой выборке\n",
"print(\"Обучающая выборка после oversampling: \", df_train_adasyn.shape)\n",
"print(df_train_adasyn['stroke'].value_counts())\n",
"\n",
"# Визуализация\n",
"counts = df_train_adasyn['stroke'].value_counts()\n",
"plt.figure(figsize=(6, 6))\n",
"plt.pie(counts, labels=counts.index, autopct='%1.1f%%', startangle=90)\n",
"plt.title('Распределение классов Stroke в тренировочной выборке после ADASYN')\n",
"plt.show()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"2. Балансировка данных андерсемплингом. Этот метод помогает сбалансировать выборку, уменьшая количество экземпляров класса большинства, чтобы привести его в соответствие с классом меньшинства."
]
},
{
"cell_type": "code",
2024-10-11 18:46:40 +04:00
"execution_count": 19,
2024-10-11 18:41:52 +04:00
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Обучающая выборка после undersampling: (298, 12)\n",
"stroke\n",
"0 149\n",
"1 149\n",
"Name: count, dtype: int64\n"
]
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAsMAAADECAYAAAB6FizTAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAAA+cUlEQVR4nO3dd3hT1f8H8HeStkk3lNJBGQXKpqwyhAJllwICimxkyfjJUBRF0S9TFBkCykYBFVBZynBQ9pSlLNmrZRTaUko36UjO74+aa9OkpSktN23fr+fpA7m543PPXZ977rknCiGEABERERFRCaSUOwAiIiIiIrkwGSYiIiKiEovJMBERERGVWEyGiYiIiKjEYjJMRERERCUWk2EiIiIiKrGYDBMRERFRicVkmIiIiIhKLCbDRERE+RQXF4ebN28iIyND7lCIKJ+YDBMR2rRpg7p168odBhEA4P79+/j222+lz+Hh4diwYYN8AWWRnp6OuXPnon79+lCr1ShdujSqVauGffv2yR0aWaFvv/0WCoUC4eHhcodiFRQKBaZPny59tpbysSgZNgRt+NNoNKhevTrGjRuHqKiowoqRiAAsW7bMKEEgKq4UCgXGjh2L0NBQhIeHY9KkSThy5IjcYSE1NRUdOnTAlClT0KZNG2zevBl79uzB/v370bx5c7nDo2cIDw+HQqHA/PnzzX4/f/58q0jM6MWzyc9EM2fOROXKlaHVanH06F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2+eyTh16tQRQUFB0ucDBw4IAMLHx0ckJCRIwzdt2iQAiC+//FK
"text/plain": [
"<Figure size 200x200 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"from imblearn.under_sampling import RandomUnderSampler\n",
"\n",
"rus = RandomUnderSampler()# Создание экземпляра RandomUnderSampler\n",
"\n",
"# Применение RandomUnderSampler\n",
"X_resampled, y_resampled = rus.fit_resample(df_train.drop(columns=['stroke']), df_train['stroke'])\n",
"\n",
"# Создание нового DataFrame\n",
"df_train_undersampled = pd.DataFrame(X_resampled)\n",
"df_train_undersampled['stroke'] = y_resampled # Добавление целевой переменной\n",
"\n",
"# Вывод информации о новой выборке\n",
"print(\"Обучающая выборка после undersampling: \", df_train_undersampled.shape)\n",
"print(df_train_undersampled['stroke'].value_counts())\n",
"\n",
"# Визуализация распределения классов\n",
"counts = df_train_undersampled['stroke'].value_counts()\n",
"plt.figure(figsize=(2, 2))\n",
"plt.pie(counts, labels=counts.index, autopct='%1.1f%%', startangle=90)\n",
"plt.title('Распределение классов stroke в тренировочной выборке после Undersampling')\n",
"plt.show()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### 3. Датасет: Набор данных для анализа и прогнозирования сердечного приступа\n",
"https://www.kaggle.com/datasets/kamilpytlak/personal-key-indicators-of-heart-disease\n",
"##### О наборе данных: \n",
"По данным CDC, болезни сердца являются основной причиной смерти представителей большинства рас в США (афроамериканцев, американских индейцев и коренных жителей Аляски, а также белых). Около половины всех американцев (47%) имеют по крайней мере 1 из 3 основных факторов риска сердечно-сосудистых заболеваний: высокое кровяное давление, высокий уровень холестерина и курение. Другие ключевые показатели включают сахарный диабет, ожирение (высокий ИМТ), недостаточную физическую активность или чрезмерное употребление алкоголя. Выявление и профилактика факторов, оказывающих наибольшее влияние на сердечно-сосудистые заболевания, очень важны в здравоохранении. В свою очередь, достижения в области вычислительной техники позволяют применять методы машинного обучения для выявления \"закономерностей\" в данных, которые позволяют предсказать состояние пациента.\n",
"\n",
"##### Таким образом:\n",
"* Объект наблюдения - представители большинства рас в США\n",
"* Атрибуты: HeartDisease, BMI, Smoking, AlcoholDrinking, Stroke, PhysicalHealth(как много дней за месяц вы чувствовали себя плохо), MentalHealth(как много дней за месяц вы чувствовали себя ментально плохо), DiffWalking, Sex, AgeCategory, Race, Diabetic, PhysicalActivity, GenHealth, SleepTime, Asthma, KidneyDisease, SkinCancer.\n",
"* Проблемная область: прогнозирование сердечного приступа у человека."
]
},
{
"cell_type": "code",
"execution_count": 20,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Количество колонок: 18\n",
"Колонки: HeartDisease, BMI, Smoking, AlcoholDrinking, Stroke, PhysicalHealth, MentalHealth, DiffWalking, Sex, AgeCategory, Race, Diabetic, PhysicalActivity, GenHealth, SleepTime, Asthma, KidneyDisease, SkinCancer\n",
"\n",
"<class 'pandas.core.frame.DataFrame'>\n",
"RangeIndex: 319795 entries, 0 to 319794\n",
"Data columns (total 18 columns):\n",
" # Column Non-Null Count Dtype \n",
"--- ------ -------------- ----- \n",
" 0 HeartDisease 319795 non-null object \n",
" 1 BMI 319795 non-null float64\n",
" 2 Smoking 319795 non-null object \n",
" 3 AlcoholDrinking 319795 non-null object \n",
" 4 Stroke 319795 non-null object \n",
" 5 PhysicalHealth 319795 non-null float64\n",
" 6 MentalHealth 319795 non-null float64\n",
" 7 DiffWalking 319795 non-null object \n",
" 8 Sex 319795 non-null object \n",
" 9 AgeCategory 319795 non-null object \n",
" 10 Race 319795 non-null object \n",
" 11 Diabetic 319795 non-null object \n",
" 12 PhysicalActivity 319795 non-null object \n",
" 13 GenHealth 319795 non-null object \n",
" 14 SleepTime 319795 non-null float64\n",
" 15 Asthma 319795 non-null object \n",
" 16 KidneyDisease 319795 non-null object \n",
" 17 SkinCancer 319795 non-null object \n",
"dtypes: float64(4), object(14)\n",
"memory usage: 43.9+ MB\n"
]
},
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>HeartDisease</th>\n",
" <th>BMI</th>\n",
" <th>Smoking</th>\n",
" <th>AlcoholDrinking</th>\n",
" <th>Stroke</th>\n",
" <th>PhysicalHealth</th>\n",
" <th>MentalHealth</th>\n",
" <th>DiffWalking</th>\n",
" <th>Sex</th>\n",
" <th>AgeCategory</th>\n",
" <th>Race</th>\n",
" <th>Diabetic</th>\n",
" <th>PhysicalActivity</th>\n",
" <th>GenHealth</th>\n",
" <th>SleepTime</th>\n",
" <th>Asthma</th>\n",
" <th>KidneyDisease</th>\n",
" <th>SkinCancer</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>No</td>\n",
" <td>16.60</td>\n",
" <td>Yes</td>\n",
" <td>No</td>\n",
" <td>No</td>\n",
" <td>3.0</td>\n",
" <td>30.0</td>\n",
" <td>No</td>\n",
" <td>Female</td>\n",
" <td>55-59</td>\n",
" <td>White</td>\n",
" <td>Yes</td>\n",
" <td>Yes</td>\n",
" <td>Very good</td>\n",
" <td>5.0</td>\n",
" <td>Yes</td>\n",
" <td>No</td>\n",
" <td>Yes</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>No</td>\n",
" <td>20.34</td>\n",
" <td>No</td>\n",
" <td>No</td>\n",
" <td>Yes</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>No</td>\n",
" <td>Female</td>\n",
" <td>80 or older</td>\n",
" <td>White</td>\n",
" <td>No</td>\n",
" <td>Yes</td>\n",
" <td>Very good</td>\n",
" <td>7.0</td>\n",
" <td>No</td>\n",
" <td>No</td>\n",
" <td>No</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>No</td>\n",
" <td>26.58</td>\n",
" <td>Yes</td>\n",
" <td>No</td>\n",
" <td>No</td>\n",
" <td>20.0</td>\n",
" <td>30.0</td>\n",
" <td>No</td>\n",
" <td>Male</td>\n",
" <td>65-69</td>\n",
" <td>White</td>\n",
" <td>Yes</td>\n",
" <td>Yes</td>\n",
" <td>Fair</td>\n",
" <td>8.0</td>\n",
" <td>Yes</td>\n",
" <td>No</td>\n",
" <td>No</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>No</td>\n",
" <td>24.21</td>\n",
" <td>No</td>\n",
" <td>No</td>\n",
" <td>No</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>No</td>\n",
" <td>Female</td>\n",
" <td>75-79</td>\n",
" <td>White</td>\n",
" <td>No</td>\n",
" <td>No</td>\n",
" <td>Good</td>\n",
" <td>6.0</td>\n",
" <td>No</td>\n",
" <td>No</td>\n",
" <td>Yes</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>No</td>\n",
" <td>23.71</td>\n",
" <td>No</td>\n",
" <td>No</td>\n",
" <td>No</td>\n",
" <td>28.0</td>\n",
" <td>0.0</td>\n",
" <td>Yes</td>\n",
" <td>Female</td>\n",
" <td>40-44</td>\n",
" <td>White</td>\n",
" <td>No</td>\n",
" <td>Yes</td>\n",
" <td>Very good</td>\n",
" <td>8.0</td>\n",
" <td>No</td>\n",
" <td>No</td>\n",
" <td>No</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" HeartDisease BMI Smoking AlcoholDrinking Stroke PhysicalHealth \\\n",
"0 No 16.60 Yes No No 3.0 \n",
"1 No 20.34 No No Yes 0.0 \n",
"2 No 26.58 Yes No No 20.0 \n",
"3 No 24.21 No No No 0.0 \n",
"4 No 23.71 No No No 28.0 \n",
"\n",
" MentalHealth DiffWalking Sex AgeCategory Race Diabetic \\\n",
"0 30.0 No Female 55-59 White Yes \n",
"1 0.0 No Female 80 or older White No \n",
"2 30.0 No Male 65-69 White Yes \n",
"3 0.0 No Female 75-79 White No \n",
"4 0.0 Yes Female 40-44 White No \n",
"\n",
" PhysicalActivity GenHealth SleepTime Asthma KidneyDisease SkinCancer \n",
"0 Yes Very good 5.0 Yes No Yes \n",
"1 Yes Very good 7.0 No No No \n",
"2 Yes Fair 8.0 Yes No No \n",
"3 No Good 6.0 No No Yes \n",
"4 Yes Very good 8.0 No No No "
]
},
"execution_count": 20,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"import pandas as pd\n",
"df = pd.read_csv(\".//static//csv//heart.csv\", sep=\",\")\n",
"print('Количество колонок: ' + str(df.columns.size)) \n",
"print('Колонки: ' + ', '.join(df.columns)+'\\n')\n",
"\n",
"df.info()\n",
"df.head()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Получение сведений о пропущенных данных\n",
"Типы пропущенных данных:\n",
"\n",
"- None - представление пустых данных в Python\n",
"- NaN - представление пустых данных в Pandas\n",
"- '' - пустая строка"
]
},
{
"cell_type": "code",
2024-10-11 18:46:40 +04:00
"execution_count": 21,
2024-10-11 18:41:52 +04:00
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"HeartDisease 0\n",
"BMI 0\n",
"Smoking 0\n",
"AlcoholDrinking 0\n",
"Stroke 0\n",
"PhysicalHealth 0\n",
"MentalHealth 0\n",
"DiffWalking 0\n",
"Sex 0\n",
"AgeCategory 0\n",
"Race 0\n",
"Diabetic 0\n",
"PhysicalActivity 0\n",
"GenHealth 0\n",
"SleepTime 0\n",
"Asthma 0\n",
"KidneyDisease 0\n",
"SkinCancer 0\n",
"dtype: int64\n",
"\n",
"HeartDisease False\n",
"BMI False\n",
"Smoking False\n",
"AlcoholDrinking False\n",
"Stroke False\n",
"PhysicalHealth False\n",
"MentalHealth False\n",
"DiffWalking False\n",
"Sex False\n",
"AgeCategory False\n",
"Race False\n",
"Diabetic False\n",
"PhysicalActivity False\n",
"GenHealth False\n",
"SleepTime False\n",
"Asthma False\n",
"KidneyDisease False\n",
"SkinCancer False\n",
"dtype: bool\n",
"\n",
"HeartDisease процент пустых значений: %0.00\n",
"BMI процент пустых значений: %0.00\n",
"Smoking процент пустых значений: %0.00\n",
"AlcoholDrinking процент пустых значений: %0.00\n",
"Stroke процент пустых значений: %0.00\n",
"PhysicalHealth процент пустых значений: %0.00\n",
"MentalHealth процент пустых значений: %0.00\n",
"DiffWalking процент пустых значений: %0.00\n",
"Sex процент пустых значений: %0.00\n",
"AgeCategory процент пустых значений: %0.00\n",
"Race процент пустых значений: %0.00\n",
"Diabetic процент пустых значений: %0.00\n",
"PhysicalActivity процент пустых значений: %0.00\n",
"GenHealth процент пустых значений: %0.00\n",
"SleepTime процент пустых значений: %0.00\n",
"Asthma процент пустых значений: %0.00\n",
"KidneyDisease процент пустых значений: %0.00\n",
"SkinCancer процент пустых значений: %0.00\n"
]
}
],
"source": [
"# Количество пустых значений признаков\n",
"print(df.isnull().sum())\n",
"print()\n",
"\n",
"# Есть ли пустые значения признаков\n",
"print(df.isnull().any())\n",
"print()\n",
"\n",
"# Процент пустых значений признаков\n",
"for i in df.columns:\n",
" null_rate = df[i].isnull().sum() / len(df) * 100\n",
" print(f\"{i} процент пустых значений: %{null_rate:.2f}\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##### Пропущенные данные отсутствуют.\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##### Проверим выбросы и усредним их:"
]
},
{
"cell_type": "code",
"execution_count": 22,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Колонка BMI:\n",
" Есть выбросы: Да\n",
" Количество выбросов: 10396\n",
" Минимальное значение: 12.02\n",
" Максимальное значение: 94.85\n",
" 1-й квартиль (Q1): 24.03\n",
" 3-й квартиль (Q3): 31.42\n",
"\n",
"Колонка PhysicalHealth:\n",
" Есть выбросы: Да\n",
" Количество выбросов: 47146\n",
" Минимальное значение: 0.0\n",
" Максимальное значение: 30.0\n",
" 1-й квартиль (Q1): 0.0\n",
" 3-й квартиль (Q3): 2.0\n",
"\n",
"Колонка MentalHealth:\n",
" Есть выбросы: Да\n",
" Количество выбросов: 51576\n",
" Минимальное значение: 0.0\n",
" Максимальное значение: 30.0\n",
" 1-й квартиль (Q1): 0.0\n",
" 3-й квартиль (Q3): 3.0\n",
"\n",
"Колонка SleepTime:\n",
" Есть выбросы: Да\n",
" Количество выбросов: 4543\n",
" Минимальное значение: 1.0\n",
" Максимальное значение: 24.0\n",
" 1-й квартиль (Q1): 6.0\n",
" 3-й квартиль (Q3): 8.0\n",
"\n"
]
}
],
"source": [
"numeric_columns = ['BMI', 'PhysicalHealth', 'MentalHealth', 'AgeCategory', 'SleepTime']\n",
"for column in numeric_columns:\n",
" if pd.api.types.is_numeric_dtype(df[column]): # Проверяем, является ли колонка числовой\n",
" q1 = df[column].quantile(0.25) # Находим 1-й квартиль (Q1)\n",
" q3 = df[column].quantile(0.75) # Находим 3-й квартиль (Q3)\n",
" iqr = q3 - q1 # Вычисляем межквартильный размах (IQR)\n",
"\n",
" # Определяем границы для выбросов\n",
" lower_bound = q1 - 1.5 * iqr # Нижняя граница\n",
" upper_bound = q3 + 1.5 * iqr # Верхняя граница\n",
"\n",
" # Подсчитываем количество выбросов\n",
" outliers = df[(df[column] < lower_bound) | (df[column] > upper_bound)]\n",
" outlier_count = outliers.shape[0]\n",
"\n",
" print(f\"Колонка {column}:\")\n",
" print(f\" Есть выбросы: {'Да' if outlier_count > 0 else 'Нет'}\")\n",
" print(f\" Количество выбросов: {outlier_count}\")\n",
" print(f\" Минимальное значение: {df[column].min()}\")\n",
" print(f\" Максимальное значение: {df[column].max()}\")\n",
" print(f\" 1-й квартиль (Q1): {q1}\")\n",
" print(f\" 3-й квартиль (Q3): {q3}\\n\")\n",
"\n",
" # Устраняем выбросы: заменяем значения ниже нижней границы на саму нижнюю границу, а выше верхней — на верхнюю\n",
" df[column] = df[column].apply(lambda x: lower_bound if x < lower_bound else upper_bound if x > upper_bound else x)\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Постараемся выявить зависимости HeartDisease от остальных колонок:"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Разобьем наш набор на выборки относительно параметра HeartDisease:"
]
},
{
"cell_type": "code",
"execution_count": 23,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAtEAAAIrCAYAAAApwMV4AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAABYkklEQVR4nO3deVhUZf/H8c+AAYqCKwJJiEsqueUSoWlqJJqmqC0u5ZLlkjs95ZprpdmjqWnaYi5lj2ZPkWmhhJqlSLmgaerPBXdBU3EEFRXm94cX53EClUMgg7xf1zVXzH2+c853TjR9PN7nHovNZrMJAAAAQLY55XcDAAAAQEFDiAYAAABMIkQDAAAAJhGiAQAAAJMI0QAAAIBJhGgAAADAJEI0AAAAYBIhGgAAADCJEA0AAACYRIgGABQ4ycnJmjFjhvE8KSlJc+bMyb+G7kHr16+XxWLR119/fdu6hQsXymKx6PDhw3enMcBBEKKBQiLjf3RbtmzJtO2TTz6RxWJRWFiY0tLS8qE7wJyiRYtqzJgxWrJkiY4dO6bx48fr+++/z++2/pHk5GSNGzdONWvWlLu7u8qUKaO6detqyJAhOnnyZH63B+BviuR3AwDy17fffqv+/furSZMmWrp0qZydnfO7JeCOnJ2dNWHCBHXv3l3p6eny8PDQqlWr8rutHLt27ZqaNm2qvXv3qkePHho0aJCSk5O1e/duffnll+rQoYN8fX3zu80svfjii+rcubNcXV3zuxXgriJEA4XY+vXr1aVLFwUGBur777+Xm5tbfrcEZNtrr72m559/XseOHVONGjVUsmTJ/G4pxyIiIrR9+3YtWbJEXbt2tdt25coVXb16NZ86uzNnZ2f+8I1CiekcQCEVFxen9u3by8fHR6tXr5anp2emmuXLl6t+/foqWrSoypYtqxdeeEEnTpzIcn8WiyXLx83zJC0Wi8aPH2/3uvfee08Wi0XNmjUzxsaPHy+LxZLpGBUrVlTPnj3txpKSkjR06FD5+fnJ1dVVVapU0bvvvqv09HS7uvT0dM2cOVO1atWSm5ubypUrp1atWhnTW27Vf8Yjo7+MeaIZD1dXVz344IOaPHmybDab3TG3b9+u1q1by8PDQ8WLF9cTTzyhzZs3Z3n+brZv3z61aNFC3t7ecnV1lZ+fn/r166dz584ZNbebr1q8eHG783Tu3Dn961//Uq1atVS8eHF5eHiodevW2rFjh93rcvu8Hz58WBaLRf/+978z7bNmzZp2/84z3s/69evt6tq0aZPp9+bmPitUqKDg4GAVKVJE3t7eWe7jVpo1a5blv+u//45K/5sOdavfiwzbt29Xq1atVK5cObu6tm3b3raXgwcPSpIaN26caZubm5s8PDyM5z179lTx4sV19OhRtW3bVsWLF9f9999vzAn/448/1KJFC7m7u8vf319ffvllpn0eOnRIzz77rEqXLq1ixYrp0UcfzdaV/NTUVLVt21aenp7atGmT3bm5+b/1ihUrqm3btvr111/1yCOPyM3NTZUqVdLixYsz7XPnzp16/PHHVbRoUVWoUEFvvfWWFixYwDxrODyuRAOF0MGDB9WqVSu5urpq9erV8vHxyVSzcOFC9erVSw0bNtTkyZOVmJiomTNnauPGjdq+fXuWV/06dOigjh07SpJ++eUXffzxx7ftIykpSZMnT87x+7h06ZIef/xxnThxQn379tUDDzygTZs2aeTIkTp16pTdjWe9e/fWwoUL1bp1a7388su6fv26fvnlF23evFkNGjTQ559/btRm9P7++++rbNmykqTy5cvbHXvUqFGqUaOGLl++rGXLlmnUqFHy8vJS7969JUm7d+9WkyZN5OHhoTfeeEP33XefPvroIzVr1kw///yzgoKCbvm+UlJSVKFCBT399NPy8PDQrl27NGfOHJ04cSJH834PHTqkiIgIPfvsswoICFBiYqI++ugjP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nTevXVV+3mSbdp00bVq1fP9Ne+GfM1zVw9OnHihD744AO9+eabKl68uN02Ly8vSdLx48dvu4/ly5erSZMmKlWqlP766y/jERISorS0NG3YsEGS9N///lcWi0Xjxo3LtI87XfG7lQsXLuivv/7S0aNHNXXqVKWnp6tFixaSblwlXLNmjcLCwlSpUiXjNT4+Puratat+/fVXWa3WbB0jMTFR0dHRWrVqlZo2bZqp5uLFi3bv/a+//spU4+rqKicnJ6O3s2fPqnjx4qpWrZq2bdtm1OX2ec9w6dKlTD3eaRWYb775Rr///rumTJly2zpJmjRpkjw9PTV48OA71t7sypUr2b4PIDu/4xcvXpQklSlTxlQf0o3VRmJjY/X6669LuvE3Qb1795aPj48GDRqk1NTUTK95+eWXjZ9LliypatWqyd3dXc8995wxXq1aNZUsWVKHDh0yxn744Qc98sgjeuyxx4yx4sWLq0+fPjp8+LD+/PNPu+NcuHBBLVu21N69e7V+/XrVrVs3W+8pMDBQTZo0MZ6XK1dO1apVs+slMjJSwcHBdvssXbq0unXrlq1jAPmJ6RxAIXPu3DktXbpUHTp00J9//qkhQ4aoZcuWdnOijxw5IunG/4D/rnr16vr111/txpKSkiQpUxi+nXHjxsnX11d9+/bNNK83ODjY+Ovdt956y9jv3+c579+/Xzt37lS5cuWyPMbp06cl3Zi+4uvrq9KlS2e7vzsJCwszfnZyctKYMWPUqVMnSdKZM2d06dKlLM9fjRo1lJ6ermPHjhl/pX0roaGhio2NlSS1atVKy5Yty1Tz0ksv3bHXjPngH374oeLj4+0C7M2BL7fPe4Zx48Zl+QeYv0+RyZCWlqZRo0apW7duql279m3fW3x8vD766CPNnTvX9I2xf/31l6pWrZqt2uz8jjdo0ED33Xefxo8fr7JlyxrTOf5+/m7F09NTU6dO1dSpU3XkyBFFR0fr3//+t2bPni1
"text/plain": [
"<Figure size 800x600 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAtEAAAIrCAYAAAApwMV4A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18ZBQsWNJ577rl0f2/++Xch7d+KoKAgu783w4YNMxwdHY24uDjDMAwjJibGKFCggBEaGmo33rhx4wxJdmMCd8J0DiCX9O7dWydOnFD37t21du1aLVmyJF3Nzp07debMGb3wwgt286RDQkJUpUqVdL+qvXbtmiRr8wVPnTql9957T6+//rqKFClit8/T01OSdPLkyduOsWTJEjVr1kzFihXTuXPnzEdQUJBSUlK0efNmSdJXX30lm82msWPHphsjo+kLmREfH69z587p+PHjCg8PV2pqqlq2bClJSklJ0dq1axUaGqoHHnjAPKZMmTLq3r27fvrpJyUkJGTqNWJjYxUZGamVK1fq4YcfTldz6dIlu/d+7ty5dDXOzs7mzVApKSk6f/68ihQposqVK2v37t1mXXaf9zSXL19O1+OdVoH5+uuvtWPHDk2ZMuW2dZL0xhtvyN3dXUOGDLlj7c2uXr2a6fsAMvMZv3TpkiSpRIkSlvpIs3fvXv3222/q1q2bua1bt246d+6c1qxZc9tjM/MZT7uqHxYWZrd/+PDhkpTu73VAQICaNWtmPi9VqpQqV66sP/74w9y2atUqNWjQQE2bNjW3FSlSRP369dOxY8d04MCB2/Z9O2n/LqSd1zTOzs7q06dPpsfp06eP3XzptPd08/tI8/nnn6tLly56/vnn9cEHH2T6JsJ
"text/plain": [
"<Figure size 800x600 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAtEAAAIrCAYAAAApwMV4AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAABS3UlEQVR4nO3de3zP9f//8ft7YwfmvTlsZpkZKyynjGYJ0RhNjvWhlENK5BBToWTooJRCxKfD11R8Ep+oKKwJxRxyyNlXmua0IW2zYWN7/f7ot/fXuw17rc3es9v1cnldLr2fr8f79X68X0N3L8/X82UxDMMQAAAAgAJzKukGAAAAgNKG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+syZM3k+K9eHH35oSDJ+//1321jbtm3tvsPq1asNScZ//vMfu/cGBAQYkZGR1+3lwoULRr169QxJRkBAgDFgwADj448/NpKTk/PUDhs2zMjvf/G559tqtRqnT5+229e0aVPDx8fH+OOPP2xjv/zyi+Hk5GT069fPNpZ7bs+cOWMcOHDA8PPzM1q0aGGcO3fOVlPQnz9QmjGdA0AeAwYM0LFjx/Too49qzZo1WrJkSZ6an3/+WadPn9YzzzxjN086MjJS9evXz3MDV+58TVdX1wL3ceLECb333nt6+eWX5eHhYbfPx8dHknT8+PHrHmPJkiVq3bq1KleurLNnz9q28PBwZWdna8OGDZKk//73v7JYLIqOjs5zjGtd8buR1NRUnT17VomJiZo2bZpycnLUvn17SVJ2drbWrFmj7t27q06dOrb31KhRQ48++qh++uknpaWlFegzkpOTFRcXp5UrV6pNmzZ5as6fP2/33fNbmszV1VVOTk623v744w95eHioXr162rFjh62uqM97rgsXLuTp8UarwHz55Zfatm2b3njjjevWSdIrr7wiT09PjRw58oa1V7t06VKB7wMoyK/x8+fPS5KqVq1qqg/pr9VGtmzZoueff17SX/8SNGjQINWoUUMjRoxQZmZmgY/Vq1cveXt7216fOnVKu3bt0oABA1SlShXbeOPGjdWhQ4d8r/bv3btXbdu2Ve3atfX999+rcuXKtn1mf/5AacR0DgB5nDt3Tp9//rl69Oih/fv369lnn1XHjh3t5kT//vvvkqR69erleX/9+vX1008/2Y2lpKRIUp4wfD3R0dHy8/PT008/nWdeb1hYmCwWi8aPH69XX33Vdty/z7c8fPiwdu/ebRcYrnb69GlJf/2TtJ+fn12A+Ke6d+9u+28nJydNmDBBvXr1kiSdOXNGFy5cyPf8NWjQQDk5OTp27JjuvPPO635GRESEtmzZIknq1KmTFi9enKfmiSeeuGGvufPB33//fSUkJNgF2KsDX1Gf91zR0dH5/gXm71NkcmVnZ+vFF19U37591bhx4+t+t4SEBP373//W3LlzTd8Ye/bsWd1+++0Fqi3Ir/HmzZurfPnymjRpkqpVq2abzlHQecKenp6aNm2apk2bpt9//11xcXF6++23NXv2bHl6eurVV18t0HECAwPtXl/v93ODBg20evVqZWRkqGLFirbxBx98UNWrV9fq1avzfGezP3+gNCJEA8jjrbfe0sMPPyxJ+uCDD9SyZUuNHz9e77//fqGPmZSUJEny9fUtUP2BAwcUExOjzz77TOXLl8+zv0mTJoqOjtbkyZO1cOHCax4nJydHHTp00AsvvJDv/jvuuKNA/RTG22+/rSZNmujy5cvatm2bXn31VZUrVy7fsFhY7733ns6ePav9+/dr6tSpGjJkiD777DO7mokTJ6p169Z2Yw8++KDd69dff10vv/yynnjiCb3yyiuqUqWKnJycNGrUKLuAV1znffDgwbZfc7meeuqpax7/448
"text/plain": [
"<Figure size 800x600 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAtEAAAIrCAYAAAApwMV4AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAABS6UlEQVR4nO3deXhMZ//H8c8kZLEk1ohUGrFTW4VG7EuIrShPa2st1Sq1qxal1irVR4vaSluhpbX8LC0V0hBaYqmlxPbgCbEltsaIEiTz+8OVeUwT5EQiE96v65rrMvf5zjnfOabpx8l97jFZLBaLAAAAAKSZQ1Y3AAAAAGQ3hGgAAADAIEI0AAAAYBAhGgAAADCIEA0AAAAYRIgGAAAADCJEAwAAAAYRogEAAACDCNEAAACAQYRoAECWi4+P17Rp06zP4+LiNGvWrKxrKAucOnVKJpNJwcHBNuMhISGqWrWqXFxcZDKZFBcXJ0n67rvvVK5cOeXMmVP58uXL0j67d++uPHnyPPK1DRo0UIMGDTKvOeAJIkQD2VRwcLBMJpP++OOPFNvmz58vk8mktm3bKjExMQu6A4xxdXXVqFGjtHjxYp05c0Zjx47Vzz//nNVtPRaTyWR95MiRQwUKFJCfn58GDhyow4cPp2kf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N682Tp269Yti4ODg+Xdd9+1jrVt29bi5ORkOXnypHXs/Pnzlrx581rq1auXYr+P8u6771ry5MmToo/ly5enqM2dO7fNebp165YlMTHRpiYqKsri7OxsGT9+vHUso897VFSURZLls88+S9HjCy+8YPN3ntp59ff3tzRv3jzF52bMmDGW+/93dPHiRUvevHmttffv42Fq1aplqVixovX5pUuXUhwr2fz58y2SLKdPn7aO1a9f3+Y9bNiwwSLJ8sMPP9i81sfHx9KyZctH9iPJ0rdv3wduHzhwoEWS5c8//7RYLP87vwsWLLDWJH92d+/ebfPa5HN26dIlm/H333/fIsly9uxZi8Visfzwww8WFxcXS0JCguWXX36xODo6Wsxms8VisVhmzpxpkWTZtm2bxWJJ++cqtT67detmyZ07t8VisVh+//13i5ubm6Vly5aWW7du2ezvn+c4+XNSvnx5S0JCgnV8+vTpFkmWgwcPWiwWiyUhIcFSsGBBS40aNSx37tyx1gUHB1sk2ewTeFKYzgFkc927d9eZM2fUuXNnbdy4UcuXL09R88cff+jixYt69913beZJt2zZUuXKlUtxA9ft27clSc7Ozmnu49y5c/ryyy/10UcfpVjqysPDQ5J09uzZh+5j+fLlqlu3rvLnz6/Lly9bH4GBgUpMTNTWrVslSf/3f/8nk8lk/ZX2/VKbvpAW165d0+XLlxUdHa0pU6YoKSlJjRo1kiQlJiZq48aNatu2rUqUKGF9TdGiRdW5c2f9/vvvMpvNaTpGbGyswsLCtG7dOtWrVy9FzfXr123e++XLl1PUODs7y8HBwdrblStXlCdPHpUtW1Z79+611mX0eU/2999/p+jxUavArFy5Urt379bkyZMfWidJEyZMkLu7uwYMGPDI2vvdunUrzfcBpOUzfv36dUn3pl9khuT/TpKPkxGSryr/9ttvku5N5fDz85OTk5MCAgKsUziSt7m4uKh69eqS0v65epjNmzcrKChIjRs31sqVK9P8M6RHjx42c6Xr1q0r6d7Vcenez7ArV67o7bffVo4c//slepcuXZQ/f/40HQPIaEznALK5q1ev6scff9Qrr7yiw4cPa+DAgWratKnNnOjTp09LksqWLZvi9eXKlUtxs1HyOrRpWfc12ZgxY+Tl5aV33nknxbzegIAAmUwmjRgxQh9//LF1v/+
"text/plain": [
"<Figure size 800x600 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAtIAAAJHCAYAAAC9wbFaAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAABdc0lEQVR4nO3deVRV5f7H8c9BBJwAUQFJRFJTySnFFMdUEgszzLpqlpaWN9McyyFns1S6lppeyayse/VmVlppqYSZlkjOs2aFOQVoCAgpouzfHy32zxOknB3I4Pu11lnL8+zv2ft7tnT6sH32c2yGYRgCAAAA4BCnom4AAAAAKIkI0gAAAIAFBGkAAADAAoI0AAAAYAFBGgAAALCAIA0AAABYQJAGAAAALCBIAwAAABYQpAEAAAALCNIAAEhKT0/X3LlzzecpKSlauHBh0TUEoNgjSAOwbOnSpbLZbNqxY0eubW+99ZZsNpsiIiJ09erVIugOcEy5cuU0ceJELVu2TCdPntTUqVP1+eefF3Vbf0t6erqmTJmihg0bqkKFCqpSpYqaNm2q4cOH68yZM0XdHlDiORd1AwBKn1WrVmnw4MFq166dPvjgA5UpU6aoWwJuqEyZMpo2bZr69eun7Oxsubu7a+3atUXdlmVZWVlq3769jhw5ov79++u5555Tenq6Dh48qOXLl6tHjx7y8/Mr6jaBEo0gDaBAbdq0SX369FFQUJA+//xzubm5FXVLQL6NHj1avXr10smTJ9WgQQN5enoWdUuWrV69Wrt379ayZcv06KOP2m27dOmSLl++XESdAaUHUzsAFJg9e/bowQcfVPXq1bV+/Xp5eHjkqlm5cqWaN2+ucuXKqWrVqnrsscd0+vTpPPdns9nyfBw/ftyuZurUqXave/XVV2Wz2XTPPfeYY1OnTpXNZst1jFq1aumJJ56wG0tJSdGIESPk7+8vV1dX1alTR7Nnz1Z2drZdXXZ2tubNm6dGjRrJzc1N1apVU9euXc2pLn/Vf84jp79NmzbZjbu6uuqOO+7QzJkzZRiG3TF3796t++67T+7u7qpYsaI6d+6sbdu25Xn+rnX06FF16tRJvr6+cnV1lb+/v5555hklJyebNTl9fPTRR7leX7FiRbvzlJycrOeff16NGjVSxYoV5e7urvvuu0979+61e11Bn/fjx4/LZrPpX//6V659NmzY0O7vPOf9bNq0ya4uPDw818/NtX3WqFFDISEhcnZ2lq+vb577+Cv33HNPnn/Xf/4Zlf5/atRf/Vzk2L17t7p27apq1arZ1XXr1u26vfz000+SpDZt2uTa5ubmJnd3d7uxI0eO6OGHH5aXl5fc3NwUHByszz77zNyelJSkatWq6Z577rH7ufzxxx9VoUIF9erV60anByh1uCINoED89NNP6tq1q1xdXbV+/XpVr149V83SpUv15JNPqkWLFpo5c6YSExM1b948fffdd9q9e3eeV/969Oihhx56SJK0ZcsWLV68+Lp9pKSkaObMmZbfx++//64OHTro9OnT+uc//6maNWtq69atGj9+vH799Ve7m9EGDhyopUuX6r777tNTTz2lK1euaMuWLdq2bZuCg4P1n//8x6zN6f31119X1apVJUk+Pj52x37xxRfVoEEDXbx4UStWrNCLL74ob29vDRw4UJJ08OBBtWvXTu7u7hozZozKli2rN998U/fcc4+++eYbtWzZ8i/fV0ZGhmrUqKEHHnhA7u7uOnDggBYuXKjTp09bmgf8888/a/Xq1XrkkUcUGBioxMREvfnmm+rQoYMOHTrk8JQBR87737F582Z98cUX+aqdM2eOEhMTHT5GjRo1zJ/B9PR0DR48+Lr11/5MvPzyy3bbUlNTdd9998kwDI0aNUr+/v6SpJEjR96wj4CAAEnS+++/r4kTJ+b5C02OgwcPqk2bNrrttts0btw4VahQQR9++KEiIiL08ccfq0ePHvL29taiRYv0yCOP6I033tCwYcOUnZ2tJ554QpUqVdK///3vG/YElDoGAFj07rvvGpKMNWvWGLVr1zYkGV26dMmz9vLly4a3t7fRsGFD4+LFi+b4mjVrDEnG5MmT7eqzsrIMSca0adNyHS8+Pt4ck2RMmTLFfD5mzBjD29vbaN68udGhQwdzfNq0aYYkIzs72+44AQEBRv/+/c3nL730klGhQgXjhx9+sKsbN26cUaZMGePEiROGYRjGxo0bDUnGsGHDcr3XPx/jr3rP8fXXXxuSjK+//tocu3TpkuHk5GQ8++yz5lhERITh4uJi/PTTT+bYmTNnjEqVKhnt27fPtd8befbZZ42KFSvm6mPlypW5aitUqGB3ni5dumRcvXrVriY+Pt5wdXU1pk+fbo4V9HmPj483JBmvvvpqrh7vvPNOu7/zvM5ry5Ytjfvuuy/Xz82UKVOMa/+XmJSUZFSqVMmsvXYf19O6dWujYcOG5vOzZ8/mOlaOt956y5Bk/PLLL+ZYhw4d7N7D+vXrDUnG//73P7vXBgQEGOHh4dft5ffffzfq1atnSDICAgKMJ554wnj77beNxMTEXLWdO3c2GjVqZFy6dMkcy87ONlq3bm3UrVvXrrZPnz5G+fLljR9++MF49dVXDUnG6tWrr9sLUFoxtQPA3/bEE0/o5MmTevTRR7VhwwatXLkyV82OHTuUlJSkZ5991m7edHh4uOrXr5/rpq6c+Zuurq757uP06dN64403NGnSJFWsWNFum7e3tyTp1KlT193HypUr1a5dO1WuXFnnzp0zH6Ghobp69ao2b94sSfr4449ls9k0ZcqUXPu43pW/60lNTdW5c+d04sQJRUZGKjs7W506dZIkXb16VRs2bFBERIRuv/128zXVq1fXo48+qm+//VZpaWn5OkZiYqJiYmK0du1atW/fPlfNhQsX7N77uXPnctW4urrKycnJ7O23335TxYoVVa9ePe3atcusK+jznuP333/P1eONVof55JNPtH37ds2aNeu6dZL00ksvycPDQ8OGDbth7bUuXbqU7/sC8vMzfuHCBUlSlSpVHOpD+mMVkri4OL3wwguS/vgXoYEDB6p69ep67rnnlJmZKemPaTobN27UP/7xD7u/+99++01hYWE6duyY3fSrBQsWyMPDQw8//LAmTZqkxx9/XA8++KDD/QGlAVM7APxtycnJ+uCDD9SjRw8dOnRIw4cPV5cuXezmSP/yyy+SpHr16uV6ff369fXtt9/ajaWkpEhSrkB8PVOmTJGfn5/++c9/5prnGxISIpvNpvHjx2vGjBnmfv887/nYsWPat2+fqlWrlucxkpKSJP0xlcXPz09eXl757u9GIiIizD87OTlp4sSJ6tmzpyTp7Nmz+v333/M8fw0aNFB2drZOnjypO++887rHCAsLU1xcnCSpa9euWrFiRa6aAQMG3LDXnPnh//73vxUfH28XYq8NfQV93nNMmTIlz19i/jxdJsfVq1f14osvqm/fvmrcuPF131t8fLzefPNNLVq0yOGbZc+dO6e6devmqzY/P+PBwcEqW7aspk6dqqpVq5pTO/58/v6Kh4eHIiMjFRkZqV9++UUxMTH617/+ZYbhGTNm6Mcff5RhGJo0aZImTZqU536SkpJ02223SZK8vLw0f/58PfLII/Lx8dH8+fPz1QtQGhGkAfxtr776qh555BFJ0uLFi9WqVSuNHz/+b82ZTEhIkCT5+vrmq/7w4cNaunSp/vvf/6ps2bK5tjdp0kRTpkzRtGnTtGzZsr/cT3Z2tu69916NGTMmz+133HFHvvqx4l//+peaNGmirKwsbd++XTNmzJCzs3OegdGqN954Q+fOndOhQ4c0c+ZMPfPMM/rvf/9rVzN58mS1a9fObuyBBx6we/7KK69o0qRJGjBggF566SV5eXnJyclJI0aMsAt5hXXeBw0aZP7M5Xj66af/cv9vv/22jh8/rvXr1/9lTY4JEyaobt266t+/v7Zs2XLD+hyXL1/Wr7/+qnvvvTdf9QkJCapYsaIqVKjwlzUBAQF69913NXz4cDVr1sxu241+IchrXwMGDFCPHj10++23a9myZZoxY4b59/X8888
"text/plain": [
"<Figure size 800x600 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAskAAAJhCAYAAACzei1uAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAAB69UlEQVR4nO3deZyN9eP+8evMMIsZM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WrJkeffRR62sKFCig1q1b65dfflFSUlKm3uPEiRNatmyZ5s2bp5o1a6Ybc+HCBZvP/tdff6Ub4+3tLQ8PD2u206dPy9/fX8WLF9fWrVut47L6e09z+fLldBnvdBWVWbNmadOmTRo2bNhtx0nSu+++q8DAQHXv3v2OY2929erVTB+Dmpl1/MKFC5KkPHnyOJQjzc6dO7Vr1y61atXKOq1Vq1b666+/tGjRIuu0zZs36/Tp0+rYsaOyZfu/X9K2adNGDz30kM0yZ86cqZIlS6pEiRI233/aurpixQpJsq6POXPmzFRWX19f659v3Lih06dPKzw8XLly5bJZp25lyZIlOnfunPXzpT08PT1VtWpVa67jx49r165datu2rc12olatWipTpozNMufPny9PT89060GvXr1kjNGCBQtspteqVUsRERE204oVK6aqVavanDB55swZLViwQG3atLnr7QVwJxxuAbiAM2fOaNq0aXrmmWe0d+9evf7662rYsKECAwOtY37//XdJUvHixdO9vkSJEvrll19spp0
"text/plain": [
"<Figure size 800x600 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAtEAAALzCAYAAADXrVs6AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAABxbklEQVR4nO3deVhUdeP+8XtQAVFACREwRBQ3cst9SU1Fccu1xaVcskxzDcul3Msse8olTVssykdTK7PSJ5dwy31fcMsFc8WNAEEFhfn90Y/5OuHCMeCM8n5d11wXc85nZu6Zsee5OXzO51isVqtVAAAAADLNyewAAAAAwIOGEg0AAAAYRIkGAAAADKJEAwAAAAZRogEAAACDKNEAAACAQZRoAAAAwCBKNAAAAGAQJRoAAAAwiBINAMhVEhMTNWXKFNv9uLg4zZgxw7xAAB5IlGgA9xQRESGLxaLt27dn2Pf555/LYrGoXbt2Sk1NNSEdYEz+/Pk1cuRIzZ07V6dOndL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zTfl4+OjXr16SZL279+v+vXry8PDQ0OHDlW+fPn06aef6sknn9TatWtVq1atO76vpKQkPfroo3rqqafk4eGhqKgozZgxQ2fOnLmveb/Hjx/X4sWL9cwzzygoKEjnz5/Xp59+qoYNG+rAgQPy9/c39HxGPvd/Y926dfrf//6XqbEffvihzp8/b/g1Hn30Udu/wcTERPXt2/eu42/9NzFhwgS7ffHx8WrRooWsVqvCw8MVEBAgSXrttdcM57r1Of/66y+VKlXKbntERIQKFiyo8PBwFSxYUKtWrdLo0aOVkJCgDz74wDZu5cqVat26tfz8/DRo0CD5+vrq4MGDWrJkiQYNGiTp73+r9erVU7FixTR8+HAVKFBACxcuVLt27fTDDz+offv2950fcHhWALiHr776yirJumTJEmupUqWskqzNmjW77diUlBSrj4+PtUKFCtZr167Zti9ZssQqyTp69Gi78Tdu3LBKso4bNy7D60VHR9u2SbKOGTPGdn/o0KFWHx8fa7Vq1awNGza0bR83bpxVkjUtLc3udQIDA63du3e33X/77betBQoUsP7xxx9244YPH27NkyeP9eTJk1ar1WpdtWqVVZJ14MCBGd7rP1/jTtnTrV692irJunr1atu269evW52cnKyvvvqqbVu7du2szs7O1mPHjtm2nT171uru7m5t0KBBhue9l1dffdVasGDBDDm+++67DGMLFChg9zldv37dmpqaajcmOjra6uLiYh0/frxtW1Z/7tHR0VZJ1g8++CBDxscee8zuO7/d51qrVi1rixYtMvy7GTNmjPXW/+u7cOGC1d3d3Tb21ue4m7p161orVKhgu3/x4sUMr5Xu888/t0qy/vnnn7ZtDRs2tHsPy5cvt0qyfvvtt3aPDQwMtLZq1eqeeSRZe/XqZb148aL1woUL1u3bt1ubN29+28/w6tWrGR7/yiuvWN3c3KzXr1+3Wq1W682bN61BQUHWwMBA619//WU39tbvuEmTJtaKFSvaHpe+v27dutbSpUvfMzfwIGM6B4BM69Gjh06dOqUuXbpoxYoV+u677zKM2b59uy5cuKBXX33Vbp50q1atVK5cuQwncKWkpEiSXFxcMp3jzJkz+vjjjzVq1CgVLFjQb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cCBA5o4caL69Omj//73v3ZjRo8erfr169tte+qpp+zuv/vuuxo1apRefPFFvf322/Ly8pKTk5MGDx5sV/Cy63Pv3bu37d9cupdffvmOzz979mydOHFCy5cvv+OYdG+99ZZKly6t7t276/fff7/n+HQpKSk6d+6cmjZtmqnxMTExKliwoAoUKHD
"text/plain": [
"<Figure size 800x600 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAtEAAAK4CAYAAACyMqGVAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAABtl0lEQVR4nO3deVhUZePG8XtAWVQWdyQRUdzXXDJySyOlLNe3LH0TDfO13LFcyt1Ms9dyTSt7Xdq0zCy1XMKtEvd9TQ3FDZcQEVQEZn5/eDE/JzA5xjgwfD/XNdfFnPPMzD3jlDfH5zzHZLFYLAIAAACQbS6ODgAAAADkNZRoAAAAwCBKNAAAAGAQJRoAAAAwiBINAAAAGESJBgAAAAyiRAMAAAAGUaIBAAAAgyjRAAAAgEGUaAAAAMAgSjQAIE9KSkrS1KlTrfcTEhI0a9YsxwVygJMnT8pkMmn+/PmGHztmzBiZTCZdvnw554P9xT/JCeRWlGggH5k/f75MJpN27NiRad8nn3wik8mk9u3bKz093QHpAGM8PT01YsQIffHFFzp9+rTGjBmj5cuXOzrWP2Iymay3AgUKqFixYqpfv74GDBigQ4cOOTrePX355Zc2v9gAzqyAowMAcLzvvvtOr776qpo2bapFixbJ1dXV0ZGAe3J1ddXYsWPVrVs3mc1meXt7a+XKlY6O9Y89+eST6tatmywWi65evaq9e/dqwYIF+vDDD/Xuu+8qMjLSOjYwMFA3btxQwYIFHZj4/3355Zc6cOCABg4caLM9t+UEcgIlGsjnNmzYoBdffFHVq1fX8uXL5eHh4ehIQLYNHjxYnTt31unTp1WtW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EjR2Y6YlWqVClJ0pkzZ/72Ob755hs1bdpURYsW1eXLl6230NBQpaena9OmTZKkb7/9ViaTSaNHj870HFlNX8iOq1ev6vLly4qNjdXkyZNlNpvVsmVLSVJ6errWrFmj9u3bq0KFCtbHlClTRl26dNGvv/6qxMTEbL3GhQsXFBUVpZUrV6pZs2aZxly7ds3mvWe1ZJm7u7tcXFys2f78808VKVJEVapU0a5du6zjcvpzz3D9+vVMGe+1CszSpUu1fft2TZo06W/HSdL48ePl4+Oj/v3733PsnW7evJntubrZ+Y5fu3ZN0u3pF/aQ8d9JxutkxdPT0/rzzZs3dfnyZT366KOSZPNnnaFPnz429/v16ydJ1n8BWLp0qcxms55//nmbPz8/Pz9VqlRJ69evN/w+Ll26pE2bNunll19WuXLlbPbd73+PwIPGdA4gH4qPj9eiRYvUoUMHHTp0SAMGDFCrVq1s5kSfOnVKklSlSpVMj69atap+/fVXm20JCQmS/v6fb/9q9OjR8vf313/+859M83pDQkJkMpk0fPhwvf3229bn/es852PHjmnfvn0qWbJklq9x8eJFSbenr/j7+6tYsWLZzncv7du3t/7s4uKiESNGqFOnTpJul4Tr169n+flVq1ZNZrNZp0+fVo0aNf72NVq3bq2tW7dKksLCwrR48eJMY15++eV7Zs2YD/7hhx8qJibGpsDeWfhy+nPPMHr06Cx/gfnrFJkM6enpevPNN9W1a1fVrl37b99bTEyMPvroI82ePdvwyWuXL19WpUqVsjU2O9/xBg0aqGDBghozZoxKlChhnc7x18/vfiUlJUmSvLy87jomPj5eY8eO1aJFizL9OVy9ejXT+L++/4oVK8rFxcV6LsOxY8dksVju+jndz4obf/zxh6Tb8+KBvIoSDeRD7733np577jlJ0scff6xHH31Uw4cP14cffnjfzxkXFydJ8vPzy9b4w4cPa/78+fr888+z/Eu4Tp06Gj16tMaOHasvvvjirs9
"text/plain": [
"<Figure size 800x600 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAtEAAAI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gQXl7e5van5nz/m9s3LhRP//8c4Zqp0yZoujoaNPHKFmypPU1GB8fr/79+9+z/vbXxHvvvWezLTY2Vi1btpRhGAoJCZGPj48kaejQoab7SnX58mVdvnxZfn5+NuO///67Fi9erNdee02FChXS9OnT1bFjR0VGRqpYsWJq0qSJfHx8FBYWpmeffdbmsWFhYSpXrpwCAgIkSR07dtSBAwc0aNAglSlTRufPn9eaNWsUGRmpMmXKpNtXcnKyWrdurfDwcHXu3Fmvv/66rly5ojVr1mj//v0qV66cJGnatGlq27atunXrpqSkJM2fP1/PP/+8li9frlatWt33+YeFhalp06by9PRU586dNWLECP300096/vnnM9xLYGCgZs6cqf79+9v8jKpWrVq6x+zUqZPGjh2rqKgoeXp62pzzs2fPqnPnzuk+rkOHDvrrr7/0/fff27xOihcvru7du+uVV17R/v37VaVKFetjduzYob/++kujRo2677kAJEkGgAduzpw5hiRj+fLlRrly5QxJRosWLdKtTUpKMjw8PIwqVaoY165ds44vX77ckGSMHj3apv7GjRuGJGPcuHFpjhcREWEdk2SMGTPGev+tt94yPDw8jFq1ahmNGze2jo8bN86QZKSkpNgcp3Tp0kbPnj2t9ydMmGAUKFDA+Ouvv2zqRowYYdjb2xuRkZGGYRjG2rVrDUnG4MGD0zzXO49xt95TrVu3zpBkrFu3zjp2/fp1w87OznjttdesY+3btzccHR2N48ePW8fOnj1rFCpUyGjUqFGa/d7Pa6+9ZhQsWDBNHwsXLkxTW6BAAZvzdP36dSM5OdmmJiIiwnBycjLGjx9vHcvq8x4REWFIMj788MM0PVauXNnme57eea1bt67RsmXLNK+bMWPGGLf/V3L+/HmjUKFC1trb93Ev9evXN6pUqWK9f+HChTTHSvXll18akoyTJ09axxo3bmzzHFatWmVIMr7//nubx5YuXdpo1arVffuRZPTp08e4cOGCcf78eWPbtm1G8+bNDUnGlClTbOocHR2NY8eOWcf27NljSDI+/fRT69jIkSMNJycnIyYmxjp2/vx5w8HBwfocL1++fNfv0e3ufK5ff/21Icn4+OOP09Te/vq5evWqzbakpCSjSpUqRrNmzWzG73yNGYZhREdHGw4ODsaXX35pHatfv77Rrl07m7qM9HKv7+2dr6cjR46kOZeG8f//Bm9/Tnfu88MPP0z3Z0dMTIzh7OxsDB8+3GZ88ODBRoECBYz4+Pg0fQHpYToHkIN69eqlU6dOqWvXrlq9erUWLlyYpuaPP/7Q+fPn9dprr9nMFWzVqpUqVqyY5g1cSUlJkiQnJ6cM93HmzBl9+umneuedd1SwYEGbbR4eHpKk06dP33MfCxcuVMOGDVWkSBFdvHjRegsMDFRycrI2btwoSfrf//4ni8WiMWPGpNlHZpe2io2N1cWLFxUZGanJkycrJSVFzZo1k3Trytjq1avVvn17lS1b1voYLy8vde3aVb///rvi4uIydIzo6GiFh4drxYoVatSoUZqaK1eu2Dz3ixcvpqlxcnKSnZ2dtbd//vlHBQsW1OOPP65du3ZZ67L6vKe6evVqmh7vtwrM4sWLtWPHDn3wwQf3rJOkCRMmyM3NTYMHD75v7e2uX7+e4bmwGXmNX7lyRZJUrFgxU33cbvbs2SpevLg8PDxUt25dbdq0SSEhIRoyZIhNXWBgoPVqr3Trqqqrq6v+/vtv61iPHj2UmJhoM31iwYIFunnzpl588UVJt1Y5cXR01Pr163X58uUM9/m///1P7u7uGjRoUJptt/+bcnFxsX59+fJlxcbGqmH
"text/plain": [
"<Figure size 800x600 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAtEAAAJbCAYAAAAi4si5AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAABiW0lEQVR4nO3de3yO9ePH8fe9sc1hB6eZZRgTc86xORWNEWlSEUUSyTlKdHBMDkWOkepLSeUQEuWQnI2Y8zGHyakNzTYbxrbr90eP3T+3jXbpnvser+fjscej+7o+u+73fd+jt2uf63NZDMMwBA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ZhekcwH0mNjZW33//vVq3bq2DBw+qb9++atq0qc2c6D///FOSVK5cuQzfX758eW3atMlmW1xcnKSMBeBOhg4dKn9/f7322msZ5vWGhITIYrFo8ODB+uCDD6zHvXWe89GjR7V3714VKVIk0+c4f/68pH+mr/j7+6tgwYJZzvdvbl4lwMXFRe+9957atGkj6Z9VFq5cuZLp+xccHKy0tDSdPn1aFStWvONzhIWFadu2bZKkZs2aad68eRnGvPLKK/+aNX0++KeffqqoqCibAntz4bP3+55u6NChmf4D5tYpMulSU1P1zjvvqEOHDhlK262ioqL02Wefafr06aYvjL148aLKli2bpbFZ+RmvWbOmcufOrWHDhqlw4cLW6Ry3vn+Z8fT0lPTPlJKb/yy2adPGuqTcgAEDbD67o0eP6tC
"text/plain": [
"<Figure size 800x600 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAtEAAAIrCAYAAAApwMV4AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAABO60lEQVR4nO3deVhUdf//8deAAm7gikCi4pIr6u1yK5nmQqJhrpVbuWSZ5pJSuZS5VpRlqWXa4h1WWma3mWmi5lqKmlvu3mYoLuEOCCoqzO8Pf5yvE6h8CGTQ5+O65rqYz3nPOe85Tvby8DmfsdntdrsAAAAAZJpLbjcAAAAA5DWEaAAAAMAQIRoAAAAwRIgGAAAADBGiAQAAAEOEaAAAAMAQIRoAAAAwRIgGAAAADBGiAQAAAEOEaAAAAMAQIRoAkOclJiZqypQp1vO4uDhNnz499xrKQ8aNGyebzaYzZ87kditAnkKIBu5RERERstls2rJlS7ptn376qWw2mzp06KCUlJRc6A4wU6BAAY0ePVpz5szR0aNHNW7cOP3444+53Va2iIuLk4eHh2w2m/bt25fl/bz55ptauHBh9jUG3OMI0QAcfP/99xowYIC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eGouJidGYMWO0aNEih3FJ1vxtIK8gRAP3uHfeeUePP/64JOmTTz5Ro0aNNGrUKH300UdZ3mdsbKwkycfHJ1P1+/btU0REhL766ivlz58/3fbatWtr7Ni
"text/plain": [
"<Figure size 800x600 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAtEAAAIrCAYAAAApwMV4AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAABdYUlEQVR4nO3deVhUdf//8deAsqgsuSCghLjkvmtKZqaiaLjgUmaWZpZLLimVS5nrXajd5pJby32LduudS2UuiRpupbhr7t5mmCuoGSAuKMz5/eGP+TqCyiGMUZ+P65rrcj7nPee85wj64vA5n7EYhmEIAAAAQLY55XUDAAAAwIOGEA0AAACYRIgGAAAATCJEAwAAACYRogEAAACTCNEAAACASYRoAAAAwCRCNAAAAGASIRoAAAAwiRANAMhVKSkpmjx5su15YmKipk+fnncN/Y2OHz8ui8WiqKioe9a++uqrKlWq1H3v6X4ZNWqULBZLXrcB5BlCNOAAoqKiZLFYtGPHjkzbvvjiC1ksFoWHhys9PT0PugPMcXd31/DhwzVv3jydPHlSo0aN0rJly/K6rb/EYrGoX79+mcY/+ugjWSwWvfbaa7JarXnQWe7I+Dco4+Hm5iZ/f3+FhoZq6tSpunTpUl63CDicfHndAIA7++6779SnTx81bNhQX3/9tZydnfO6JeCenJ2dNXr0aHXt2lVWq1Wenp5asWJFXreV68aNG6f3339f3bp105dffiknJycFBgbq6tWryp8/f163lyNjxoxRUFCQbty4ofj4eK1fv14DBw7UJ598oqVLl6patWq22uHDh2vo0KF52C2QtwjRgINav369OnfurEqVKmnZsmVyc3PL65aAbHv77bfVqVMnnTx5UhUrVpS3t3det5SrPv74Yw0bNkxdu3bVv//9bzk53fzFbsZV3Ad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HJ+P33321jjRo1snsPq1atMiQZ//3vf+1eGxgYaISFhd2zH0lGYGCgIcno3LmzkZaWlmVdxnmdPXu2baxGjRqGn5+fkZiYaBtbvXq1bZ+3v7ZIkSLGxYsXbePff/+9IclYtmyZbaxp06ZG1apVjWvXrtnGrFar8dRTTxnlypWzjX322WeGJOPQoUO2sevXrxtFixa1+7rJ+L7avn37Hc+Bl5eXUbNmTdvz2/+uJ02aZEgyzp8/f8d9fPXVV4aTk5Px008/2Y3PmjXLkGRs2rTJNnblypVMrw8NDTVKly5te/7dd9/ds++ffvrJkGTMmzfPbjw6OjrLcSC7mM4BOJBXX31VJ0+e1EsvvaTVq1dr0aJFmWp27Nihc+fO6c0337SbexkWFqYKFSpkuoHr+vXrkiRXV9ds93H69Gl9+umn+uCDD1SoUCG7bT4+PpKkU6dO3XUfixYtUsOGDfXYY4/pwoULtkdISIjS09O1ceNGSdI333wji8WikSNHZtpHTpfPSkpK0oULF3TixAlNmDBBVqtVTZo0kSSlp6dr9erVCg8PV+nSpW2v8fPz00svvaSff/5ZycnJ2TpGQkKCYmJitGLFCj3zzDOZai5dumT33i9cuJCpxtXV1XY1Mz09XX/88Yft1+C7du2y1eX2ec9w5cqVTD3eaxWYb7/9Vtu3b9e4cePuWidJY8eOlZeXlwYMGHDP2ltdu3Yt23OLs/M1nrG6RJEiRUz1cauMq+lBQUHZvsn37Nmz2rNnj7p162Y3LatZs2aqVKlSlq/p1KmTHnvsMdvzhg0bSrr5Wwvp5hSgtWvX6oUXXrD7Gvvjjz8UGhqqo0eP2qZ2vfDCC3Jzc9O8efNs+1u1apUuXLigl19+2cS7vzkV6W6rdGT8Buz777+/40o
"text/plain": [
"<Figure size 800x600 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAtEAAAIrCAYAAAApwMV4AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6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pqanavn27JOm7776TxWJRaGhohn2YueJ3p4SEBF26dEnR0dEKCwtTWlqamjdvLklKTU3Vxo0b1aFDB1WqVMm6TdmyZdW9e3f9+OOPWfpRckJCgmJjYxUeHq61a9eqadOmGWquXLli89kvXbqUocbR0dE69jM1NVWXL1+Ws7OzqlWrpv3791vrcvq8p7t69WqGHu83C8zy5cu1d+9eTZo06Z510u0rjK6urnrjjTfuW3un69evZ/k+gKx8x69cuSJJKlmypKk+pNuzjezevVvDhg2TdPsnQX379lXZsmU1ePBgpaSkZNhmy5YtCgwM1HPPPafly5dn+c9f7969ba7CNmnSRNLtn1hIsn43s3IVWrp9k2f6/tLS0hQXF6dbt26pQYMGNt+vdF26dFHx4sXvevyLFy9q+/bt6tOnjypUqGCzbfqfV8Mw9N1336lt27YyDMPmuxUYGKiEhIQMxw4ODr7vVXrgQWE4B/AIiIuL06JFi9SxY0cdO3ZMb775plq2bGkzJvq3336TJFWrVi3D9tWrV9ePP/5osyw+Pl6SsjR3bbrQ0FCVK1dOr732WoZxvf7+/rJYLBo1apQ++OAD637/Os751KlTOnT
"text/plain": [
"<Figure size 800x600 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"import matplotlib.pyplot as plt\n",
"# Список колонок для построения графиков\n",
2024-10-11 18:46:40 +04:00
"columns = ['Smoking', 'AlcoholDrinking', 'Stroke', 'DiffWalking', 'Sex',\n",
" 'AgeCategory', 'Race', 'Diabetic', 'PhysicalActivity', 'GenHealth', 'Asthma', 'KidneyDisease', 'SkinCancer']\n",
2024-10-11 18:41:52 +04:00
"\n",
"# Создание диаграмм зависимости\n",
"for column in columns:\n",
" plt.figure(figsize=(8, 6)) # Установка размера графика\n",
" if pd.api.types.is_numeric_dtype(df[column]): # Проверяем, является ли колонка числовой\n",
" # Проверяем, содержит ли колонка только два уникальных значения (0 и 1)\n",
" if df[column].nunique() == 2 and set(df[column].unique()).issubset({0, 1}):\n",
" # Если да, то строим столбчатую диаграмму\n",
" counts = df[column].value_counts() # Считаем количество повторений каждого значения\n",
" counts.plot(kind='bar') # Создаем столбчатую диаграмму\n",
" plt.title(f'Количество значений для {column}')\n",
" plt.xlabel(column)\n",
" plt.ylabel('Количество повторений')\n",
" else:\n",
" # Если колонка числовая, создаем диаграмму рассеяния\n",
" plt.scatter(df['HeartDisease'], df[column], alpha=0.5) # Создаем диаграмму рассеяния\n",
" plt.title(f'Зависимость HeartDisease от {column}')\n",
" plt.xlabel('HeartDisease (0 = нет, 1 = да)')\n",
" plt.ylabel(column)\n",
" plt.xticks([0, 1]) # Установка меток по оси X\n",
" plt.grid() # Добавление сетки для удобства восприятия\n",
" else:\n",
" # Если колонка не числовая, строим столбчатую диаграмму\n",
" counts = df[column].value_counts() # Считаем количество повторений каждого значения\n",
" counts.plot(kind='bar') # Создаем столбчатую диаграмму\n",
" plt.title(f'Количество значений для {column}')\n",
" plt.xlabel(column)\n",
" plt.ylabel('Количество повторений')\n",
"\n",
" plt.show() # Отображение графика"
]
},
{
"cell_type": "code",
2024-10-11 18:46:40 +04:00
"execution_count": 24,
2024-10-11 18:41:52 +04:00
"metadata": {},
"outputs": [],
"source": [
"# Функция для создания выборок\n",
"from sklearn.model_selection import train_test_split\n",
"\n",
"def split_stratified_into_train_val_test(\n",
" df_input,\n",
" stratify_colname=\"y\",\n",
" frac_train=0.6,\n",
" frac_val=0.15,\n",
" frac_test=0.25,\n",
" random_state=None,\n",
"):\n",
"\n",
" if frac_train + frac_val + frac_test != 1.0:\n",
" raise ValueError(\n",
" \"fractions %f, %f, %f do not add up to 1.0\"\n",
" % (frac_train, frac_val, frac_test)\n",
" )\n",
"\n",
" if stratify_colname not in df_input.columns:\n",
" raise ValueError(\"%s is not a column in the dataframe\" % (stratify_colname))\n",
"\n",
" X = df_input # Contains all columns.\n",
" y = df_input[\n",
" [stratify_colname]\n",
" ] # Dataframe of just the column on which to stratify.\n",
"\n",
" # Split original dataframe into train and temp dataframes.\n",
" df_train, df_temp, y_train, y_temp = train_test_split(\n",
" X, y, stratify=y, test_size=(1.0 - frac_train), random_state=random_state\n",
" )\n",
"\n",
" # Split the temp dataframe into val and test dataframes.\n",
" relative_frac_test = frac_test / (frac_val + frac_test)\n",
" df_val, df_test, y_val, y_test = train_test_split(\n",
" df_temp,\n",
" y_temp,\n",
" stratify=y_temp,\n",
" test_size=relative_frac_test,\n",
" random_state=random_state,\n",
" )\n",
"\n",
" assert len(df_input) == len(df_train) + len(df_val) + len(df_test)\n",
"\n",
" return df_train, df_val, df_test"
]
},
{
"cell_type": "code",
2024-10-11 18:46:40 +04:00
"execution_count": 25,
2024-10-11 18:41:52 +04:00
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"HeartDisease\n",
2024-10-11 18:46:40 +04:00
"No 292422\n",
"Yes 27373\n",
2024-10-11 18:41:52 +04:00
"Name: count, dtype: int64\n",
"\n",
2024-10-11 18:46:40 +04:00
"Обучающая выборка: (191877, 18)\n",
2024-10-11 18:41:52 +04:00
"HeartDisease\n",
2024-10-11 18:46:40 +04:00
"No 175453\n",
"Yes 16424\n",
2024-10-11 18:41:52 +04:00
"Name: count, dtype: int64\n"
]
},
{
"data": {
2024-10-11 18:46:40 +04:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAiMAAADECAYAAABN9CGiAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAAA8FklEQVR4nO3dd1xT1/sH8E8SIAkEkA0iAgVxQbUi2joAR0XEWid1i6Pan6u1to62bqtV61bU2joq2FbEUW2dVVtcWPfAgQoqKCMgmzCS8/uDb1JDAgImXMbzfr3yUm7OPfe5M0/OPeeGxxhjIIQQQgjhCJ/rAAghhBBSv1EyQgghhBBOUTJCCCGEEE5RMkIIIYQQTlEyQgghhBBOUTJCCCGEEE5RMkIIIYQQTlEyQgghhBBOGXAdACGEEN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Pz9PRU/Z2amsoAsHnz5qmmxcfHM4FAwL799lu1eW/dusUMDAw0psfGxjIAbOfOnapp8+bNY6/ulqioKAaAhYeHq8179OhRjenOzs4sKChII/ZJkyax0ru6dOwzZsxgtra2zNvbW22b7tq1i/H5fBYVFaU2/+bNmxkAdu7cOY3lvcrPz09V3x9//MEMDAzY9OnTtZatyPZgrGQ/vaqwsJB5enqyrl27qtXF5/NZv379NI5F5T7PyMhgpqamrH379iw/P19rmcLCQmZra8s8PT3Vyhw+fJgBYHPnzlVNGzVqFHN2dlar54cffmAA2KVLl7Suc+n1LO/16r6tzHFRensxxtiECROYsbExk8lkqml+fn4MANu8ebNG+dLnmpLynIu
2024-10-11 18:41:52 +04:00
"text/plain": [
"<Figure size 200x200 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
2024-10-11 18:46:40 +04:00
"Контрольная выборка: (63959, 18)\n",
2024-10-11 18:41:52 +04:00
"HeartDisease\n",
2024-10-11 18:46:40 +04:00
"No 58485\n",
"Yes 5474\n",
2024-10-11 18:41:52 +04:00
"Name: count, dtype: int64\n"
]
},
{
"data": {
2024-10-11 18:46:40 +04:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAi8AAADECAYAAABXyMEsAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAAA7o0lEQVR4nO3dd1gU1/oH8O8uHRakSbOAoigiNqKxArG3EHvsPXJjSTNXYxJjicYkxm6IJjdRo+YmKpYUe9QEscSKXVHBgkqT3hZ2z+8PfruXZUEBYYfy/TzPPsrszJl36r5z5pwZmRBCgIiIiKiKkEsdABEREVFpMHkhIiKiKoXJCxEREVUpTF6IiIioSmHyQkRERFUKkxciIiKqUpi8EBERUZXC5IWIiIiqFCYvRERE1ZAQAk+fPkVkZKTUoZQ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0adNE4U1dOPZZs2YJJycn4efnp7NON2/eLORyuQgLC9OZft26dQKACA8P15tfQQEBAdry/vjjD2FsbCxmzpxZ5LglWR9C5G+ngpRKpWjevLno2rWrTllyuVwMHDhQb1/UbPPk5GRhbW0tXn75ZZGVlVXkOEqlUjg5OYnmzZvrjPP7778LAOKTTz7RDhs3bpxwd3fXKefbb78VAMQ///xT5DIXXs5nfQpu29LsF4XXlxBCBAcHC0tLS5Gdna0dFhAQIACIdevW6Y1f+FjT0Bxz27dvL3bZWrZsKezs7LR/a84jUVFRQgghdu3aJQCIM2fOFFtGeS/vhQsXnht
2024-10-11 18:41:52 +04:00
"text/plain": [
"<Figure size 200x200 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
2024-10-11 18:46:40 +04:00
"Тестовая выборка: (63959, 18)\n",
2024-10-11 18:41:52 +04:00
"HeartDisease\n",
2024-10-11 18:46:40 +04:00
"No 58484\n",
"Yes 5475\n",
2024-10-11 18:41:52 +04:00
"Name: count, dtype: int64\n"
]
},
{
"data": {
2024-10-11 18:46:40 +04:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAg0AAADECAYAAAAcYBLBAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAAA4jUlEQVR4nO3dd1gUV9sG8Ht3gaUsvSg2RGwoVmKJKNgJaow99hajSdQ0E415Y43GqIklGkvyJsaoeROxRhN7id3YYxcVVBAVUDrLwu75/uBjw7ILLAgMyP27rr24mJ0580w5s8/MnDMjE0IIEBERERVALnUAREREVD4waSAiIiKzMGkgIiIiszBpICIiIrMwaSAiIiKzMGkgIiIiszBpICIiIrMwaSAiIiKzMGkgIiIqZvHx8bh9+zYyMzOlDqVYMWkgolL1008/QSaTISIiQupQqJyJjIzETz/9pP8/IiICGzZskC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7bwuwXudeXEEKMGzdO2NraCrVarR8WFBQkAIhVq1YZjZ+7rmXLrnOhoaF5LluTJk2Es7Oz/v/s40h4eLgQQoitW7cKAOLMmTN5llHcy3vhwoUC4y5sfc7N1L67d+9eAUBs3Lgx32lz8vLyEiNGjDAaXpjj2PDhw4VcLje5jnNOmy1nvc2tadOmwsPDQ8TFxemHXbp0ScjlcjF8+HD9MHOW/3nq15UrV4RcLhchISEG+1NezK2feR1Hs2Xv84cOHTL4383NTcTGxurHu3XrlrC0tBR9+/bVD+vVq5ewsrISd+7
2024-10-11 18:41:52 +04:00
"text/plain": [
"<Figure size 200x200 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"# Вывод распределения количества наблюдений по меткам (классам)\n",
"print(df.HeartDisease.value_counts())\n",
"print()\n",
"\n",
"data = df.copy()\n",
"\n",
"df_train, df_val, df_test = split_stratified_into_train_val_test(\n",
" data, stratify_colname=\"HeartDisease\", frac_train=0.60, frac_val=0.20, frac_test=0.20\n",
")\n",
"\n",
"print(\"Обучающая выборка: \", df_train.shape)\n",
"print(df_train.HeartDisease.value_counts())\n",
"counts = df_train['HeartDisease'].value_counts()\n",
"plt.figure(figsize=(2, 2))# Установка размера графика\n",
"plt.pie(counts, labels=counts.index, autopct='%1.1f%%', startangle=90)# Построение круговой диаграммы\n",
"plt.title('Распределение классов HeartDisease в обучающей выборке')# Добавление заголовка\n",
"plt.show()# Отображение графика\n",
"\n",
"print(\"Контрольная выборка: \", df_val.shape)\n",
"print(df_val.HeartDisease.value_counts())\n",
"counts = df_val['HeartDisease'].value_counts()\n",
"plt.figure(figsize=(2, 2))\n",
"plt.pie(counts, labels=counts.index, autopct='%1.1f%%', startangle=90)\n",
"plt.title('Распределение классов HeartDisease в контрольной выборке')\n",
"plt.show()\n",
"\n",
"print(\"Тестовая выборка: \", df_test.shape)\n",
"print(df_test.HeartDisease.value_counts())\n",
"counts = df_test['HeartDisease'].value_counts()\n",
"plt.figure(figsize=(2, 2))\n",
"plt.pie(counts, labels=counts.index, autopct='%1.1f%%', startangle=90)\n",
"plt.title('Распределение классов HeartDisease в тестовой выборке')\n",
"plt.show()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Сбалансируем распределение:"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"1. Балансировка данных оверсемплингом. Это метод, увеличивающий число наблюдений в меньшинственном классе для достижения более равномерного распределения классов."
]
},
{
"cell_type": "code",
2024-10-11 18:46:40 +04:00
"execution_count": 26,
2024-10-11 18:41:52 +04:00
"metadata": {},
"outputs": [
{
2024-10-11 18:46:40 +04:00
"name": "stdout",
"output_type": "stream",
"text": [
"Обучающая выборка после oversampling: (352472, 51)\n",
"HeartDisease\n",
"Yes 177019\n",
"No 175453\n",
"Name: count, dtype: int64\n"
2024-10-11 18:41:52 +04:00
]
2024-10-11 18:46:40 +04:00
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAsYAAAH4CAYAAABJ8Cv1AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAABhbUlEQVR4nO3dd3hTZf/H8U+6SweUUfYoZW9ZMmSogGxZ8sMJuFBRcT0qLhRUVFwoIuIjQ0RRREVxsFVAAUH2soyyV8voXsn5/VGbh9AW2tL25KTv13XlgiYnJ9+cnNz55M597mMzDMMQAAAAUMJ5mV0AAAAA4A4IxgAAAIAIxgAAAIAkgjEAAAAgiWAMAAAASCIYAwAAAJIIxgAAAIAkgjEAAAAgiWAMAADyKCMjQ6dOndKhQ4fMLgUoEgRjAMVq1qxZstlsio6ONrsUwG0sWrRImzdvdv793XffaceOHeYVdIGoqCjdc889qly5svz8/FSxYkW1b99enDgXnihfwTjrAy3rEhAQoHr16unBBx/UyZMni6pGwOO9+OKLstlsiomJyfH2WrVqqW/fvsVc1f9MnTpVs2bNyn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5cuX13333SfDMJSQkKBHHnlE7du313333Zft/s8884zsdrtee+21fD2vnBRoKMXFsp5suXLlJEn79+/Xd999p5tuukkRERE6efKkPvroI3Xp0kU7d+5UlSpVJEl2u119+/bV8uXLNWzYMI0ZM0bx8fFaunSptm/frsjISOdj3Hzzzerdu7fL444dOzbHel555RXZbDY99dRTOnXqlN59911169ZNmzdvVmBgoCRpxYoV6tWrl1q1aqVx48bJy8tLM2fO1HXXXadVq1apbdu22dZbrVo1TZw4UVLmOJn7778/x8d+/vnnNXToUN199906ffq03n//fXXu3FmbNm1SmTJlst3n3nvvVadOnSRJ33zzjb799luX20eNGqVZs2Zp5MiRevjhh3XgwAFNmTJFmzZt0po1a+Tr65vjdsiPc+fOOZ/bhRwOh/r376/Vq1fr3nvvVcOGDbVt2za98847+ueffy77IX+xmTNn6rnnntNbb72lW265JcdlLrc9Jk+erP79++vWW29VWlqa5s2bp5tuukmLFi1Snz59nMu99NJLevHFF9WhQweNHz9efn5+WrdunVasWKEePXpIyvzAvvPOO9W4cWONHTtWZcqU0aZNm/TLL78468va9m3atNHEiRN18uRJTZ48WWvWrMn2mpYvX17vvPOOJOnIkSOaPHmyevfurcOHD+f42l/szJkzOV7vcDiyXZfX/WLWrFkKDg7WY489puDgYK1YsUIvvPCC4uLiNGnSJJd1xsbGqlevXho2bJhuu+0253jhhx56SMHBwXr22WclSRUrVrzsc5GkIUOG6K677tKSJUtybEwl6dSpU+rRo4cqVKigp59+WmXKlFF0dLS++eabInu+aWlpuuGGG5SamqqHHnpIlSpV0tGjR7Vo0SKdO3fO+ZNxQd7PF5szZ44kKSYmRlOnTtVNN92k7du3q379+jkuP2jQIJefIB999FE1bNhQ9957r/O6hg0bOv9/9uxZ9e7dW0OHDtXNN9+sr776Svfff7/8/PycXy4K+32cm7179+rjjz/O9fYHH3xQZcqU0Ysvvqg9e/boww8/1MGDB50hSMoMoy+99JK6deum+++/37ncX3/9la29a9CggZ599lkZhqF9+/bp7bffVu/evV1mTLj77rs1e/ZsDRkyRI8//rjWrVuniRMnateuXdnalsJkGIb69++vlStX6q677lKLFi20ePFi/ec//9HRo0ed7UROcmuPL2XgwIE
"text/plain": [
"<Figure size 600x600 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
2024-10-11 18:41:52 +04:00
}
],
"source": [
"from imblearn.over_sampling import ADASYN\n",
"from sklearn.compose import ColumnTransformer\n",
"from sklearn.preprocessing import OneHotEncoder\n",
"\n",
"categorical_features = ['Smoking', 'AlcoholDrinking', 'Stroke', 'DiffWalking', 'Sex', 'AgeCategory', 'Race', 'Diabetic', 'PhysicalActivity', 'GenHealth', 'Asthma', 'KidneyDisease', 'SkinCancer'] # Ваши категориальные признаки\n",
"numeric_features = ['BMI', 'PhysicalHealth', 'MentalHealth', 'SleepTime'] # Ваши числовые признаки\n",
"\n",
"# Создание пайплайна для обработки категориальных данных\n",
"preprocessor = ColumnTransformer(\n",
" transformers=[\n",
" ('cat', OneHotEncoder(), categorical_features), # OneHotEncoder для категориальных данных\n",
" ('num', 'passthrough', numeric_features) # Оставляем числовые колонки без изменений\n",
" ]\n",
")\n",
"\n",
"# Создание экземпляра ADASYN\n",
"ada = ADASYN()\n",
"\n",
"# Преобразование данных с помощью пайплайна\n",
"X = preprocessor.fit_transform(df_train.drop(columns=['HeartDisease']))\n",
"y = df_train['HeartDisease']\n",
"\n",
"# Применение ADASYN\n",
"X_resampled, y_resampled = ada.fit_resample(X, y)\n",
"\n",
"# Создание нового DataFrame\n",
"df_train_adasyn = pd.DataFrame(X_resampled)\n",
"# Восстанавливаем названия столбцов для DataFrame\n",
"ohe_columns = preprocessor.named_transformers_['cat'].get_feature_names_out(categorical_features)\n",
"new_column_names = list(ohe_columns) + numeric_features\n",
"df_train_adasyn.columns = new_column_names\n",
"\n",
"# Добавление целевой переменной\n",
"df_train_adasyn['HeartDisease'] = y_resampled\n",
"\n",
"# Вывод информации о новой выборке\n",
"print(\"Обучающая выборка после oversampling: \", df_train_adasyn.shape)\n",
"print(df_train_adasyn['HeartDisease'].value_counts())\n",
"\n",
"# Визуализация\n",
"counts = df_train_adasyn['HeartDisease'].value_counts()\n",
"plt.figure(figsize=(6, 6))\n",
"plt.pie(counts, labels=counts.index, autopct='%1.1f%%', startangle=90)\n",
"plt.title('Распределение классов HeartDisease в тренировочной выборке после ADASYN')\n",
"plt.show()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"2. Балансировка данных андерсемплингом. Этот метод помогает сбалансировать выборку, уменьшая количество экземпляров класса большинства, чтобы привести его в соответствие с классом меньшинства."
]
},
{
"cell_type": "code",
2024-10-11 18:46:40 +04:00
"execution_count": 27,
2024-10-11 18:41:52 +04:00
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Обучающая выборка после undersampling: (32848, 18)\n",
"HeartDisease\n",
"No 16424\n",
"Yes 16424\n",
"Name: count, dtype: int64\n"
]
},
{
"data": {
2024-10-11 18:46:40 +04:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAwAAAADECAYAAAAoEEaxAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAABBhklEQVR4nO3dd1xTV/8H8E8SIIyAIsgSRURx4sJtHXWgOOvice/RVmtt9bHa1q211rqtq49bWxeOn9a9quKqe6GignUzFGQIIcn5/UGTEhIgIBiUz/v1yktzOffe7z13fu8990QihBAgIiIiIqJCQWruAIiIiIiI6N1hAkBEREREVIgwASAiIiIiKkSYABARERERFSJMAIiIiIiIChEmAEREREREhQgTACIiIiKiQoQJABERERFRIcIEgIiIiEyiUqkQGRmJv//+29yhENFbYAJARO/UmjVrIJFIEBERYe5QiAqMPXv24MqVK7rvO3fuxM2bN80XUDphYWEYMmQI3N3dYWVlBVdXV9SvXx9CCHOHRgVQ06ZN0bRpU3OHUSAYO98VlPrJUQKgXRDtx9raGr6+vhg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CgaNWoEANi+fTt27Nih9/dhw4ZhzZo1GDBgAEaOHInw8HAsXrwYly9fRkhICCwtLY3WQ07Exsbqli09jUaDDh064NSpUxg6dCgqVqyI69evY968ebh79262FzMZrV69Gt9//z3mzJmDnj17Gi2TXX0sWLAAHTp0QK9evaBUKrFp0yZ069YNe/bsQdu2bXXlpkyZgsmTJ6NBgwaYOnUqrKyscO7cORw9ehQBAQEA0i5MBg4ciMqVK2P8+PEoWrQoLl++jP379+vi09Z97dq1MXPmTLx48QILFixASEiIwTp1dnbGvHnzAACPHz/GggUL0KZNGzx69Mjous/o5cuXRodrNBqDYaZuF2vWrIFCocDXX38NhUKBo0ePYuLEiXj9+jVmz56tN82YmBgEBgaie/fu6N27t649/xdffAGFQoHvvvsOAODq6prtsgBA165dMWjQIBw8eBAzZswwWiYyMhIBAQEoXrw4xo0bh6JFiyIiIgLbt2/Pt+VVKpVo1aoVUlJS8MUXX8DNzQ1PnjzBnj17EBsbq7vbmZv9OaP169cDAKKjo7FkyRJ069YNN27cQPny5Y2W79y5M8qWLav7/tVXX6FixYoYOnSoblj6u8OvXr1CmzZtEBQUhB49emDLli347LPPYGVlpUui8no/zsy9e/fw66+/Zvr3ESNGoGjRopg8eTLu3LmDpUuX4uHDh7oTIJB20T1lyhS0aNECn332ma7cX3/9ZXC8q1ChAr777jsIIXD//n3MnTsXbdq00euhZvDgwVi7di26du2K0aNH49y5c5g5cyZCQ0MNji15SQiBDh064NixYxg0aBCqV6+OAwcO4L///S+ePHmiO04Yk9nxOCudOnVC586doVKpcObMGaxYsQJv3rzRbX+5ERMTgwcPHuDbb79F586dMXr0aFy4cAGzZ8/GjRs38Mcff+RqvZmyzWYUFxeHwMBAWFpaYu/evVAoFADyZttOf27X2rt3L37//Xe9YaYu46FDh9CuXTu4u7vjyy+/hJubG0JDQ7Fnzx58+eWXBvPXrjsAOHnyJFasWKH397w4DuXUjz/+CKlUijFjxiAuLg4//fQTevXqhXPnzunKrFy5EsOGDUODBg0watQoPHjwAB06dECxYsVQsmRJXbmcrqOjR49iy5YtGDFiBJydnVG6dGkcOnQIPXr0QPPmzTFr1iwAQGhoKEJCQnR1auq1p9bMmTNhY2ODcePG4d69e1i0aBEsLS0hlUrx6tUrTJ48GWfPnsWaNWvg7e2NiRMn6o3/559/YvPmzRg5ciTkcjmWLFmC1q1b4/z586hSpUq+1Pn
2024-10-11 18:41:52 +04:00
"text/plain": [
"<Figure size 200x200 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"from imblearn.under_sampling import RandomUnderSampler\n",
"\n",
"rus = RandomUnderSampler()# Создание экземпляра RandomUnderSampler\n",
"\n",
"# Применение RandomUnderSampler\n",
"X_resampled, y_resampled = rus.fit_resample(df_train.drop(columns=['HeartDisease']), df_train['HeartDisease'])\n",
"\n",
"# Создание нового DataFrame\n",
"df_train_undersampled = pd.DataFrame(X_resampled)\n",
"df_train_undersampled['HeartDisease'] = y_resampled # Добавление целевой переменной\n",
"\n",
"# Вывод информации о новой выборке\n",
"print(\"Обучающая выборка после undersampling: \", df_train_undersampled.shape)\n",
"print(df_train_undersampled['HeartDisease'].value_counts())\n",
"\n",
"# Визуализация распределения классов\n",
"counts = df_train_undersampled['HeartDisease'].value_counts()\n",
"plt.figure(figsize=(2, 2))\n",
"plt.pie(counts, labels=counts.index, autopct='%1.1f%%', startangle=90)\n",
"plt.title('Распределение классов HeartDisease в тренировочной выборке после Undersampling')\n",
"plt.show()"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "aimenv",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.5"
}
},
"nbformat": 4,
"nbformat_minor": 2
}