AIM-PIbd-31-Kouvshinoff-T-A/lab_2/laba2.ipynb

2025 lines
1.2 MiB
Plaintext
Raw Normal View History

{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# 1 Датасет: NASA - Nearest Earth Objects\n",
"#### https://www.kaggle.com/datasets/sameepvani/nasa-nearest-earth-objects \n",
"\n",
"There is an infinite number of objects in the outer space. Some of them are closer than we think. Even though we might think that a distance of 70,000 Km can not potentially harm us, but at an astronomical scale, this is a very small distance and can disrupt many natural phenomena. These objects/asteroids can thus prove to be harmful. Hence, it is wise to know what is surrounding us and what can harm us amongst those. Thus, this dataset compiles the list of NASA certified asteroids that are classified as the nearest earth object.\n",
"\n",
"В космосе находится бесконечное количество объектов. Некоторые из них находятся ближе, чем мы думаем. Хотя мы можем думать, что расстояние в 70 000 км не может потенциально навредить нам, но в астрономических масштабах это очень малое расстояние и может нарушить многие природные явления. Таким образом, эти объекты/астероиды могут оказаться вредными. Следовательно, разумно знать, что нас окружает и что из этого может навредить нам. Таким образом, этот набор данных составляет список сертифицированных NASA астероидов, которые классифицируются как ближайшие к Земле объекты.\n",
"\n",
"- Из этого описания очевидно что объектами иследования являются околоземные объекты.\n",
"- Атрибуты объектов: id, name, est_diameter_min, est_diameter_max, relative_velocity, miss_distance, orbiting_body, sentry_object, absolute_magnitude, hazardous\n",
"- Очевидная цель этого датасета - это научиться определять опасность объекта автоматически.\n"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"количество колонок: 10\n",
"колонки: id, name, est_diameter_min, est_diameter_max, relative_velocity, miss_distance, orbiting_body, sentry_object, absolute_magnitude, hazardous\n"
]
}
],
"source": [
"import pandas as pd\n",
"df = pd.read_csv(\"..//static//csv//neo_v2.csv\", sep=\",\")\n",
"print('количество колонок: ' + str(df.columns.size)) \n",
"print('колонки: ' + ', '.join(df.columns))"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Получение сведений о пропущенных данных\n",
"\n",
"Типы пропущенных данных:\n",
"- None - представление пустых данных в Python\n",
"- NaN - представление пустых данных в Pandas\n",
"- '' - пустая строка"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"id 0\n",
"name 0\n",
"est_diameter_min 0\n",
"est_diameter_max 0\n",
"relative_velocity 0\n",
"miss_distance 0\n",
"orbiting_body 0\n",
"sentry_object 0\n",
"absolute_magnitude 0\n",
"hazardous 0\n",
"dtype: int64\n",
"\n",
"id False\n",
"name False\n",
"est_diameter_min False\n",
"est_diameter_max False\n",
"relative_velocity False\n",
"miss_distance False\n",
"orbiting_body False\n",
"sentry_object False\n",
"absolute_magnitude False\n",
"hazardous False\n",
"dtype: bool\n",
"\n"
]
}
],
"source": [
"# Количество пустых значений признаков\n",
"print(df.isnull().sum())\n",
"\n",
"print()\n",
"\n",
"# Есть ли пустые значения признаков\n",
"print(df.isnull().any())\n",
"\n",
"print()\n",
"\n",
"# Процент пустых значений признаков\n",
"for i in df.columns:\n",
" null_rate = df[i].isnull().sum() / len(df) * 100\n",
" if null_rate > 0:\n",
" print(f\"{i} процент пустых значений: %{null_rate:.2f}\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Итог: пропущеных значений нет"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"инфографика на сайте и в datawrangelere показывает, что в столбцах orbiting_body и sentry_object у всех записей одно и тоже значение. Значит эти столбцы можно выкинуть из набора данных."
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"количество колонок: 8\n",
"колонки: id, name, est_diameter_min, est_diameter_max, relative_velocity, miss_distance, absolute_magnitude, hazardous\n"
]
}
],
"source": [
"df = df.drop(columns=['orbiting_body'])\n",
"df = df.drop(columns=['sentry_object'])\n",
"print('количество колонок: ' + str(df.columns.size)) \n",
"print('колонки: ' + ', '.join(df.columns))"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"я быстро посмотрев данные зашумленности не выявил"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"поля id и name в предсказании не помогут, но я их пока выкидывать не буду"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"посмотрим выбросы и усредним их:"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Колонка est_diameter_min:\n",
" Есть выбросы: Да\n",
" Количество выбросов: 8306\n",
" Минимальное значение: 0.0006089126\n",
" Максимальное значение: 0.32962154705\n",
" 1-й квартиль (Q1): 0.0192555078\n",
" 3-й квартиль (Q3): 0.1434019235\n",
"\n",
"Колонка est_diameter_max:\n",
" Есть выбросы: Да\n",
" Количество выбросов: 8306\n",
" Минимальное значение: 0.00136157\n",
" Максимальное значение: 0.7370561859\n",
" 1-й квартиль (Q1): 0.0430566244\n",
" 3-й квартиль (Q3): 0.320656449\n",
"\n",
"Колонка relative_velocity:\n",
" Есть выбросы: Да\n",
" Количество выбросов: 1574\n",
" Минимальное значение: 203.34643253\n",
" Максимальное значение: 114380.48061454494\n",
" 1-й квартиль (Q1): 28619.02064490995\n",
" 3-й квартиль (Q3): 62923.60463276395\n",
"\n",
"Колонка miss_distance:\n",
" Есть выбросы: Нет\n",
" Количество выбросов: 0\n",
" Минимальное значение: 6745.532515957\n",
" Максимальное значение: 74798651.4521972\n",
" 1-й квартиль (Q1): 17210820.23576468\n",
" 3-й квартиль (Q3): 56548996.45139917\n",
"\n",
"Колонка absolute_magnitude:\n",
" Есть выбросы: Да\n",
" Количество выбросов: 101\n",
" Минимальное значение: 14.8\n",
" Максимальное значение: 32.239999999999995\n",
" 1-й квартиль (Q1): 21.34\n",
" 3-й квартиль (Q3): 25.7\n",
"\n"
]
}
],
"source": [
"numeric_columns = ['est_diameter_min', 'est_diameter_max', 'relative_velocity', 'miss_distance', 'absolute_magnitude']\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\")\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"построим графики в надежде найти какие то зависимости опасности от других колонок"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAaoAAAK9CAYAAAB1tChIAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAABeWUlEQVR4nO3deVxU9f4/8NcMMMMmi7IjgqipuJGQXFdMEVzTzNxuidjVbl5L5appKmhamJqXNAurn1tZWllmN9dQyoWwXEpUTM1dQXBDQAaYOb8//DL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b8NYuKijJ4H02dOlWwsbExeC3EjlEPu3//vhAWFib4+fkJ169fr3RdMTExQnBwsEFbYGCgAEDYsWOHQXtycrIAQPjyyy/1bYWFhULz5s0N3utVGV/MvXaxsbEGf6OTJ08WXFxcqvwee5isdv2VW7NmDXbv3o0NGzbgpZdewoYNGww+5QMw2Od679495OXloXv37igqKkJWVpZBbWlpKfLy8pCbm4v09HR8++23aN++PTw8PEw+/tWrV7FixQrMnTvX6BP75s2b4eHhgVdffdVoOYVCYXJ9hw8fxldffYWkpCSD3ZcPe/HFF5GVlaXfxbd582a4urqid+/eBnW//fYbbty4gYkTJxocRxkwYABatWqFH374AQCQm5uLn3/+GePGjTPYEq2sn4+i1WqRl5eHvLw8UVshAHDs2DGcOXMGo0ePxs2bN/XLFxYWonfv3vj555/1u7Tc3NyQkZGBa9euVat/lfnxxx/1n/wffv5iJ2U8/H4rLCxEXl4eunTpAkEQcPToUaP
"text/plain": [
"<Figure size 400x800 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAaQAAAK9CAYAAABrfRj7AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAABfRklEQVR4nO3deVhU9f4H8PcMMMMmoLIpIrgl4poQhqaYorjkkpmmlYhd66p0Ta4bWYJpUWlmmUqpqJXdTC3b1DTUUiMtzMoFS3NLZXNjkxmYOb8//DExzjAcxoFzBt6v5+HR+c7nnPnMAN83Z5kzCkEQBBAREUlMKXUDREREAAOJiIhkgoFERESywEAiIiJZYCAREZEsMJCIiEgWGEhERCQLDCQiIpIFBhIREckCA4nqneDgYEycONFwe9++fVAoFNi3b59kPZH9SE5OhkKhQH5+vtSt2MT69euhUChw7tw5qVupVq0GUmpqKmJiYuDn5wcnJyf4+/sjKioK77//PvR6fW0+N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rywsBD5+fno3bs3SkpKkJWVZVRbVlaG/Px85OXlISMjA5999hm6dOkCb29vs49/6dIlLF++HC+++KLJX+Bbt26Ft7c3nn32WZPlFAqF2fVlZmZi8+bNSElJMdrtWNmTTz6JrKwsw665rVu3wtPTE/379zeq+/nnn5Gbm4upU6ca7QMeOnQoQkJC8PXXXwMA8vLy8P3332PSpElGW5aW+qyOTqdDfn4+8vPzRW1
"text/plain": [
"<Figure size 400x800 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAboAAAK9CAYAAABSGqmgAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAABjSUlEQVR4nO3deVhU9dsG8HsGmGGTTQREEXBJRFETU3E3CVQy1xS1RDJtkRSpXHJDrUwtc9fK3FJLrdRyQQlNCgkUV1Q0DbM0cEFAQNY57x+8nJ/jAA7DKMOZ+3NdXjXf85wzzwzDuTnryARBEEBERCRR8ppugIiI6Eli0BERkaQx6IiISNIYdEREJGkMOiIikjQGHRERSRqDjoiIJI1BR0REksagIyIiSWPQEZXDw8MDY8aM0esyx4wZAw8PD70us6Zt3LgRMpkM165deyLLj4yMhEwmeyLLftp+/fVXyGQyfP/99zXdil5cu3YNMpkMGzdurOlWHsuog27t2rUIDAyEs7MzzMzM4OLigh49emDz5s1QqVQ13R7VQjdv3kRkZCROnz5d061I1scff4zdu3fXdBtUixh10G3atAlWVlaYNWsWvv76a3zwwQdo0KABxowZg1GjRtV0e1QL3bx5E3Pnzi036L766itcunTp6TdVi82cORMPHjxQG2PQUVWZ1nQDNSk2NhZmZmZqYxMnTkTdunWxcuVKLFiwQHK7moxVXl4eLC0ta7SHRz9r9HimpqYwNTXq1VSNMoTfG30w6i26ilY8ZeEml//v7dmzZw+CgoLg6uoKpVKJJk2a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01NFZRKpTBv3jxx7Pjx4xo/izIhISGCu7u7+PjgwYMCAOHnn39Wq+vXr5/QuHFjnfp+HD8/P8HX11dtLDExUQAgbN68WRCE0p9Xs2bNhMDAQLWfXV5enuDp6Sm88MIL4ljZ5yk1NVUQBEG4deuWoFAohICAALX3a+XKlQIAYf369YIgCEJxcbHg6ekpuLu7C/fu3VPr5+HnnDNnjvDoasrKyqrcz8306dMFpVIpZGZmimO3bt0STE1N1X7XyhMeHi4AUHuP79+/L3h6egoeHh4aP3tB0Px5Ps6RI0cEAEKLFi2EgoICcXzZsmUCAOHcuXPiWHnrmwULFggymUzj96uMSqUSXnzxRcHa2lo4f/58pcuqaN1V3u/N7t27BQDCokWLxLHi4mKhW7duGp/1tm3bCk5OTsLdu3fFsTNnzghyuVwYPXq0OFbRe/foz/vzzz8XAAi3b98u9zVry6h3XZbZsGEDoqOjsXXrVowdOxZbt25V28oAAAsLC/H/79+/jzt37qBbt27Iy8tDSkqKWm1RURHu3LmD27dvIz4+Hrt27ULr1q3h6OhY7vPfuHEDK1aswKxZs2Btba027YcffoCjoyPeeecdjfkqOu06KSkJO3fuxIIFC9R2vz7s1VdfRUpKiriL8ocffoCtrS169+6tVnfixAncunULb7/9NszNzcXxoKAgeHl5ibt2bt++jdjYWLz22mtqW8KV9fk4JSUluHPnDu7cuYPCwsIqzatUKjV2C+7cuRMtWrSAl5eXuNw7d+7g+eefBwAcOXKk0uWVvZclJSW4e/euuBvl5MmTVXxlpZ5//nk4Ojpi+/bt4ti9e/cQHR2N4cOH66XvRw0fPhxJSUnibm8A2L59O5RKJQYMGAAAOH36NP7880+MHDkSd+/eFZ8vNzcXvXv3RmxsbIVnJf/yyy8oLCxEeHi42mdv3LhxsLGxET8vp06dQmpqKsLDw8U9AmV0/byMHj0aBQUFaqfvb9++HcXFxXjllVcqnXf//v3o0KEDunbtKo5ZW1tj/PjxuHbtGi5cuKBTT+U
"text/plain": [
"<Figure size 400x800 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAYQAAALMCAYAAADkXsVPAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAABIGElEQVR4nO3deXxMZ///8feEZJLIhiQIEdvPVlRLKUG0VGqraqslWkH39i6Vuwu3W5toS5dvVS2lrbtoVbWo9m5VbaW62JfaKY2laguVIERkzu8PJ3Mbk0SMkYO8no9HHpzrXOfMZ04m13vOMnNshmEYAgAUez5WFwAAuDoQCAAASQQCAMBEIAAAJBEIAAATgQAAkEQgAABMBAIAQBKBAAAwEQi4akyaNEk2m027du2yuhQnm82m5ORk5/TVWOP1aPHixbLZbJoxY4bVpXjFrl27ZLPZNGnSJKtLKZAlgTB+/HjFx8erXLly8vX1Vfny5RUXF6ePP/5YDofDipKAKyYzM1PJyclavHix1aUABbIkECZPnqxSpUppyJAh+s9//qN//etfqlixonr37q2ePXtaURKuAg899JBOnTqlmJgYq0vJlyc1ZmZmKiUlhUDAVa+kFQ+6ZMkS+fr6urT169dPZcuW1ZgxYzR8+HBVqVLFitJgoRIlSqhEiRJWl1Gga6FGWCMzM1OBgYFWl3FZLNlDuDAMcuWGgI/P/8r6+uuv1bFjR0VFRclut6t69ep65ZVXlJOT47Js69atZbPZnD/h4eHq2LGjNm7c6NLvwmPCkvTWW2/JZrOpdevWLu2nT59WcnKyatasKX9/f1WoUEH33HOPdu7cKSn/44JPP/20bDabevfu7WzLPfbs5+enw4cPu/RfunSps+5Vq1a5zJs+fboaNWqkgIAAhYeH68EHH9S+ffvctt3WrVt1//33KyIiQgEBAapVq5YGDx4sSUpOTnbZNnn95L57bd26terVq+e2/sLIXXb9+vWKi4tTYGCgatSo4TwO/OOPP6pp06bO+hYsWOCyfF7H51etWqX4+HiFh4crICBAVatWVd++fV2WmzZtmho1aqTg4GCFhISof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v3lxDhw6Vn5+fli9frh9++EHt2rWTJH3yySdKTExUfHy83njjDWVmZmrcuHFq0aKF1q5dW+Ae+sGDB9W8eXNlZmY69+wnT56su+66SzNmzFDXrl1Vp04dffLJJ85lPvjgA23ZskXvvPOOsy13GxTk9ddfl4+Pj5577jmlp6frzTffVM+ePbV8+XJnn+nTpyszM1NPPvmkypYtqxUrVmj06NH6888/NX36dElyq0c697eflJSkyMhIZ9uljDdHjhxR+/bt1b17dz344IMqV66cDMNQly5d9PPPP+uJJ55QnTp1NGvWLCUmJro9twULFqh9+/aqVq2akpOTderUKY0ePVqxsbFas2bNJR8l2bRpkzp16qQGDRpo6NChstvt2rFjh3755ZfCr8SwUK1atQxJzp9evXoZ2dnZLn0yMzPdlnv88ceNwMBA4/Tp0862uLg4Iy4uzqXfv/71L0OScejQIWebJOPll192Tr/wwgtGZGSk0ahRI5flP/roI0OSMWLECLfHdzgchmEYRmpqqiHJmDhxonPe/fffb9SrV8+Ijo42EhMTne0TJ040JBk9evQw6tev72w/efKkERISYiQkJBiSjJUrVxqGYRhnzpwxIiMjjXr16hmnTp1y9v/2228NScZLL73kbGvVqpURHBxs7N69O886LxQTE+NS2/ni4uKMG264Ic95FxMXF2dIMqZOneps27p1qyHJ8PHxMZYtW+Zsnzt3rtu2y91GqamphmEYxqxZs1y2SV769+9vhISEGGfPnvWoZsMwjHXr1hmSjKeeesqlPfd3cv7rxZMaDx8+7LaeXHm9vj/77DNDkrFkyRJn28svv2xIMvr27evSt2vXrkbZsmWd07///rvh4+NjdO3a1cjJyXHpm/t6OH78uBEWFmY8+uijLvMPHDhghIaGurVf6NlnnzUkGT/99JOz7fjx40bVqlWNKlWquD2uYRhGYmKiERMTU+B6z7do0SJDklGnTh0jKyvL2f7uu+8akowNGzY42/LahsOHDzdsNpvb30Quh8NhdOrUyQgKCjI2bdpU4LryG28kGePHj3fp+9VXXxmSjDfffNPZdvbsWaNly5Zur/eGDRsakZGRxpEjR5xtv/32m+Hj42P06tXL2Zbftst9TeR65513DEnG4cOH83zOhWHpZacTJ07U/Pnz9emnn+rhhx/Wp59+6vKuVZICAgKc/z9+/LjS0tLUsmVLZWZmauvWrS59s7OzlZaWpsOHD2vp0qWaNWuWGjRooPDw8Dwff9++fRo9erSGDBmioKAgl3kzZ85UeHi4nnnmGbflLnzXlmv16tWaPn26hg8f7nLY63wPPfSQtm7d6jw0NHPmTIWGhqpNmzYu/VatWqVDhw7pqaeekr+/v7O9Y8eOql27tnP3/PDhw1qyZIn69u3rsmdVUJ0Xk5OTo7S0NKWlpenMmTOXtGxQUJC6d+/unK5Vq5bCwsJUp04dNW3a1Nme+/8//vgj33Xl7gF9++23ys7OzrfPyZMnNX/+/Euq83zfffedpHPnsc737LPPXnTZwtRYkPNf36dPn1ZaWppuvfVWSdKaNWvc+j/xxBMu0y1bttSRI0eUkZEhSfrqq6/kcDj00ksvub0Gc18P8+fP17Fjx9SjRw/n7zktLU0lSpRQ06ZNtWjRogJr/u6779SkSRO1aNHC2RYUFKTHHntMu3bt0ubNmy9hCxSsT58+8vPzc063bNlSkuvr5vxtePLkSaWlpal58+YyDENr167Nc72vvPKKvv32W02aNEl169bNc10XG2/sdrv69Onj0vbdd9+pZMmSevLJJ51tJUqUcBtH9u/fr3Xr1ql3794qU6aMs71Bgwa64447nK/JS5H7Wvz
"text/plain": [
"<Figure size 400x800 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAbQAAAK9CAYAAABM05kTAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAABjpElEQVR4nO3deVwU9f8H8NdyLfclt6AgHmigFl6oKV7gkXflkYlHWomaR/lNywO1MPtm5q3fzONrpqlpVt4aWoaaGB6ppAjeoKCwci/s/P7wy/xcdheWZXFxfD0fDx46n/nM7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yfI5XJh6tSpYltBQYH4ui2VkpIiyOVyYe7cuTrX//333wsA1Ppoe97x8fECAGHjxo1iW+n+qX379mp/b6X7oebNmwuFhYVi+5o1awQAan8/ixcvFgAImzZtUls+LCxMsLe3F1+/urZd2b/Rhw8fCgCEzz//XOdz1sdTG7a/bt06HDx4EN9++y1Gjx6Nb7/9Vu2oAQBsbGzE/z969AgZGRl4+eWXkZeXh8uXL6v1VSqVyMjIwP379xEfH4+dO3eiadOmcHNz0/r4t2/fxtKlSzFz5kyNd1c7duyAm5sbJkyYoLGcruHJCQkJ2LZtG2JjY9VOmz7pzTffxOXLl8VTizt27ICTkxO6dOmi1u/06dO4d+8exo0bB2tra7G9V69eCAoKEk+p3b9/H8eOHcOoUaPUjmzLq7MiJSUlyMjIQEZGBoqKivRe7snfVW5uLjIyMtC2bVsIgoC//vpLo//48ePVah0/fjy
"text/plain": [
"<Figure size 400x800 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"import matplotlib.pyplot as plt\n",
"\n",
"# Список числовых колонок, для которых мы будем строить графики\n",
"numeric_columns = ['est_diameter_min', 'est_diameter_max', 'relative_velocity', 'miss_distance', 'absolute_magnitude']\n",
"\n",
"# Создание диаграмм зависимости\n",
"for column in numeric_columns:\n",
" plt.figure(figsize=(4, 8)) # Установка размера графика\n",
" plt.scatter(df['hazardous'], df[column], alpha=0.5) # Создаем диаграмму рассеяния\n",
" plt.title(f'Зависимость {column} от hazardous')\n",
" plt.xlabel('hazardous (0 = нет, 1 = да)')\n",
" plt.ylabel(column)\n",
" plt.xticks([0, 1]) # Установка меток по оси X\n",
" plt.grid() # Добавление сетки для удобства восприятия\n",
" plt.show() # Отображение графика"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Создадим выборки данных. разбивать будем относительно параметра опасный, ведь это тот самый параметр по которому наша выборка разбивается на классы. И собственно его нам и надо будет предсказывать"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Requirement already satisfied: scikit-learn in d:\\мии\\aim-pibd-31-kouvshinoff-t-a\\laba\\lib\\site-packages (1.5.2)\n",
"Requirement already satisfied: numpy>=1.19.5 in d:\\мии\\aim-pibd-31-kouvshinoff-t-a\\laba\\lib\\site-packages (from scikit-learn) (2.1.1)\n",
"Requirement already satisfied: scipy>=1.6.0 in d:\\мии\\aim-pibd-31-kouvshinoff-t-a\\laba\\lib\\site-packages (from scikit-learn) (1.14.1)\n",
"Requirement already satisfied: joblib>=1.2.0 in d:\\мии\\aim-pibd-31-kouvshinoff-t-a\\laba\\lib\\site-packages (from scikit-learn) (1.4.2)\n",
"Requirement already satisfied: threadpoolctl>=3.1.0 in d:\\мии\\aim-pibd-31-kouvshinoff-t-a\\laba\\lib\\site-packages (from scikit-learn) (3.5.0)\n",
"Note: you may need to restart the kernel to use updated packages.\n"
]
}
],
"source": [
"pip install scikit-learn"
]
},
{
"cell_type": "code",
"execution_count": 7,
"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",
" Splits a Pandas dataframe into three subsets (train, val, and test)\n",
" following fractional ratios provided by the user, where each subset is\n",
" stratified by the values in a specific column (that is, each subset has\n",
" the same relative frequency of the values in the column). It performs this\n",
" splitting by running train_test_split() twice.\n",
"\n",
" Parameters\n",
" ----------\n",
" df_input : Pandas dataframe\n",
" Input dataframe to be split.\n",
" stratify_colname : str\n",
" The name of the column that will be used for stratification. Usually\n",
" this column would be for the label.\n",
" frac_train : float\n",
" frac_val : float\n",
" frac_test : float\n",
" The ratios with which the dataframe will be split into train, val, and\n",
" test data. The values should be expressed as float fractions and should\n",
" sum to 1.0.\n",
" random_state : int, None, or RandomStateInstance\n",
" Value to be passed to train_test_split().\n",
"\n",
" Returns\n",
" -------\n",
" df_train, df_val, df_test :\n",
" Dataframes containing the three splits.\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",
"execution_count": 8,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"hazardous\n",
"False 81996\n",
"True 8840\n",
"Name: count, dtype: int64\n",
"\n",
"Обучающая выборка: (54501, 6)\n",
"hazardous\n",
"False 49197\n",
"True 5304\n",
"Name: count, dtype: int64\n"
]
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAgkAAADECAYAAAAVi7K7AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAAA9TklEQVR4nO3dd1xT1/sH8E8SIGHvLbLBgQNx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7l5OQopv/xxx8MAFu7dq2ibnd3d+bv769YDmOMFRQUMGdnZ9azZ0+VZXXs2JF5eXkp3qempjIAbMGCBYppiYmJTCAQsCVLlijNe+fOHaalpaUyPTY2lgFgYWFhimkLFixgZTfLxYsXGQC2e/dupXmPHz+uMt3R0ZH169dPJfYpU6aw8pu6fOyzZ89mVlZWzMfHR6lNd+3axfh8Prt48aLS/Js3b2YA2KVLl1SWV5afn5+ivr///ptpaWmxmTNnqi1bmfZgrHQ7lVVcXMy8vLxYt27dlOri8/ls4MCBKvuifJtnZWUxQ0ND1qFDB1ZYWKi2THFxMbOysmJeXl5KZY4cOcIAsPnz5yumjRkzhjk6OirVs3XrVgaAXb16Ve06l50XgNLngzHGvL29mY+PT5XXv7zY2FhmbGzMevbsySQSCWOMMYlEwoqKipTKZWZmMmtrazZu3DjFNPln0MjIiKWkpCiVHzBgABOJRCwpKUkx7f79+0wgEChtt1u3bjEALCgoSGn+WbNmMQDszJkzimnl9005R0dHNmbMGMX7Vq1aqd3f30R
"text/plain": [
"<Figure size 200x200 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Контрольная выборка: (18167, 6)\n",
"hazardous\n",
"False 16399\n",
"True 1768\n",
"Name: count, dtype: int64\n"
]
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAhUAAADECAYAAAAoGdPdAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAAA8hUlEQVR4nO3dd1wT9/8H8FcSQgJhLxm1iAxRUaso1oG4EbEWZ11V6Re1tWhttba2PxWtLXXUUXdbB47aCrbSasW9UOsGtyJLRURA2QRI8vn9wTf5EgJIIHCA7+fjkYfmuPvc++5yl3c+447HGGMghBBCCKklPtcBEEIIIaRpoKSCEEIIITpBSQUhhBBCdI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lHTx4kOnp6bHZs2dXOG919gdjpceprOLiYubh4cH69u2rVhafz2fDhg3T+Cwqj3lWVhYzNjZmXbt2ZYWFhRXOU1xczGxsbJiHh4faPAcOHGAA2IIFC1TTJk2axBwdHdXK+emnnxgAdunSpQq3ueyyANTOD8YY69ixI/P09NR6+8uLi4tjpqambMCAAUwmkzHGGJPJZKyoqEhtvpcvX7JmzZqxDz74QDVNeQ6amJiw58+fq80fEBDAxGIxS05OVk27c+cOEwgEasctJiaGAWBBQUFqy8+ZM4cBYCdOnFBNK//ZVHJ0dGSTJk1Sve/QoUOFn/dXUV7HEhMTVdMePHjAALBly5ZVe9kXL16wNm3asFatWrGMjAy1+WbNmsUAqJ03ubm5zMnJibVo0UL1mVRes8LDwzXWJZFI1La3rLL
"text/plain": [
"<Figure size 200x200 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Тестовая выборка: (18168, 6)\n",
"hazardous\n",
"False 16400\n",
"True 1768\n",
"Name: count, dtype: int64\n"
]
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAfQAAADECAYAAABp29OTAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAAA5wElEQVR4nO3dd1xT1/sH8E8SQgJhhi0OkKEoThTrQNCqiFjFqrRq6/riqLWtVmtr+1VxtPxad922VVGsrava2jqrVrFW6wBFUZHhqrIUhEAISc7vD5p8CWELXEye9+uVl+Zy7rnPvbk5zx3n3PAYYwyEEEIIeanxuQ6AEEIIIS+OEjohhBBiACihE0IIIQaAEjohhBBiACihE0IIIQaAEjohhBBiACihE0IIIQaAEjohhBBiACihE0IIMRp5eXlIS0uDTCbjOpQ6RwmdkEZg/PjxsLCw4DqMOhMZGQkej8d1GKSB5OfnY9WqVdr3OTk5WLduHXcBlcI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MAIuIiNCZf/bs2QwAO3nypHZa2X1To0WLFmzcuHHa9x06dCh3f6+Kph1LTU3VTrtz5w4DwL766qtq11N63y7r1VdfZe3atWNyuVw7Ta1Wsx49ejAvLy/ttPnz5zMAbP/+/Xp1lG6bNMrbxzTCwsKYqakpS05O1k77559/mKWlJevdu7d2WnXXv2PHjszR0ZFlZ2drp8XHxzM+n8/Gjh2rnVb2O5qRkcEsLS1ZSEgIA8BOnTpVbrwVzc8YY8eOHWMA2O7du7XTAgMDWdu2bSusR7Ofbt26Vee
"text/plain": [
"<Figure size 200x200 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"# Вывод распределения количества наблюдений по меткам (классам)\n",
"print(df.hazardous.value_counts())\n",
"print()\n",
"\n",
"\n",
"data = df[['est_diameter_min', 'est_diameter_max', 'relative_velocity', 'miss_distance', 'absolute_magnitude', 'hazardous']].copy()\n",
"\n",
"df_train, df_val, df_test = split_stratified_into_train_val_test(\n",
" data, stratify_colname=\"hazardous\", frac_train=0.60, frac_val=0.20, frac_test=0.20\n",
")\n",
"\n",
"print(\"Обучающая выборка: \", df_train.shape)\n",
"print(df_train.hazardous.value_counts())\n",
"hazardous_counts = df_train['hazardous'].value_counts()\n",
"plt.figure(figsize=(2, 2))# Установка размера графика\n",
"plt.pie(hazardous_counts, labels=hazardous_counts.index, autopct='%1.1f%%', startangle=90)# Построение круговой диаграммы\n",
"plt.title('Распределение классов hazardous в обучающей выборке')# Добавление заголовка\n",
"plt.show()# Отображение графика\n",
"\n",
"print(\"Контрольная выборка: \", df_val.shape)\n",
"print(df_val.hazardous.value_counts())\n",
"hazardous_counts = df_val['hazardous'].value_counts()\n",
"plt.figure(figsize=(2, 2))\n",
"plt.pie(hazardous_counts, labels=hazardous_counts.index, autopct='%1.1f%%', startangle=90)\n",
"plt.title('Распределение классов hazardous в контрольной выборке')\n",
"plt.show()\n",
"\n",
"print(\"Тестовая выборка: \", df_test.shape)\n",
"print(df_test.hazardous.value_counts())\n",
"hazardous_counts = df_test['hazardous'].value_counts()\n",
"plt.figure(figsize=(2, 2))\n",
"plt.pie(hazardous_counts, labels=hazardous_counts.index, autopct='%1.1f%%', startangle=90)\n",
"plt.title('Распределение классов hazardous в тестовой выборке')\n",
"plt.show()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"распределение плохое, соотношение классов сильно смещено, это может привести к проблемам в обучении модели, так как модель будет обучаться в основном на одном классе. В таких случаях стоит рассмотреть методы аугментации данных."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"аугментация данных оверсемплингом(Этот метод увеличивает количество примеров меньшинства)"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Requirement already satisfied: imblearn in d:\\мии\\aim-pibd-31-kouvshinoff-t-a\\laba\\lib\\site-packages (0.0)\n",
"Requirement already satisfied: imbalanced-learn in d:\\мии\\aim-pibd-31-kouvshinoff-t-a\\laba\\lib\\site-packages (from imblearn) (0.12.4)\n",
"Requirement already satisfied: numpy>=1.17.3 in d:\\мии\\aim-pibd-31-kouvshinoff-t-a\\laba\\lib\\site-packages (from imbalanced-learn->imblearn) (2.1.1)\n",
"Requirement already satisfied: scipy>=1.5.0 in d:\\мии\\aim-pibd-31-kouvshinoff-t-a\\laba\\lib\\site-packages (from imbalanced-learn->imblearn) (1.14.1)\n",
"Requirement already satisfied: scikit-learn>=1.0.2 in d:\\мии\\aim-pibd-31-kouvshinoff-t-a\\laba\\lib\\site-packages (from imbalanced-learn->imblearn) (1.5.2)\n",
"Requirement already satisfied: joblib>=1.1.1 in d:\\мии\\aim-pibd-31-kouvshinoff-t-a\\laba\\lib\\site-packages (from imbalanced-learn->imblearn) (1.4.2)\n",
"Requirement already satisfied: threadpoolctl>=2.0.0 in d:\\мии\\aim-pibd-31-kouvshinoff-t-a\\laba\\lib\\site-packages (from imbalanced-learn->imblearn) (3.5.0)\n",
"Note: you may need to restart the kernel to use updated packages.\n"
]
}
],
"source": [
"pip install imblearn"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Обучающая выборка после oversampling: (100385, 6)\n",
"hazardous\n",
"True 51188\n",
"False 49197\n",
"Name: count, dtype: int64\n"
]
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAqwAAADECAYAAABa+nMuAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAABAi0lEQVR4nO3deVwU9f8H8NfuAsstIIdgpoiKijdqhSLeqFh5p5l5/LwyK1Gz1K+KV2RWHnl1qilpah5fNc/MEvO+7xAlbxSU+1jY/fz+4Lsbyy6wIDALvJ6PBw/dOT7znpnPzL535jOfkQkhBIiIiIiIzJRc6gCIiIiIiArChJWIiIiIzBoTViIiIiIya0xYiYiIiMisMWElIiIiIrPGhJWIiIiIzBoTViIiIiIya0xYiYiIiMisMWElIiIq5zQaDeLi4nDr1i2pQyEqFUxYiczAsGHDYG9vL3UYJSYsLAwymUzqMIieW2RkJA4fPqz7fPjwYRw9elS6gHJ59OgRJkyYgJo1a8LKygpubm5o2LAhkpKSpA6NqMQVKWFds2YNZDKZ7s/a2hr16tXD+PHjERsbW1oxEhERSeLu3bsYN24cLl26hEuXLmHcuHG4e/eu1GHh5s2baNWqFTZu3IgxY8Zg165dOHDgAH777TfY2dlJHR4Vwa+//gqZTAYvLy9oNBqj09SqVUuXe8nlcjg5OaFx48YYPXo0Tpw48dzlq1QqLFmyBM2bN4ejoyOcnJzg5+eH0aNH4/r16wCA7t27w9nZ2Wi+l5iYCE9PT7z00kvQaDQ4fPiwLt4zZ84YTF+cizQWRZr6f+bMmQNvb29kZGQgMjISK1euxK+//orLly/D1ta2OEUSERGZnT59+mDx4sVo0qQJAOCVV15Bnz59JI4KGDN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2rVCuHh4YiNjcWSJUtw9OhRg33q6uqKRYsWAQDu3buHJUuWoEePHrh7967RfZ+bWq1GcHAwXnrpJXz++ec4ePAgvvjiC/j4+OjVNVPWf8yYMQa3ffbu3YuIiAi4u7sDAJKSkvDdd9/pbgElJyfj+++/R3BwME6ePIlmzZoZ7LuMjAyMHj0aSqUSLi4uuHTpErp27Qo3NzeEhYUhOzsbs2bNgoeHh8H6jRw5EmvXrkW/fv0wadIknDhxAuHh4bh27ZrBPjZFWFgYwsPDMXLkSLRu3RpJSUk4ffo0zp49iy5duhQ6/6JFi+Dq6oqkpCT88MMPGDVqFGrVqpXv7bh27dph3bp1us/z588HAL0vu4CAAN3/1Wo1unXrhpdffhmfffYZ9u7di1mzZiE7Oxtz5szRTSfl8Z17XQo7Z5b0cbBmzRrY29tj4sSJsLe3x6FDhzBz5kwkJSVh4cKFz73OBSluXczOzjaa3BQkMDAQo0ePhkajweXLl7F48WI8ePCgSD9k84qPj0dGRgbeeecddOzYEWPHjkV0dDSWL1+OEydO4MSJE1AqlQCKtt9MrbO5ZWVloW/fvrhz5w6OHj0KT09P3bjnrdtKpdLgh+SpU6ewdOlSvWGmruPFixcRGBgIS0tLjB49GrVq1UJ0dDR27typO55z0+47ALh27Ro++eQTvfHr1q3D0KFDERwcjAULFiAtLQ0rV65E27Ztce7cOZN+1ERERKBDhw6oVq0aBg4ciI8//hg7d+5E//79C51Xy97eHr1798b333+Pq1evws/Pr0jl16xZUzdtmzZtYGGRf2poYWGBb775BgEBAZg7dy7c3d1x9uxZ7N2712iTUEdHR4SGhmLmzJk4e/YsWrRoYfJ6GSjK5Vhtk4CDBw+KJ0+eiLt374qNGzeKqlWrChsbG3Hv3j0hhBAZGRlCrVbrzXv79m2hVCrFnDlzdMN++OEHAUB
"text/plain": [
"<Figure size 200x200 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"from imblearn.over_sampling import ADASYN\n",
"\n",
"# Создание экземпляра ADASYN\n",
"ada = ADASYN()\n",
"\n",
"# Применение ADASYN\n",
"X_resampled, y_resampled = ada.fit_resample(df_train.drop(columns=['hazardous']), df_train['hazardous'])\n",
"\n",
"# Создание нового DataFrame\n",
"df_train_adasyn = pd.DataFrame(X_resampled)\n",
"df_train_adasyn['hazardous'] = y_resampled # Добавление целевой переменной\n",
"\n",
"# Вывод информации о новой выборке\n",
"print(\"Обучающая выборка после oversampling: \", df_train_adasyn.shape)\n",
"print(df_train_adasyn['hazardous'].value_counts())\n",
"hazardous_counts = df_train_adasyn['hazardous'].value_counts()\n",
"plt.figure(figsize=(2, 2))\n",
"plt.pie(hazardous_counts, labels=hazardous_counts.index, autopct='%1.1f%%', startangle=90)\n",
"plt.title('Распределение классов hazardous в тренировачной выборке после ADASYN')\n",
"plt.show()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"P.S. можно было использовать ещё SMOTE, SVM-SMOTE, K-means SMOTE, SMOTE-N, SMOTE-NC, RandomOverSampler."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"проведём также балансировку данных методом андерсемплинга. Этот метод помогает сбалансировать выборку, уменьшая количество экземпляров класса большинства, чтобы привести его в соответствие с классом меньшинства."
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Обучающая выборка после undersampling: (10608, 6)\n",
"hazardous\n",
"False 5304\n",
"True 5304\n",
"Name: count, dtype: int64\n"
]
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAuYAAADECAYAAADTYuRHAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAABAH0lEQVR4nO3dd1gUV9sG8Ht3gaWrFClqFEFBxIolsWFHxc8aNUZjiy3G5NXEFDXGEpXXmNhbEmM3mthfNdZYYo8aCzZE7I0iUgQW2N3z/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Pbbb9GjRw/cvn1bX5/79+9Hz5494e/vj9DQUDx79gyDBw9GxYoVjcoryD4KDw9H3759MWLECAwbNgy+vr64evUqOnfujNq1a2PatGlQKpW4deuWwU3Ogl5r1q9fj/T0dHz00UeIi4vDt99+i969e6N169Y4cuQIvvjiC9y6dQsLFy7EuHHjsGLFCoPlIyIi0KdPH4wcORIDBw7EypUr0atXL+zduzdf14bC1Pnu3bvRp08f1KpVC6GhoXj+/Dnef//9wv2iJQpg5cqVAoA4ePCgiImJEQ8ePBAbN24Uzs7OwsbGRjx8+FAIIYRKpRIajcZg2Tt37gilUimmTZumn7ZixQoBQMyZM8doXVqtVr8cADF79myjeWrWrCmCgoL07w8fPiwAiAoVKojExET99N9++00AEPPnz9eXXa1aNREcHKxfjxBCpKSkCC8vL9GuXTujdTVp0kQEBATo38fExAgAYvLkyfppd+/eFQqFQsyYMcNg2bCwMGFhYWE0PSIiQgAQq1e
"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=['hazardous']), df_train['hazardous'])\n",
"\n",
"# Создание нового DataFrame\n",
"df_train_undersampled = pd.DataFrame(X_resampled)\n",
"df_train_undersampled['hazardous'] = y_resampled # Добавление целевой переменной\n",
"\n",
"# Вывод информации о новой выборке\n",
"print(\"Обучающая выборка после undersampling: \", df_train_undersampled.shape)\n",
"print(df_train_undersampled['hazardous'].value_counts())\n",
"\n",
"# Визуализация распределения классов\n",
"hazardous_counts = df_train_undersampled['hazardous'].value_counts()\n",
"plt.figure(figsize=(2, 2))\n",
"plt.pie(hazardous_counts, labels=hazardous_counts.index, autopct='%1.1f%%', startangle=90)\n",
"plt.title('Распределение классов hazardous в тренировочной выборке после Undersampling')\n",
"plt.show()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# 2 Датасет: Pima Indians Diabetes Database\n",
"#### https://www.kaggle.com/datasets/uciml/pima-indians-diabetes-database\n",
"\n",
"This dataset is originally from the National Institute of Diabetes and Digestive and Kidney Diseases. The objective of the dataset is to diagnostically predict whether or not a patient has diabetes, based on certain diagnostic measurements included in the dataset. Several constraints were placed on the selection of these instances from a larger database. In particular, all patients here are females at least 21 years old of Pima Indian heritage.\n",
"\n",
"Этот набор данных изначально был получен из Национального института диабета, заболеваний пищеварительной системы и почек. Целью набора данных является диагностическое прогнозирование наличия или отсутствия у пациента диабета на основе определенных диагностических измерений, включенных в набор данных. На выбор этих случаев из более крупной базы данных налагалось несколько ограничений. В частности, все пациенты здесь — женщины в возрасте не менее 21 года индейского происхождения пима.\n",
"\n",
"- объект иследования - женьщины индейци пима\n",
"- очевидно цель датасета это предсказание диабета.\n",
"- атрибуты: Pregnancies, Glucose, BloodPressure, SkinThickness, Insulin, BMI, DiabetesPedigreeFunction, Age, Outcome"
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"количество колонок: 9\n",
"колонки: Pregnancies, Glucose, BloodPressure, SkinThickness, Insulin, BMI, DiabetesPedigreeFunction, Age, Outcome\n"
]
}
],
"source": [
"df = pd.read_csv(\"..//static//csv//diabetes.csv\", sep=\",\")\n",
"print('количество колонок: ' + str(df.columns.size)) \n",
"print('колонки: ' + ', '.join(df.columns))"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Получение сведений о пропущенных данных\n",
"\n",
"Типы пропущенных данных:\n",
"- None - представление пустых данных в Python\n",
"- NaN - представление пустых данных в Pandas\n",
"- '' - пустая строка"
]
},
{
"cell_type": "code",
"execution_count": 13,
"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"
]
}
],
"source": [
"# Количество пустых значений признаков\n",
"print(df.isnull().sum())\n",
"\n",
"print()\n",
"\n",
"# Есть ли пустые значения признаков\n",
"print(df.isnull().any())\n",
"\n",
"print()\n",
"\n",
"# Процент пустых значений признаков\n",
"for i in df.columns:\n",
" null_rate = df[i].isnull().sum() / len(df) * 100\n",
" if null_rate > 0:\n",
" print(f\"{i} процент пустых значений: %{null_rate:.2f}\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Итог: пропущеных значений нет"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"посмотрим выбросы и усредним их:"
]
},
{
"cell_type": "code",
"execution_count": 14,
"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": [
"построим графики в надежде найти какие то зависимости опасности от других колонок"
]
},
{
"cell_type": "code",
"execution_count": 15,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAaYAAAK9CAYAAABviMjGAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAABfx0lEQVR4nO3de3zL1/8H8FfSpmlLW5dWKaWl7pcanX7dpgxFd+G7jalRl587Y8zGzDAzt/E1c90FszGMMZu6329zHWbupu5F0UZF07Q5vz/aZNIkvUQqR/t6Ph4eW87nfPJ559LzyufkJFEIIQSIiIgkoXR2AURERE9iMBERkVQYTEREJBUGExERSYXBREREUmEwERGRVBhMREQkFQYTERFJhcFERFSICCFw//59XLhwwdml2MRgInoKO3fuhEKhwM6dO51dCklgwIABaNWqlbPLsPDw4UN8/PHHqFq1Ktzc3FCyZElUqVIF586dy7djjhw5EuHh4Xbta1cwzZ8/H5GRkfD394dKpULp0qXRrFkzLFmyBAaDwa5CyPm6d+8OhUJh+uft7Y3Q0FBMnz4dOp3O2eWRE1y9ehX9+vVDUFAQ1Go1SpUqhfbt22Pfvn1Pdb1z587F4sWLHVOkJC5fvoxvv/0WH330kbNLMXPv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D29kbRokXx8ssv448//jBtNz5fs/uX3VTaggULEB8fj2nTpqFSpUpm2zw8PPD9999DoVDg008/NbUbn6dZGWt58vnz999/Y9euXaZanvzbTUxMxHvvvWe6X8qVK4du3bohISHB1OfOnTvo1asX/P394e7ujtDQUHz//fdmxzX+fX/xxReYM2cOKlasCE9PT7Ru3RrXrl2DEAITJkxAuXLl4OHhgddffx3379+3qH/Dhg1o2rQpihQpAi8vL0RFReHvv/8267N3714kJCSgZcuWVu9PW3/DWcesiIgIi7bDhw+b+j9p0aJFaNGiBUqVKgW1Wo0aNWpg3rx5Fvsaz+rDwsLg7u6OkiVLonPnzrh69apFnWfPnsWbb76JEiVKwN3dHWFhYWZTcXl9Xhnvj19//dXq/WKLa556Z5GYmIi0tDQ8fPgQR48exRdffIG3334b5cuXN7shRYsWxbBhw1C0aFFs374dn3zyCTQaDaZNm2Z2fdWqVcPo0aMhhMClS5cwY8YMtGvXzuod+GQNkyZNsmhPT0/HK6+8gm3btuHtt9/GkCFD8PDhQ2zZsgWnTp2y+GMzunjxIr755hubx3NxccGPP/6I9957z9S2aNEiuLu7IyUlxazv4sWL0aNHD7z44ouYNGkSbt++jS+//BL79u3Dn3/+iWLFigEATp48iaZNm0KlUqFPnz4ICgrCpUuX8Ntvv2HixIn473//i5CQENP1vvfee6hevTr69OljaqtevbrNmp+WMchLlixpajt37hw6d+6Mvn37onfv3qhatSq0Wi2aNWuGGzduoG/fvihfvjz279+PUaNG4datW5g5cyaAjOmvV199FYcOHUL//v1RrVo1/Prrr4iJibF6/PT0dERGRiI8PBxffPEFtm7diunTp6NSpUro37+/qd+XX36J1157DV26dEFqaiqWL1+Ot956C7///juioqLMrnPv3r345ZdfMGDAAHh5eWHWrFl44403cPXqVdPtvHnzJho0aIDExET06dMH1apVw40bN7Bq1SpotVq4ublZrXf79u1o27Yt6tevj7Fjx0KpVJoGkT179qBBgwYAgH79+mHVqlUYNGgQatSogXv37mHv3r04c+YM6tWrZ/Px+Pvvv9G0aVN4e3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aGh2fZ59913BQBx8uRJIYQQY8eOFdaGFOPfzpNT/Lam8j755BM
"text/plain": [
"<Figure size 400x800 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAZ0AAAK9CAYAAAD/m7EJAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAACcMElEQVR4nOzdd5hU5dn48e8507c3tlKWJqBgAwtgQUUQe4sS/Sn2JHZNNKJRoyYvsSTh1RhLiiXqm8QYSTRGQUVRQVQsBKUHBBe2s2Vmp57z/P6YnYGd3WVnhmVnBu/PdXHNzpl7Zp+dXc49zzn3uR9NKaUQQgghBoCe6gEIIYT49pCkI4QQYsBI0hFCCDFgJOkIIYQYMJJ0hBBCDBhJOkIIIQaMJB0hhBADRpKOEEKIASNJRwghxICRpCOEEPuQ9vZ2Nm/ejMfjSfVQeiRJR2SEadOmMW3atFQPQ3yL/fWvf6WoqAi3253qoXShlOLJJ5/kyCOPJCsri7y8PIYPH85zzz23177n66+/Tk5ODg0NDQk/N62TzuOPP87MmTMpKyvDZrNRXl7Osccey7PPPotpmqkenthD7733Hueddx5VVVXY7Xby8/M54ogjuPfee6mrq0v18PZ5Ho+H++67jwMPPJCsrCzy8/M5+uijefbZZ9mTloyvvfYaP/3pT/tvoGnAMAzuvvturrvuOnJyclI9nC4uuOACvv/97zNu3Dj+9Kc/sWjRIt58803OPvvsvfY9TzrpJEaNGsW8efMSfq6Wzg0/J0+eTEVFBccffzx5eXm0tLTw4Ycf8uc//5nzzz+f//u//0v1EEWS7rrrLu677z5GjBjB7NmzGTFiBD6fjxUrVvDSSy9RUlLCxo0bo/GRWc4777yTmgHvY+rq6jjhhBNYvXo1s2fP5thjj8Xn8/HSSy+xZMkSzj//fJ5//nksFkvCr33ttdfy6KOP7lHiSjcLFizg7LPPZuvWrVRVVaV6OFHPPvssl1xyCc899xwXXHDBgH7vxx57jB/96EfU1taSm5sb/xNVGgsEAj1uv/baaxWgNm3aNLADEv3iz3/+swLUeeedp/x+f7fHW1pa1N13391l27HHHquOPfbYgRngt8DMmTOVruvqH//4R7fHfvSjHylA/eIXv0jqta+55hqV5ruWhJ1++unqqKOOSvUwuhk/fry64IILUvK96+rqlMViUX/4wx8Sel5G/mU89NBDClBff/11dNuCBQvUySefrCoqKpTdblcjRoxQ9957rwqFQl2ee+yxxyog+q+4uFidfPLJ6j//+U+XOKDbju+BBx5QQLedn9frVXfffbcaPXq0cjgcqry8XJ111llqw4YNSimlNm3apAD11FNPdXne1VdfrQA1Z86c6LannnpKAcpms6n6+vou8UuXLo2O++OPP+7y2F//+ld16KGHKqfTqYqLi9WFF16ovvnmm27v3erVq9V3vvMdVVJSopxOp9pvv/3U7bffrpRS6u677+7y3vT0b/HixdH38YADDuj2+vHYb7/9VElJiWpvb4/7ObFJJ/I+xX7wWLx4cZdxRnz44Ydq1qxZqqCgQGVlZakJEyao+fPnd4l566231FFHHaWysrJUfn6+Ov3009VXX33VJaatrU3dcMMNatiwYcput6tBgwap6dOnqxUrVnT7fjNnzlR5eXnK5XKpY445Rr3//vtx/ax1dXXqsssuU6WlpcrhcKgDDzxQPf3009HHI39Pu/u3699UrGXLlilAXXbZZT0+HgwG1ejRo1VhYaHq6OhQSvX+vsb+bc+ZM6fH8UQYhqHmz5+vxo8frxwOhyopKVEzZ87s8vccDAbVvffeq0aMGKHsdrsaNmyYmjt3rvL5fF2+97Bhw9Qpp5yiFi9erCZOnKicTqcaP358dIwvvfRS9Psceuih6tNPP+32s65evVqdc845qrCwUDkcDjVx4sRuidjr9Sq73a5++tOf9vh+Rd6b3f3cSu38/7Wr9vZ2VVZW1u29XbJkiTr33HPVkCFDlN1uV4MHD1Y33nhj9PehlFJut1sB6sc//rE6+eSTVW5ursrKylLHHnusWrJkSbdx7tixQ91www1q8ODBym63q5EjR6pf/OIXyjAMpVRyf1eHHHKIOv3003t8X3pjjX9OlDotLS2EQiHa29tZsWIFDz30ELNnz2bo0KHRmKeffpqcnBxuvvlmcnJyePvtt7nrrrtoa2vjwQcf7PJ6Y8eO5Y477kApxcaNG/nVr37FySefzJYtW3Y7hp6OXxqGwamnnspbb73F7NmzueGGG2hvb2fRokWsWrWKkSNH9vh6GzZs4He/+12v389isfDcc89x0003Rbc99dRTOJ1OfD5fl9inn36aSy+9lMMOO4x58+ZRV1fH//7v//LBBx/w2WefUVBQAMDKlSs5+uijsdlsXHXVVVRXV7Nx40ZeeeUVfv7zn3P22WczatSo6OvedNNNjBs3jquuuiq6bdy4cb2OOR7r1q1j3bp1XHHFFQN2bHzRokWceuqpVFRUcMMNN1BeXs7q1at59dVXueGGGwB48803mTVrFiNGjOCnP/0pXq+XRx55hKlTp/Lpp59SXV0NwPe//33+9re/ce2117L//vvT1NTE+++/z+rVqzn00EMBePvtt5k1axYTJ07k7rvvRtd1nnrqKY4//njee+89Dj/88F7H6vV6mTZtGhs2bODaa69l+PDhvPjii1xyySW0tLRwww03MGjQIP70pz9Fn/P3v/+dl19+ucu23v7uAF555RUALr744h4ft1qtXHDBBdxzzz188MEHTJ8+Pb43Gvje977Htm3bWLRoUZfxRFx++eU8/fTTzJo1iyuuuIJQKMR7773Hhx9+yKRJkwC44ooreOaZZzj33HP54Q9/yPLly5k3bx6rV6/m5Zdf7vJ6GzZs4IILLuB73/se/+///T8eeughTjvtNB5//HFuv/12rr76agDmzZvHeeedx9q1a9H18KnsL7/8kqlTp1JVVcVtt91GdnY2f/3rXznzzDN56aWXOOusswBYsWIFgUAg+vvtzfXXX89hhx0GhA97LVq0qM/365e//GWP5y9ffPFFOjo6+MEPfkBxcTEfffQRjzzyCN988w0vvvgiAE1NTQDcf//9lJeXc8stt+B0Ovnd737H9OnTWbRoEccccwwAHR0dHHvssdTU1PC9732PoUOHsnTpUubOncv27duZP39+Un9XEydOZMGCBX3+nF0klKJSZMyYMV2y7cUXX6yCwWCXmF0/AUR873vfU1lZWV0+IfV0mOb2229XQJeZBTEznVtvvVWVlpaqiRMndnn+H//4RwWoX/3qV92+v2maSqmeZzrnnXeeGj9+vBoyZEiPM53vfve7asKECdHtHo9H5eXlqQsuuKDLTCcQCKjS0lI1fvx45fV6o/GvvvqqAtRdd90V3XbMMceo3NzcLjPEXccZa9iwYb1+Yk52pvOPf/xDAd1mGaZpqoaGhi7/dv0dJzvTCYVCavjw4WrYsGFqx44d3b5nxMEHH6xKS0tVU1NTdNsXX3yhdF1XF198cXRbfn6+uuaaa3r9+UzTVKNHj1YzZ87s8vodHR1q+PDh6sQTT+z1uUopNX/+fAWo5557LrotEAioyZMnq5ycHNXW1tbtOT19gt6dM888UwHd3o9d/f3vf1eAevjhh5VS8c90lOr98Nrbb7+tAHX99dd3eyzyXn3++ecKUFdccUWXxyOH/N5+++3otmHDhilALV26NLrtjTfeUIByuVxd/s6feOKJbuM/4YQT1IQJE7rsH0zTVFOmTFGjR4+Obvv973+vgG5HQyIWLlyoAPW3v/1tt+9B7O+pvr5e5ebmqlmzZnUbW0/7s3nz5ilN06I/V+S9t9vtat26ddG4hoYGVVxcrCZOnBjddt9996ns7OwucUopddtttymLxaK2bNnS7fvF83f1P//zPwpQdXV1u43bVVpXr0U89dRTLFq0iOeff57LL7+c559/vsunbwCXyxX9ur29ncbGRo4++mg6OjpYs2ZNl9hgMEhjYyMNDQ0sW7aMl19+mQMPPJCSkpIev39NTQ2PPPIId955Z7d
"text/plain": [
"<Figure size 400x800 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAbcAAAK9CAYAAACn5CIQAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAACJGUlEQVR4nO3dd3hTZf8G8Ds76Up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GI+6//35s3boVw4YNwyuvvIK8vDxs3rwZJ06cQNOmTSt8vcTERHz99ddWv59EIsF3332HV1991bxt+fLlUCqV0Gq1Fm1XrFiB0aNH4+6778a8efOQkZGB//u//8OePXvw77//wt/fHwBw7Ngx3HPPPZDJZBg3bhyioqKQlJSE//3vf5g7dy4eeeQRNGvWzPy6r776Klq1aoVx48aZt7Vq1cpqzfa6fv06gJL38MKFC3jjjTdQr1493H///ZU+z9afd8uWLRg4cCCaNGmCWbNmoaioCP/973/Rs2dPHD582PyLefz4ccTGxiIoKAizZs2CwWDAO++8g5CQEJt+Dr1ej0uXLqFevXoW25cvXw6tVotx48ZBoVAgMDAQJ0+eRM+ePREREYFp06bB29sbv/zyCx566CGsWbMGDz/8MICSPzTmzZuHZ599Fl27doVGo8HBgwdx+PBhDBgwAAAwdOhQnDx5EhMnTkRUVBQyMzOxefNmpKamljvo2Gr8+PEICgrC22+/jYKCAgDAqlWrMHLkSMTFxWHBggUoLCzEl19+iV69euHff/+t9HtlZGSgR48eKCwsxMsvv4x69eph5cqVePDBB/Hrr7/i4YcfRqtWrbBq1Srzc5YsWYLTp0/jk08+MW9r37691e/xv//9DwAwYsSICver1WoMGTIEK1euRGJiosVnvCozZsxAbm4uLl++bK7Hx8cHgG2/+4Ig4MEHH8S2bdswduxYdOzYEZs2bcJrr72GK1euWPyMALBr1y78+eefmDBhAgBg3rx5uP/++/H666/jiy++wPjx45GdnY2FCxdizJgx+Pvvv83P/fvvvzFw4EB07twZ77zzDsRiMZYvX4777rsPu3btQteuXQEAe/fuBQB06tSp0p/93XffRePGjQEAH330EbKzs6t8v95+++1yxyfAtuPzjRs3AADTp09H8+bNMXv2bGi1WixatAg9e/bEgQMH0KJFCwAln6vu3bub/yAICgrChg0bMHbsWGg0GkyaNMmhz1WnTp3K/TFQpep0F1u2bCkAMH+NGDFC0Ov1Fm0KCwvLPe/5558XvLy8BK1Wa97Wp08foU+fPhbt3nzzTQGAkJmZad4GQHjnnXfMj19//XUhODhY6Ny5s8Xzly1bJgAQPv7443Lf32QyCYIgCMnJyQIAYfny5eZ9jz/+uNC2bVshMjJSGDlypHn78uXLBQDCk08+KbRr1868vaCgQPDz8xOGDx8uABAOHDggCELJkExwcLDQtm1boaioyNy+dIjv7bffNm/r3bu34OvrK1y8eLHCOstq1KiRRW2369Onj9CmTZsK91Vl5MiRFv+epV8RERHCoUOHLNqWHZa05+ft2LGjEBwcLNy4ccO87ejRo4JYLBZGjBhh3vbQQw8JSqXS4n05deqUIJFIKhyWjI2NFa5duyZcu3ZNOHr0qDBs2DABgDBx4kRBEG79e/v5+Vl8pgRBEPr16ye0a9fO4jNpMpmEHj16CM2bNzdv69ChQ7nhz9tlZ2cLAIQPPvjAahtBKP85vv3nqOhz16tXL8FgMJi35+XlCf7+/sJzzz1n8fz09HRBrVaX217WpEmTBADCrl27LF6zcePGQlRUlGA0Gss9Z+TIkXYNA3bs2FFQq9WVtvn4448FAMKff/4pCMKtn7fsqY2KhsGtDUva8ru
"text/plain": [
"<Figure size 400x800 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAbUAAAK9CAYAAACjEfItAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAACD2klEQVR4nO3dd3xTVeMG8OdmpyvdCwqtrLIUAcEylVWRV0FBFFEQURyIIi5QEXH8UHG9KOKLIuBAFFQUBSkgKEtkiGyklbLb0pk2bTPv74/QSNomvS1pk6bP9/PJh+bek3tP03Ce3HPPPVcQRVEEERGRH5B5uwJERESewlAjIiK/wVAjIiK/wVAjIiK/wVAjIiK/wVAjIiK/wVAjIiK/wVAjIiK/wVAjIiK/wVAjIiJJbDYbcnNz8c8//3i7Ki4x1EiyzZs3QxAErFy50m25JUuWQBAEZGZm1ltdMjMzIQgC3nz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+LWW29F69atHdt9/PHH0b59e0yaNMmxrH379i7rLEV0dDS0Wi1Wr16NKVOmIDw8XPJry8rKMHz4cOzevRsbNmzANddc47Z8eno6Ro0ahYkTJ2L8+PH45JNPcM8996Bbt27o2LFjneq/bNkyFBcX44EHHoAgCHjjjTdw66234p9//nH5JQwAZs+ejRdffBG9evXCSy+9BJVKhZ07d+KXX37BkCFDqn3NwoUL8eCDD+LZZ5/FK6+8Uut6HDp0CL1790azZs0wffp0BAYG4uuvv8aIESPwzTffOLrjXnzxRcyZMwf33XcfevToAb1ej927d2Pv3r0YPHgwAGDkyJE4dOgQpkyZgsTEROTk5GD9+vU4depUteFQYcOGDRg6dCiuuOIKvPjiiygrK8N7772H3r17Y+/evUhMTLzsz93q1auRmJiIvn37Vru+X79+SExMrBIkUnz22WeO96WiPhX/p8+dO4cePXqgsLAQkyZNQnJyMs6ePYuVK1eitLQUKpUK2dnZ6NWrF0pLS/Hoo48iIiICS5cuxc0334yVK1dW6RKdM2cOtFotpk+fjvT0dLz33ntQKpWQyWQoKCjAiy++iN9//x1LlixBUlISXnjhBcdrX331VcycOROjR4/GfffdhwsXLuC9995Dv379nNqB7du3IyIiAi1btnT5e6vVanz88ceO5/fdd1+N75XFYnF8Qa7sv//9L26++WaMHTsWJpMJy5cvx2233YYff/wRw4YNAwDk5eWhvLwcDz30EAYMGIAHH3wQGRkZmD9/Pnbu3ImdO3dCrVYDsH9RGjp0KLp164ZZs2ZBJpNh8eLFGDBgALZs2YIePXrU+nPVoUMHaLVabNu2rXZd1XU5LGzXrp0IwPEYN26caDabncqUlpZWed0DDzwgBgQEiOXl5Y5l/fv3F/v37+9U7tlnnxUBOHVdABBnzZrleP7000+L0dHRYrdu3Zxe/8knn4gAxLfffrvK/m02myiK/3ZdLV682LFu9OjRYqdOncSEhASnro3FixeLAMQxY8aInTt3diw3GAxiSEiIeOedd4oAxF27domiaO+ijY6OFjt16iSWlZU5yv/4448iAPGFF15wLOvXr58YHBwsnjx5stp6VtayZUuX3S79+/cXO3bsWO26mrzwwgsiADEwMFAcOnSo+Oqrr4p79uypUu7S7sfi4mKxf//+YmRkpPjnn386lat4zy7tNmzZsqUIQPztt98cy3JyckS1Wi0+8cQT1dZLSvdjRESEmJ+f71j+/fffiwDE1atXO5bNmjVLvPSjfvz4cVEmk4m33HKLaLVanbZ76Xt/affjf//7X1EQBPHll1+ucz0GDhwodu7c2enzb7PZxF69eolt2rRxLLvqqqv
"text/plain": [
"<Figure size 400x800 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAZcAAAK9CAYAAADouSHAAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAACZhklEQVR4nOzdeZxcVZnw8d9dauuqrt53knQ2spDESNjCviZsLiwq6EBYlFcMOoAvKoMLAWfiqCOKCoyjgAo486IjjAyBsCMQlhAREkhIQjoJ6X3vqq7t1j3vH9VVpLekq+lQtzrP9/PpT7punao6XVW5zz3Lc46mlFIIIYQQE0jPdQWEEEJMPhJchBBCTDgJLkIIISacBBchhBATToKLEEKICSfBRQghxIST4CKEEGLCSXARQggx4SS4CCGEmHASXIQQIg+Fw2F2795NV1dXrqsyIgkuQoxA0zRuvvnmzO17770XTdNoaGjIWZ3ER+PVV1/F7Xazc+fOXFdlmAcffJDTTjuNwsJCAoEAU6dO5Yc//OEBe723334b0zTZuHFj1o/Ny+By1113sXz5cqqqqnC5XFRXV3PSSSfxu9/9Dtu2c109MU6XXXYZgUAg19WYdBKJBLfffjtHHnlk5qR05JFHcvvtt5NIJMb9vC+99BI333wz3d3dE1dZB7jpppu4+OKLmTZtWq6rMsi3vvUtPvvZz1JYWMh//Md/8MQTT/Dkk0/yla985YC95vz58znnnHP47ne/m/2DVR465phj1Hnnnad+/vOfq9/+9rfqZz/7mb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8I1vfINYLJYpk833yuVycfLJJ/Pwww8Pe619MbMq7TDd3d1YlkVfXx+vv/46P/7xj7nooouYOnVqpsy9995LIBDg+uuvJxAI8PTTT/Pd736X3t5efvSjHw16vrlz53LTTTehlGL79u385Cc/4eyzz2bXrl37rMPq1auHHU8mk5x77rk89dRTXHTRRfzjP/4jfX19PPHEE2zcuJGZM2eO+Hzbtm3jP/7jP0Z9PcMwuO+++7juuusyx+655x68Xi/RaHRQ2XvvvZfLL7+cI488ktWrV9PS0sLPfvYzXnzxRf72t79RXFwMpL7gJ5xwAi6Xi6uuuor6+nq2b9/OX/7yF/75n/+Z888/n1mzZmWe97rrrmPevHlcddVVmWPz5s0btc4f1rZt27jwwgu58sorWbFiBXfffTeXXXYZS5Ys4bDDDgNSJ7vVq1fzxS9+kaOOOore3l7Wr1/Phg0bOOOMM3Jat5EopfjkJz/JM888w5VXXsnixYt5/PHHueGGG9izZw+33XYbAL///e8zj/nrX//Kr371K2677TbKy8sBqKqqGvU11qxZQzKZ5NJLLx21zKWXXsozzzzDY489xhe/+MUx/93nn38+7777Ln/4wx8G1aeiogKAVatWcfPNN3Psscdyyy234Ha7eeWVV3j66adZtmwZkPrMVq1axemnn87VV1/Nli1buPPOO3nttdd48cUXB11EdnV1ce6553LRRRfxmc98hjvvvJOLLrqI+++/n2uvvZYvf/nLfP7zn+dHP/oRF154Ibt376awsBCAlpYWjjnmGDRN45prrqGiooI1a9Zw5ZVX0tvby7XXXgukAtCuXbs4/PDD9/m3X3zxxZx99tkAPProo/zhD3/Y7/v1+9//nrfeemvY8SeeeIL33nuPyy+/nOrqajZt2sSvfvUrNm3axMsvv5wJch0dHfzqV78iEAjwta99jYqKCu677z7OP/987r//fi6++GIgFcQ++clP8sILL3DVVVcxb9483nrrLW677TbefffdTDDK9nu1ZMkSHn74YXp7ewkGg/v9e4H8HHNJmzNnjgIyP5deeqlKJBKDyvT39w973P/5P/9HFRQUqGg0mjl20kknqZNOOmlQuX/6p39SgGptbc0cY0h3yTe+8Q1VWVmplixZMujxd999twLUT37yk2Gvn25y79ixQwHqnnvuydz32c9+Vi1YsEBNmTJFrVixInP8nnvuUYC6+OKL1cKFCzPHw+GwCgaD6vOf/7wC1GuvvaaUSjVlKysr1YIFC1QkEsmUf+SRRxSgvvvd72aOnXjiiaqwsFDt3LlzxHoONW3atEF129tJJ52kDjvssBHv25+RusWmTZumAPX8889njrW2tiqPx6O+/vWvZ4597GMfU+ecc84+n3+kzzj9utOmTRt0bOjnnH7/9+4CGmvdRvLQQw8pQH3/+98fdPzCCy9UmqaN2L89Uh325dprr1WA+tvf/jZqmQ0bNihAXX/99Uqpkb+TaUPfk9G6xbZu3ap0XVfnnXeeSiaTg+5Lf6daW1uV2+1Wy5YtG1Qm3VV39913Z46lx4weeOCBzLHNmzcrQOm6rl5++eXM8ccff3xY/a+88kpVU1Oj2tvbB9XloosuUkVFRZlzxJNPPqkA9Ze//GXE9+rdd99VgPrxj3+8z/dg6OcUjUbV1KlT1VlnnTWsbiOdn/7whz8M+16lz3HPPvvsoMfOmzdPVVdXZ4YKfv/73ytd19Vf//rXQc951113KUC9+OKLw15vLN+rBx54QAHqlVdeGbXMUHnZLZZ2zz338MQTT3D//fdz5ZVXcv/99w+6mgbw+XyZ3/v6+mhvb+eEE06gv7+fzZs3DyqbSCRob2+nra2NdevW8ec//5lFixZlovlQe/bs4ec//znf+c53hs1y+tOf/kR5eTlf/epXhz1upCY3wOuvv86DDz7I6tWrB3Xt7e2SSy5h8+bNme6vP/3pTxQVFXHaaacNKrd+/XpaW1v5yle+gtfrzRw/55xzmDt3Lv/7v/8LQFtbG88//zxXXHHFoBbfvuq5P8lkkvb2dtrb24nH4+N6jr3Nnz+fE044IXO7oqKCOXPm8N5772WOFRcXs2nTJrZu3fqhX2+i6zaSRx99FMMw+NrXvjbo+Ne//nWUUqxZs+ZD162vrw8gcwU/kvR9vb29H/r10h5
"text/plain": [
"<Figure size 400x800 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
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1113Hfx+P5YuXYoNGzZ0+ou8bds2PP30052+nslkwvPPP48bbrgheW3hwoWw2+3t+gife+45XH755Tj22GOxYMEC1NbW4qGHHsKHH36Izz77DPn5+QCAdevW4eSTT4bFYsGVV16JqqoqbN++Hf/+979x77334oILLsCwYcOSz3vDDTdg9OjRuPLKK5PXRo8e3WmZD1R9fT2AxHv41Vdf4ZZbbkFRUVGH/fpOpxPnnXce/vrXv+Lqq68GAHz++ef44osv8Mc//hHr1q3rcTnuvPNOzJ8/H9OnT8fVV1+NLVu24PHHH8eqVavw4YcfwmKx4LbbbsOPf/zjZLlvuOEGXHnllTj55JO7ff6tW7diy5YtuOyyy+D1ejuMufTSSzFv3jy89tprB9QnPnr0aNx111244447Uspz4oknAgCWLl2Kc845B+Xl5bjuuutQVlaGTZs24bXXXsN1110HAHj77bcxa9YsDBkyBHfeeSfC4TD+8Ic/YMqUKVizZk3yg1er733vexg9ejTuu+8+vP7667jnnntQWFiIJ598Eqeddhruv/9+vPDCC7j55ptx7LHH4pRTTgEAaJqGb3/721i+fDmuvPJKjB49GuvXr8cDDzyAL7/8Eq+++mryNT766CNMnDixy+/96KOPxk033QQA2LFjB+64445u36/O/u6++uorvPrqq/jud7+LwYMHo7a2Fk8++SSmTp2KjRs3JmcDNTQ0YPny5Vi+fDl+9KMfYdKkSXjnnXdw6623YufOnXjiiSeSz3nvvffi9ttvx4UXXogf//jH2L9/P/7whz/glFNOSf5dHujv1aRJkyCEwEcffWR8/OtQNE1yYeTIkQJA8uvSSy9t14QOhULtHvfTn/5UOJ1OEYlEktemTp0qpk6dmhL3P//zPwKAqKurS14DIObNm5e8/ctf/lKUlJSISZMmpTz+2WefFQDE73//+3avr2maEOKbfuy2TfcLL7xQjBs3TlRWVoo5c+Ykry9cuFAAEBdddJEYP3588nowGBRer1dcfPHFAoBYtWqVECLRfVZSUiLGjRsnwuFwMr61m+WOO+5IXjvllFOEx+MRX3/9dYflTDdo0KCUsrU1derUdl0xRs2ZMyfl59n61b9/f7F69eqU2NauocWLF4vXXntNSJIkdu3aJYQQ4he/+IUYMmRIp+Ux0jVUV1cnrFarOOOMM4SqqsnrjzzyiAAgnn322XaP6ejn2ZVXX31VABAPPPBAl3Fer1dMnDgxpfwdvf/pv8OddQ0piiIGDx4sBg0aJJqamlLua/szP/roo0VJSYloaGhIXvv888+FLMvi0ksvTV6bN2+eACCuvPLKlNcYMGCAkCRJ3HfffcnrTU1NwuFwpJT/L3/5i5BlWfz3v/9NKcsTTzwhAIgPP/xQCCFEPB4XkiSJm266qf2bpKuoqBDnnHNOl+/BgfzdRSKRlJ9/6+NtNpu46667ktemTp0qAIg777wzJfayyy4TAMT69euFEELs3LlTmEwmce+996bErV+/XpjN5nbXOytvur179woA4v777+80Jt0R3zXUauHChVi6dCleeOEFXHHFFXjhhRdSPqUCgMPhSP6/3+9HfX09Tj75ZIRCIWzevDklNh6Po76+Hvv378eKFSvwyiuvYMKECSguLu7w9ffs2YM//OEPuP322+F2u1Pu+8c//oHi4mJce+217R7XWXfB6tWrsXjxYixYsCCle6utH/7wh9i8eXOyC+gf//gH8vLycPrpp6fEffrpp6irq8PPfvYz2O325PWzzz4bo0aNwuuvvw4A2L9/Pz744AP86Ec/SmlJdVXO7qiqivr6etTX1yMWix3QY+12e3K2xZIlS/Dkk0/C7Xb
"text/plain": [
"<Figure size 400x800 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAhgAAAK9CAYAAABmVRVNAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAACzNElEQVR4nOzdd5wU9f348dfMbN+93jhO4GiigkZERUTFTrDElq8Ffyr2RE2imFhij9+IXRJjYtSo0US/JsbEGAsgaow9NgwqSAfh4HrZvjvz+f2xt+t1jmO5DTfv5+NxcDv72d337e7MvOdTNaWUQgghhBAii/RcByCEEEKIoUcSDCGEEEJknSQYQgghhMg6STCEEEIIkXWSYAghhBAi6yTBEEIIIUTWSYIhhBBCiKyTBEMIIYQQWScJhhBCCLGTSSaT1NbWsn79+lyH0itJMMSAHHrooRx66KHb/Li1a9eiaRp333139oMaAtLvz+OPP57ZdvPNN6NpWu6CGsJ6er+FvVmWxaRJk/j5z3+e61C6WbFiBRdeeCGVlZW4XC4qKiqYNm0aO3JC7gMOOICrrrpqQI/dpgTjwQcfZObMmVRUVOB0Ohk2bBgzZszgiSeewLKsAQUgcm/OnDlompb5CQQCjBkzhu9+97v85S9/+a//bL/44gtuvvlm1q5du0Nf59BDD+30PhUXF7Pffvvx6KOP/te/R4Ph8ccf7/T+dPy55pprchrbU089xfz583MaQy69/fbbnHTSSVRUVOB2u6murubiiy/erqvfcDjMzTffzBtvvJG9QP8LPP3002zYsIHLLrss16F08t5777H//vvz2muvcc0117BgwQIWLVrE3/72tx16AXL11VfzwAMPsHnz5m1+rGNbCv/+97+nsrKSG264gfz8fJqbm3nvvfeYM2cOL7/8Mk8//fQ2ByD+O7jdbh555BEAIpEI69at44UXXuC73/0uhx56KM8//zz5+fmZ8gsXLsxVqN188cUX3HLLLRx66KFUV1fv0NfaZZddmDdvHgB1dXU88cQTnH/++Xz11VfcfvvtO+Q1r7/++pyfoLfFz372M0aPHt1p26RJk3IUTcpTTz3F0qVLufzyyzttHzVqFJFIBKfTmZvABsH999/Pj370I8aMGcMPfvADKisr+fLLL3nkkUd45plneOmllzjwwAO3+XnD4TC33HILwIBqM/9b3XXXXZx++ukUFBTkOpSMeDzOueeey6677srChQsHNbYTTjiB/Px8fv3rX/Ozn/1s2x6stkE8Hu9x+2WXXaYAtWbNmm15OvFf4pxzzlF+v7/H++bNm6cAdeqpp2bltdasWaMAddddd2Xl+ZRS6s9//rMC1Ouvv5615+zJjBkz1MSJEzttC4VCapdddlF+v7/X/WNbpN+fxx57bLufqzfBYHCHPO9jjz2mAPXvf/97h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xeJzm5mbOPvtsioqKKCoq4qqrrurWJ8GyLObPn8/EiRPxeDxUVFRw8cUX09TU1Knc3/72N1wuF4ccckiP72fX81VPfzf0/3zV3+Pme++9x+jRo/nLX/7C2LFjcblcjBw5kquuuopIJNItzq0d87b1e3XUUUexbt06Pv300x7fl95sUxNJWnNzM8lkkra2Nj766CPuvvtuTj/9dEaOHJkp8/jjjxMIBJg7dy6BQIDXXnuNG2+8kdbWVu66665Oz7fbbrtx3XXXoZRi1apV3HvvvRxzzDF9tg82Nzdnqqo7Mk2T4447jsWLF3P66afzox/9iLa2NhYtWsTSpUsZO3Zsj8+3cuVKHn744V5fzzAM/vCHP3DFFVdktj322GN4PB6i0Winso8//jjnnnsu++23H/PmzWPLli384he/4O233+aTTz6hsLAQgM8++4yDDz4Yp9PJRRddRHV1NatWreKFF17g5z//OSeffDLjxo3LPO8VV1zB7rvvzkUXXZTZtvvuu/cac7acddZZLFy4kEWLFrHrrrv2WKa1tZVHHnmEM844gwsvvJC2tjZ+97vfMXPmTD744AP23nvvTuWfeOIJ2trauPTSS4lGo/ziF7/g8MMP5z//+Q8VFRUAfP7550yfPp2qqiquueYa/H4/f/rTnzjxxBP5y1/+wkknncQhhxzCD3/4Q375y1/y05/+NPN+pP9/8sknOeecc5g5cyZ33HEH4XCY3/zmNxx00EF88sknmQPmKaecwueff84PfvADqqurqa2tZdGiRaxfv36rzS6rV6/GMAwKCwsJh8PMmDGDjRs3cvHFFzNy5Ejeeecdrr32WmpqajL9AJRSnHDCCbz11lt873vfY/fdd+evf/0r55xzTr8+kzlz5vCnP/2Js846iwMOOIB//vOfHHvssb2W/5//+R/Gjx/Pbbfdljn4/vznP+eGG27g1FNP5YILLqCuro7777+fQw45pNP39LXXXmPWrFlMmTKFm266CV3Xeeyxxzj88MP517/+xf7779/ptVpaWqivr++0rbS0tF9/V1c/+MEPKCoq4qabbmLt2rXMnz+fyy67jGeeeSZT5vHHH+e8885j4sSJXHvttRQWFvLJJ5/wyiuvMHv2bK677jpaWlr4+uuvue+++wAIBAK9vuarr77KrFmzGDNmDDfffDORSIT777+f6dOn8/HHH3f7Ppx66qmMHj2aefPm8fHHH/PII49QXl7OHXfc0eff1p/jxMUXX8yRRx6ZecxZZ53FSSedxMknn5zZlj7RdxUOh1m8eDEHH3xwtyartNNOO42LLrqIf/zjH9vUDFdWVsZvfvMbvv/973eKZ6+99gK2fmyD1P598MEHk5+fz1VXXYXT6eS3v/0thx56KP/85z+ZOnVqp9f8wQ9+wLBhw7jlllt47733eOihhygsLOSdd95h5MiR3Hbbbbz00kvcddddTJo0ibPPPjvz2Isvvjjzfv/whz9kzZo1/OpXv+KTTz7h7bffzlw8v/P
"text/plain": [
"<Figure size 400x800 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAYMAAAK9CAYAAADG/ABSAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAACC+0lEQVR4nO3deXhTVfoH8G/2dF9pS4FSZF/VgkABQWWpiPuGgwsijqMiKuiMIipuDCiijqOIKJsoiuIPxoWyiEBlVUCEArJJKdCNrmmbZj+/P7LYpGkpJc1N4/fzPDwzufckeZvW8+acc897ZUIIASIi+kuTSx0AERFJj8mAiIiYDIiIiMmAiIjAZEBERGAyICIiMBkQERGYDIiICEwGRER+UV5ejuPHj8NisUgdildMBkTUor3xxhvo1q0bbDab1KG4MZvNeOONN3DppZdCo9EgJiYGnTt3xsaNG5vtPefPn4+UlBQYjcYLfm6LTgbz589HRkYGEhMToVKpkJSUhGHDhuGTTz4JuD8Mapo777wTMpkMzzzzjNSh+E1JSQn++c9/omvXrtBqtYiNjUVGRga+++67i3rd5cuX45133vFNkAFCp9Ph9ddfxzPPPAO5PHC6M6PRiBEjRuCFF17AVVddha+++gobNmzAjz/+iPT09GZ73/vvvx8mkwkffvjhBT9X1pJrE6Wnp6N169a45pprEBkZifLycuzcuRNffPEFxo4di88//1zqEOki6HQ6JCYmIikpCVarFadOnYJMJpM6rGZ15MgRDB8+HOfOncOECRPQr18/lJeX47PPPsO+ffvw9NNPY86cOU167euvvx7Z2dnIycnxbdASeueddzBjxgwUFhZCq9VKHY7LK6+8gn//+99Yu3YtrrrqKr++9zPPPIMVK1bg5MmTF/bfi2jBTCaT1+OPPfaYACBOnjzp34DIpxYtWiRUKpX48ccfBQCxefNmqUNqViaTSfTq1UuEhoaKnTt3up2zWCxi7NixAoD44osvmvT6Y8aMEe3bt/dBpIGjT58+4p577pE6DDdms1nExMSI5557TpL33717twAgNm7ceEHPa9HJoD5vvvmmACBOnTrlOrZ69Wpx3XXXidatWwu1Wi0uueQS8corrwiLxeL23GHDhgkArn9xcXHiuuuuEwcOHHBrB0DMmDHD7dgbb7whAIhhw4a5Ha+pqREzZswQnTt3FhqNRiQlJYlbbrlFHD9+XAghxMmTJwUAsXjxYrfnPfroowKAGD9+vOvY4sWLBQChUqlEUVGRW/vt27e74v7ll1/czn355ZciLS1NaLVaERcXJ+6++25x5syZOp/d4cOHxR133CHi4+OFVqsVXbp0cf1Rz5gxw+2z8fZv06ZNrs+xZ8+edV7/QgwfPlxcd911QgghunfvLv7+9797bffbb7+JoUOHCq1WK9q0aSNeffVVsWjRIq9fCNasWSOGDBkiQkNDRXh4uLjuuutEdnZ2o+I5ceKEuP3220VMTIwICQkRAwYMEN99953r/KZNm877+Xj+zdT2+eefCwDilVde8Xq+vLxcREdHi27durmOOf8ePH9OZyy1fx+esdRODOf7GxVCiKqqKjF16lTRtm1boVarRZcuXcScOXOEzWZze28AYtKkSeLLL78U3bt3F1qtVgwcOFDs379fCCHE/PnzRceOHYVGoxHDhg3z+qVt586dIiMjQ0RGRoqQkBAxdOhQsXXrVrc2f/zxhwAglixZ4vXzcn42Df3cQggxfvz4Osdyc3OFVqut89k2ph/Jzs4WAMSsWbPE0K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IhIUH07dvX7fnOb6hvvfVWnfd3fqPyNjK48847Ra9evUS7du28jgz+9re/id69e7uOV1dXi8jISDFu3Di3kYHJZBIJCQmiV69eoqamxtX+u+++EwDEiy++6Do2dOhQERER4Taiqh2np/bt27vFVtvFjgzefPNNERISInQ6nRBCiKNHjwoAYtWqVW7tJk+eLGQymfj1119dx0pKSkRsbKzbt7rKykoRHR1dZ3RRUFAgoqKi6h11OD355JMCgPjpp59cxyorK0WHDh1EamqqsFqtdZ7j7RtnQy677DIRFRXVYJu33npLABDffPONEKLxIwMh6p8maszf6OrVqwUA8dprr7mdv/3224VMJnMbQQAQGo3GLaYPP/xQABBJSUmu36kQQkybNs0tfpvNJjp37iwyMjLc/u70er3o0KGDGDlypOvY888/LwCIyspKr5/VggULBACxe/fuBj8Dz99Tdna2kMvlYvTo0XU+28b0I87PPj4+XhQXF7vaHT16VKhUKnHbbbe5jk2cOFG0bt3arZ0QQtx1110iKirK6/s15u/qoYceEiEhIQ228RQ4y+8XYfHixdiwYQM+++wzTJw4EZ999pnbt1UACAkJcf3/yspKFBcX48orr4Rer8fvv//u1tZsNqO4uBjnzp3Djh07sGrVKvTp0wfx8fFe3//s2bP473//ixdeeMH1bcvp66+/Rnx8PCZPnlznefUt7uzZswdfffUVZs2aVe8VEvfeey9+//137N692/U+UVFRGD58uFu73bt3o6ioCI8++qjbAtuYMWPQrVs3fP/99wCAc+fOISsrCw888IDbiKqhOM/HarWiuLgYxcXFMJlMF/Tczz77DGPGjEFERAQAoHPnzujbty8+++wzt3Zr165Feno6LrvsMtex2NhY3H333W7tNmzYgPLycvztb39zxVRcXAyFQoEBAwZg06ZNDcazZs0a9O/fH0OGDHEdCw8Px0MPPYScnBwcOnTogn4+byorK10/b32c53U63UW/n1Nj/kbXrFkDhUKBxx9/3O38U089BSEEMjMz3Y4PHz7cbaQ1YMAAAMBtt93m9jM6j//xxx8AgH379uHYsWMYN24cSkpKXL+n6upqDB8+HFlZWa4rBUtKSqBUKuv8N+fk/GZ/oQvL06ZNQ1paGu6444465y6kH5kwYQLi4uJ
"text/plain": [
"<Figure size 400x800 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"# Создание диаграмм зависимости\n",
"for column in numeric_columns:\n",
" plt.figure(figsize=(4, 8)) # Установка размера графика\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",
" plt.show() # Отображение графика"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Создадим выборки данных. разбивать будем относительно параметра Outcome, ведь это тот самый параметр по которому наша выборка разбивается на классы. И собственно его нам и надо будет предсказывать"
]
},
{
"cell_type": "code",
"execution_count": 16,
"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/AkhhBAdQ8mfEEII0TGU/AkhhBAdQ8mfEEII0TGU/AkhhBAdQ8mfEEII0TGU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jGtqhc51lZWczExIR17dqV5efnay0jk8mYra0t8/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",
"0 101\n",
"1 53\n",
"Name: count, dtype: int64\n"
]
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAgsAAADECAYAAAARfmKGAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAAA3n0lEQVR4nO3dd3wT9f8H8FeSjnTSSVug0Fpo2asCMspepcoSUFHZtoiCCMpPUGQooqIIAiKoIDJkCnwFLBsFZEOByiqlZRTogg66k3x+f9TEhqRpWlqu4/V8PHjw6OVzn3vf5e7yzmdcZEIIASIiIqJCyKUOgIiIiMo3JgtERERkEpMFIiIiMonJAhEREZnEZIGIiIhMYrJAREREJjFZICIiIpOYLBAREZFJTBaIiIhKgUajQVJSEm7cuCF1KKWOyQIREZVrR44cwaFDh3R/Hzp0CEePHpUuoALu37+PiRMnok6dOrCysoK7uzsaNmyItLQ0qUMrVcVKFn7++WfIZDLdP6VSCX9/f7z99tuIj48vqxiJqoyjR49iwIAB8PDwgL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Dx50ug+CyFERESEACDeeeedQssIIUTTpk2Fi4uL7u+Cx7agx+Mwdq5qdezYUTg4OIibN2/qLS94XfTv319YWVmJ6Oho3bK7d+8KBwcH0bFjR90y7f3h8euqbdu2QiaTibFjx+qWqVQqUatWLb34i3OuG1PS4//4uqdPnxb29vZi8ODBBudO8+bNRfXq1UVycrJu2fnz54VcLhfDhg3TLdOet4mJiXr
"text/plain": [
"<Figure size 200x200 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Тестовая выборка: (154, 9)\n",
"Outcome\n",
"0 100\n",
"1 54\n",
"Name: count, dtype: int64\n"
]
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAekAAADECAYAAAC7i9nLAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAAA1QklEQVR4nO3dd1xT1/sH8E8SEvbeKAKKiHug8lNkuEWsq9a6t1Kr1tZ+v7S2tY5qtdpq3drWPeqs2lonVr/uDbiQooIiKks2hITk/P6gSbkkICBwQ3jerxev1puTc597cnOfnHPPvVfAGGMghBBCiM4R8h0AIYQQQrSjJE0IIYToKErShBBCiI6iJE0IIYToKErShBBCiI6iJE0IIYToKErShBBCiI6iJE0IIYToKErShBBCajXGGF6/fo3Y2Fi+Q6lylKQJIYRode/ePRw+fFj978jISPz555/8BVRMdnY2vvrqKzRp0gQSiQS2trbw8vJCTEwM36FVqQol6a1bt0IgEKj/jIyM4OXlhenTpyMpKam6YiSkzrh06RIGDRoER0dHGBoawt3dHaGhoXj27Fml68zLy8O8efNw7ty5qguU1AnZ2dkIDQ3F1atXERsbi5kzZ+Lu3bt8h4W0tDR06tQJq1atwpAhQ3DkyBGcPn0a586dg7u7O9/hVSmDyrxpwYIF8PDwgFQqxcWLF7F+/XocO3YM9+7dg4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1zcHBgaWlp6mVRUVFMKBSyMWPGqJepjjP9+/fnrPvDDz9kAFhUVBQnXtX+MXv2bCYSidjhw4c576toLihLpYa
"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": [
"аугментация данных оверсемплингом(Этот метод увеличивает количество примеров меньшинства)"
]
},
{
"cell_type": "code",
"execution_count": 17,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Обучающая выборка после oversampling: (579, 9)\n",
"Outcome\n",
"0 299\n",
"1 280\n",
"Name: count, dtype: int64\n"
]
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAqIAAADECAYAAABEM0OdAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAAA9VUlEQVR4nO3deVwU9f8H8NfustwgIHJ4oiCaopJ4fPNCCzXFTE0xrbwqtbTL0tLKMzOPTDNNrbwxz9Iy88688L7zAgVTFOSQ+1p2P78/+O3GsgssuDAcr+fjwUN3duYz7/nszOx7P/OZz8iEEAJEREREROVMLnUARERERFQ9MRElIiIiIkkwESUiIiIiSTARJSIiIiJJMBElIiIiIkkwESUiIiIiSTARJSIiIiJJMBElIiIiIklYSB0AERERGZeTk4PExERoNBrUrl1b6nCIzI4tokREVO1s2LABUVFRutdr1qxBdHS0dAHlc/bsWQwdOhSurq6wsrKCp6cnXnrpJanDIioTJUpE16xZA5lMpvuztraGr68vxo8fj9jY2LKKkajaOH78OPr37w93d3dYWVnBy8sLY8aMwb///lvqMjMyMjB9+nQcPnzYfIESVXJHjx7FpEmTEBUVhb1792LcuHGQy6Vvm9m5cyc6deqEa9euYfbs2di/fz/279+PFStWSB0aldCkSZMgk8kwePBgo+9HRUXp5VRKpRKurq7o0KEDpkyZUux5v7jyASAuLg7vvfcemjZtChsbG7i5uaFdu3b4+OOPkZaWhqSkJHh6eqJjx44w9sT3kydPQi6XY+LEiQCA6dOnQyaTwd3dHRkZGQbze3l5oU+fPkXGbUCUwOrVqwUAMXPmTLF+/Xrxww8/iOHDhwu5XC4aNmwo0tPTS1IcEeXz7bffCplMJry9vcWsWbPEjz/+KD788ENRo0YNUaNGDXH8+PFSlRsXFycAiGnTppk3YKJK7Pr168Ld3V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h06BB69OgBIO/kO2rUKDRv3hyTJ0+Gk5MTLly4gD179uji09Z927ZtMWfOHMTGxmLx4sU4fvy4wWfq6uqKb775BgBw//59LF68GL1798a9e/eMfvZAXh/OgwcPonPnzmjYsKHReQYPHozRo0dj165d+OSTT4qv6P9Xq1YtfP/993jrrbfQv39/DBgwAADQsmVLAMDly5fRuXNnKJVKjB49Gl5eXrh9+zZ+//13zJ49G0Del1Hnzp3h6OiISZMmQalUYsWKFejatSv+/vtvtG/fXm+d77zzDjw8PDBjxgycPHkSK1euhJOTE06cOIH69evjyy+/xO7duzF//nz4+flh2LBhumWfdF8vTf2PGTMGQUFButevvfaaXl1p61ErPDwcgwcPxtixYzF8+HCsXr0agwYNwp49e9C9e3cAeZ9pYGAgoqOjMWbMGNSvXx8nTpzA5MmT8fDhQyxatKjI7TDVkSNHsHv37kLfDwkJgZeXF+bMmYOTJ0/i22+/xePHj7Fu3TrdPG+88QbWrl2LgQMH4sMPP8SpU6cwZ84cXL9+3eDY69y5M0aPHg2NRoOrV69i0aJFePDggV6yb+rxaW6ZmZno2rUrIiIiMH78eDRs2BBbt27FiBEjkJSUhPfee6/QZSMiIvDDDz+UaH3a81R2djb27t2LBQsWwNraGrNmzSr1NiQkJODYsWM4duwYRo0ahYCAABw8eBCTJ09GVFQUli9frpu3JJ+bKftsQffu3cPzzz+Ppk2bYsuWLbCwyEsXzLFv+/v748MPP9Sbtm7dOuzfv19vmqnbaMp5PL+y/s7Nzs7G9u3bdds4ZMgQjBw5EjExMfDw8Ci2frSeeeYZeHt7G9SLqeU3aNA
"text/plain": [
"<Figure size 200x200 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"# Применение ADASYN\n",
"X_resampled, y_resampled = ada.fit_resample(df_train.drop(columns=['Outcome']), df_train['Outcome'])\n",
"\n",
"# Создание нового DataFrame\n",
"df_train_adasyn = pd.DataFrame(X_resampled)\n",
"df_train_adasyn['Outcome'] = y_resampled # Добавление целевой переменной\n",
"\n",
"# Вывод информации о новой выборке\n",
"print(\"Обучающая выборка после oversampling: \", df_train_adasyn.shape)\n",
"print(df_train_adasyn['Outcome'].value_counts())\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()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"проведём также балансировку данных методом андерсемплинга. Этот метод помогает сбалансировать выборку, уменьшая количество экземпляров класса большинства, чтобы привести его в соответствие с классом меньшинства."
]
},
{
"cell_type": "code",
"execution_count": 18,
"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/NnZ2aFu3boYPXo0Eh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6alTp3Ds2DH07dsXNWrUQFxcHL766iu0bdsWly9fNmo8Ks21AcirI+np6Rg1ahTUajUWLlyI9u3b4+LFi/Dy8rJImU+ePBmfffYZXnzxRXTq1Annz59Hp06djBouzCKKYeXKlQKA2Lt3r0hKShK3bt0S69evFx4eHsL
"text/plain": [
"<Figure size 200x200 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"# Применение 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": [
"# 3 Датасет: Stroke Prediction Dataset\n",
"#### https://www.kaggle.com/datasets/fedesoriano/stroke-prediction-dataset\n",
"\n",
"According to the World Health Organization (WHO) stroke is the 2nd leading cause of death globally, responsible for approximately 11% of total deaths.\n",
"This dataset is used to predict whether a patient is likely to get stroke based on the input parameters like gender, age, various diseases, and smoking status. Each row in the data provides relavant information about the patient.\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",
"execution_count": 19,
"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"
]
}
],
"source": [
"import pandas as pd\n",
"df = pd.read_csv(\"..//static//csv//healthcare-dataset-stroke-data.csv\", sep=\",\")\n",
"print('количество колонок: ' + str(df.columns.size)) \n",
"print('колонки: ' + ', '.join(df.columns))"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Получение сведений о пропущенных данных\n",
"\n",
"Типы пропущенных данных:\n",
"- None - представление пустых данных в Python\n",
"- NaN - представление пустых данных в Pandas\n",
"- '' - пустая строка"
]
},
{
"cell_type": "code",
"execution_count": 20,
"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 1544\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 True\n",
"stroke False\n",
"dtype: bool\n",
"\n",
"bmi процент пустых значений: %3.93\n",
"smoking_status процент пустых значений: %30.22\n"
]
}
],
"source": [
"import numpy as np\n",
"# Замена значений 'Unknown' на np.nan\n",
"df.replace('Unknown', np.nan, inplace=True)\n",
"\n",
"# Количество пустых значений признаков\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",
" if null_rate > 0:\n",
" print(f\"{i} процент пустых значений: %{null_rate:.2f}\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"пропуски есть и их не мало, с нимим можно поступить 2 способами, удалить записи или достроить эти пропуски"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"- Удаление наблюдений с пропусками"
]
},
{
"cell_type": "code",
"execution_count": 21,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"(3426, 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"
]
}
],
"source": [
"dropna_df = df.dropna()\n",
"print(dropna_df.shape)\n",
"print(dropna_df.isnull().any())"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"срезалось ~2000 записей, что не круто когда записей всего ~5000.\n",
"- Попробуем дополнить базу данных заполнив пропуски"
]
},
{
"cell_type": "code",
"execution_count": 22,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"['formerly smoked' 'never smoked' 'smokes' nan]\n",
"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 0\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 False\n",
"smoking_status False\n",
"stroke False\n",
"dtype: bool\n",
"\n",
"['formerly smoked' 'never smoked' 'smokes']\n"
]
}
],
"source": [
"print(df['smoking_status'].unique())\n",
"# Замена пустых данных на медиану\n",
"df[\"bmi\"] = df[\"bmi\"].fillna(df[\"bmi\"].median())\n",
"\n",
"# Заполнение с помощью модели машинного обучения\n",
"from sklearn.compose import ColumnTransformer\n",
"from sklearn.preprocessing import OneHotEncoder\n",
"from sklearn.linear_model import LogisticRegression\n",
"from sklearn.pipeline import Pipeline\n",
"\n",
"# Определение категориальных и числовых столбцов\n",
"categorical_features = ['gender', 'ever_married', 'work_type', 'Residence_type'] \n",
"numeric_features = ['avg_glucose_level', 'hypertension', 'heart_disease', 'age', 'bmi']\n",
"\n",
"from sklearn.preprocessing import StandardScaler\n",
"\n",
"# Добавляем StandardScaler для числовых признаков\n",
"preprocessor = ColumnTransformer(\n",
" transformers=[\n",
" ('cat', OneHotEncoder(), categorical_features),\n",
" ('num', StandardScaler(), numeric_features) # Применение скейлера к числовым признакам\n",
" ],\n",
" remainder='passthrough'\n",
")\n",
"\n",
"# Создание пайплайна для обучения модели\n",
"pipeline = Pipeline(steps=[\n",
" ('preprocessor', preprocessor),\n",
" ('classifier', LogisticRegression())\n",
"])\n",
"\n",
"# Разделение данных на обучающую выборку и тестовую, исключая smoking_status = 0 из обучающей выборки\n",
"known_smoking_status = df.dropna() # только те строки, где smoking_status != 0\n",
"unknown_smoking_status = df[df['smoking_status'].isnull()] # строки с smoking_status = 0 для предсказания\n",
"\n",
"# Определяем признаки для обучения (категориальные и числовые)\n",
"X_train = known_smoking_status[categorical_features + numeric_features]\n",
"y_train = known_smoking_status['smoking_status']\n",
"\n",
"# Данные для предсказания\n",
"X_test = unknown_smoking_status[categorical_features + numeric_features]\n",
"\n",
"# Обучение модели через пайплайн\n",
"pipeline.fit(X_train, y_train)\n",
"\n",
"# Предсказание пропущенных значений\n",
"df.loc[df['smoking_status'].isnull(), 'smoking_status'] = pipeline.predict(X_test)\n",
"\n",
"# Количество пустых значений признаков\n",
"print(df.isnull().sum())\n",
"print()\n",
"\n",
"# Есть ли пустые значения признаков\n",
"print(df.isnull().any())\n",
"print()\n",
"print(df['smoking_status'].unique())"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"посмотрим выбросы и усредним их:"
]
},
{
"cell_type": "code",
"execution_count": 23,
"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",
" Есть выбросы: Да\n",
" Количество выбросов: 627\n",
" Минимальное значение: 55.12\n",
" Максимальное значение: 169.35750000000002\n",
" 1-й квартиль (Q1): 77.245\n",
" 3-й квартиль (Q3): 114.09\n",
"\n",
"Колонка bmi:\n",
" Есть выбросы: Да\n",
" Количество выбросов: 126\n",
" Минимальное значение: 10.300000000000006\n",
" Максимальное значение: 46.29999999999999\n",
" 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",
" # Устраняем выбросы: заменяем значения ниже нижней границы на саму нижнюю границу, а выше верхней — на верхнюю\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\")\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"построим графики в надежде найти какие то зависимости инсульта от других колонок"
]
},
{
"cell_type": "code",
"execution_count": 31,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAsAAAAJHCAYAAACemuCPAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAABTJUlEQVR4nO3deVhUdf//8deAgqIsoiK4IS6puOVSSqa5kKiYmda3RZPS8tZcUizNO3czzXLPslVbNNts09sVd0UrzX3JBcMNXAgQFxQ4vz+6mF8jaAzNOOB5Pq5rrps55z3nvM8Mc/vq8DmfYzEMwxAAAABgEm6ubgAAAAC4nQjAAAAAMBUCMAAAAEyFAAwAAABTIQADAADAVAjAAAAAMBUCMAAAAEyFAAwAAABTIQADAADAVAjAAIACIS0tTTNmzLA+T05O1pw5c1zX0B2qSpUqeuaZZ1zdBuBSBGCgEJs/f74sFot+/fXXHOs++OADWSwWdenSRZmZmS7oDrBP8eLFNXLkSC1YsEAnTpzQ2LFj9dNPP7m6LQB3oCKubgCA43333Xfq16+fWrRooUWLFsnd3d3VLQH/yN3dXePGjVPPnj2VlZUlHx8fLV261NVtAbgDEYCBO8y6dev05JNPKjQ0VD/99JOKFSvm6paAPBs6dKgef/xxnThxQrVr15afn5+rW8ItZGRkKCsrSx4eHq5uBbALQyCAO8jOnTv18MMPKygoSCtWrJCvr2+Omq+//lqNGzdW8eLFVaZMGfXo0UOnTp3KdXsWiyXXx/Hjx21qxo4da/O6N998UxaLRa1atbIuGzt2rCwWS4595DYeMTk5WYMHD1alSpXk6emp6tWr64033lBWVpZNXVZWlmbOnKl69eqpWLFiKlu2rNq3b28dE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onn/+eesyNzc39e/f36YuKSlJa9as0f/93//ZfPYXLlxQRESEDh8+nGOYUp8+fWx+z1u0aKHMzEz98ccfkqTVq1fr2rVrGjhwoE3d4MGDc/Rp72ffrVs3lS1b1u73AyhIGAIB3AGSkpK0aNEiPfLII9q/f79efPFFtWvXzmYMcPY/jDVr1szx+lq1amnTpk02y5KTkyUpR5C9lTFjxqh8+fL6z3/+k2Mca1hYmCwWi0aMGKHXXnvNut0bx/UePnxYu3fvvuk/sGfPnpX015CP8uXLO/TPr126dLH+7ObmppEjR6pbt26SpHPnzuny5cu5vn+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": "iVBORw0KGgoAAAANSUhEUgAAAq4AAAIjCAYAAADC0ZkAAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuM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ntauXKl2rVrpxNOOEFVVVWSpK1bt+qKK65QXl6eXC6XDj/8cL3wwgsRfYYAQnHGFWilysrKVF9fr8rKSi1fvlx//vOfddFFF6lz587BzIsvvqi0tDRNmDBBaWlpeu+99zRx4kRVVFTo4YcfDtlfz549dfvtt8s0TW3cuFGPPvqoTjvtNG3ZsmWvM0yZMqXJdr/fr9NPP10LFy7URRddpBtuuEGVlZVasGCB1qxZo27duoXd34YNG/Tcc881ezy73a5XXnlFN910U3DbjBkz5Ha7VVdXF5J98cUXNXbsWB111FGaMmWKioqK9Pjjj2vJkiX64osvlJWVJUn68ssvNWTIEDmdTl111VUqLCzUxo0b9Z///Ef33XefzjnnHHXv3j2435tuukmHHnqorrrqquC2Qw89tNmZIzV79mzV1NTod7/7ndq0aaNPP/1UTz75pL7//nvNnj07mHvrrbd04YUXqnfv3poyZYp2796tcePGqUOHDk32efXVVwc/h+uvv16bNm3SU089pS+++EJLlixp9j+CJOndd9/VqaeeqoMOOkiTJk1SbW2tnnzySQ0ePFgrVqxQYWFh1J/Nb3/7W/3jH//Qtddeq8MOO0y7du3SRx99pG+++Ub9+vXT7bffrvLycn3//fd67LHHJKnJxVT33HOPkpKSdPPNN8vj8SgpKSnin/2ePvvsM40YMUIDBgzQG2+8oeTkZBUVFemYY46RYRi69tpr1a5dO82dO1fjxo1TRUUFSxiAn8sE0Cr16NHDlBT8M3r0aNPn84Vkampqmnzd1VdfbaakpJh1dXXBbUOHDjWHDh0akvvTn/5kSjKLi4uD2ySZd911V/D1LbfcYubm5pr9+/cP+foXXnjBlGQ++uijTY4fCARM0zTNTZs2mZLMGTNmBN+74IILzF69epmdOnUyx4wZE9w+Y8YMU5J58cUXm7179w5ur66uNjMyMsxLLrnElGR+9tlnpmmaptfrNXNzc81evXqZtbW1wfybb75pSjInTpwY3Hb88ceb6enp5rfffht2zj116dIlZLafGjp0qHn44YeHfW9fwv2spkyZYhqGETJb7969zY4dO5qVlZXBbYsXLzYlmV26dAlu+/DDD01J5syZM0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7cqbKyMk2fPr3JZzh27FhJ2uvnCKAp1rgCkCSdd955uv3227Vs2TINHjxYZWVlGjp0qDIyMjR58mR169ZNbrdbK1as0B//+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+tcx2IYhiEAAADAJPLkdgEAAABATiIAAwAAwFQIwAAAADAVAjAAAABMhQAMAAAAUyEAAwAAwFQIwAAAADAVAjAAAABMhQAMAAAAUyEAAwDuKyUlRZMmTbI9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v2VfPmze3GAKf/gK9cuXKG11epUkU//vijXVtSUpIkZQiy9zJ8+HCVKFFCr7zySoZxrGFhYbJYLBo8eLDeffdd23rvHNd77Ngx7du3zzb+8E5nzpyRdGvIR4kSJeTn55fl+u6nbdu2tn/nyZNHQ4YMsYWPs2fP6sqVK5kev+DgYFmtVp04cUJVq1a95zYiIiK0bds2SVKLFi0y/dPrneMeM5M+/nn69OmKi4uzC5+3hzVnH/d0w4cPz/Q/H3cOK0mXlpamf//73+rUqZPtz+h3ExcXp48//lgfffSRwxc9nTt3ThU
"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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5dyvL5Vq1a
"text/plain": [
"<Figure size 800x600 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAsAAAAIrCAYAAADhrC+uAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAABUpElEQVR4nO3deVxU9f7H8feAMqIC5sJiIpK4oai5XMV9IdE0Na3rVlhZLmmmtqhlrhmmWWqZtl1t0ZvLVSu5LqS5ZKjlvl8zFFMRywBxQYHz+6MH83MClbEZhzqv5+NxHg/mez5z5nOGEd8cvvMdi2EYhgAAAACT8HB3AwAAAMCdRAAGAACAqRCAAQAAYCoEYAAAAJgKARgAAACmQgAGAACAqRCAAQAAYCoEYAAAAJgKARgAAACmQgAGANxURkaGZsyYYbudmpqq2bNnu68hFErjx4+XxWJx6jFbtWqlVq1aOfWYgEQABlxi/vz5slgs+uGHH/Ls++CDD2SxWNS1a1dlZ2e7oTvAMd7e3hozZowWLFigkydPavz48frqq6/c3RYA3LYi7m4AMJPly5dr0KBBat68uT7//HN5enq6uyXgljw9PTVhwgTFxMQoJydHvr6+iouLc3dbKGTGjBmjUaNGubsNoEC4AgzcIRs2bFCvXr0UHh6ur776SsWKFXN3S0CBPffcczpx4oS+++47nThxQs2aNXN3S38bly5dcncLt5SVlaWrV6/mu+/ixYuSpCJFivBzDX8ZBGDgDti9e7e6dOmioKAgrVmzRn5+fnlqlixZovr168vb21tly5bVI488olOnTuV7PIvFku92/Phxu5rx48fb3W/atGmyWCx2c+puNG+vUqVKeuyxx+zGUlNTNWzYMAUHB8tqtSosLEyvv/66cnJy7OpycnI0c+ZMRUREqFixYipXrpzat29vmxJyo/5zt9z+NmzYYDdutVpVtWpVxcbGyjAMu8fctWuXOnToIF9fX5UsWVJt27bV1q1b833+rnfkyBG1adNGgYGBslqtCg4O1sCBA3X+/HlbTW4fS5cuzXP/kiVL2j1P58+f1/PPP6+IiAiVLFlSvr6+6tChg/bs2WN3P2c/78ePH5fFYtEbb7yR55i1atWy+57nns+GDRvs6jp27JjndXN9nxUqVFBkZKSKFCmiwMDAfI9xI61atcr3e/3H16j0/1OIbvS6yLVr1y61b99e5cqVs6vr1KnTLfvJycnRjBkzVLNmTRUrVkwBAQEaMGCAfvvtN1tNp06ddM899+R7/8jISDVo0MBu7LPPPrP9Gy5durR69uypkydP5nkeatWqpR07dqhFixYqXry4XnrppVv2K/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/Ouvv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+c9/ZLFYNG7cuDzHuN0lktLS0vTLL78oKSlJU6dOVU5Ojtq0aSNJys7O1tq1a9W1a1e7P1cHBQWpd+/e+vbbb5Wenl6gxzh79qzWrVunuLg421Wz6124cMHu3H/55Zc8NVarVR4eHrbefv31V5UsWVLVqlXTzp07bXXOft5zXbp0KU+Pt1ptZNmyZfr+++81ZcqUm9ZJ0qRJk+Tn56ehQ4fesvZ6V65cKfD80IK8xi9cuCBJKlOmjEN9SL8/p35+frrvvvvsnqf69eurZMmStikBudNXFi9ebHeVc9GiRWrcuLEqVqwo6ffnLycnR//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/Va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J932vXrlXXrl1VuHBh3bhxI9PjWrRoofLly1vvWywW9e3bV3PmzFH58uWVL18+1axZU+vXr8/02DNnzqh79+4qUqSIPD09ValSJX3++ef/mhXIKUyBAHKZ48ePq2XLlvL09NTKlStVtGjRTGNmzZql5557TrVr19bYsWOVkJCgKVOmaNOmTdq1a5f8/PwyPebxxx+3/iW+YcMGffzxx7fNkZiYqLFjx97x+7h69aoaNWqkM2fO6MUXX1TJkiW1efNmDR06VOfOnbM5SapHjx6aNWuWWrVqpeeff15paWnasGGDtmzZolq1aumrr76yjr2ZfdKkSSpcuLAkqUiRIjav/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/PCxcuGAcPHjSKFStm1K5d27h48eJtM9/qPfzz809PTzeKFy9u8z4MwzDee+89w2KxGL/99pt1myRDkrF9+3brtpMnTxr58uWzed89evQwihYtavz+++82z9mhQwfD19fXuHr1ql3ZAWdgCgSQi3Tr1k2nTp1Sp06dtGrVKi1cuDDTmO3bt+v8+fN66aWXbOYFt2nTRhUqVMh0slFqaqokydPTM9s5zpw5o/fff19vvvmmvL29bfYFBgZKkk6fPn3b51i4cKEaNGigQoUK6ffff7femjdvrvT0dOuvTb/99ltZLJZMR5okZfkr/+y4dOmSfv/9d8XFxWnChAnKyMhQ06ZNJUnp6elatWqV2rZtq9KlS1sfU7RoUXXq1EkbN25UUlJStl4jISFB0dHRWr58uRo2bJhpzOXLl23ee1ZLWXl6esrNzc2a7Y8//pC3t7fKly+vnTt3Wsc5+nO/6erVq5ky/ttqI4sWLdK2bds0bty4246TpNGjR8vX11f9+vX717F/d/369WzPe8/Od/zy5cuSpPvuu8+uHNJfR4AlWT+7DRs2qHbt2nr44Ye1YcMGSX/9xmTfvn3WsXfyPXvhhRdueaLrvn371KhRI5UqVUpr1qxRoUKF7H4fWXFzc1Pnzp21dOlS62ckSXPmzFHdunUVEhJiMz48PFw1a9a03i9ZsqQee+wxrVy5Uunp6TIMQ99++60effRRGYZh872KiIjQpUuXbL7XgKtQgIFc5OLFi5o9e7a++OILVatWTa+88oouXbpkM+bkyZOSZDM376YKFSpY99+UmJgoSZmK7O0MHz5cxYoV04svvphpX3h4uCwWi4YOHaoTJ05Y/3L757zeo0ePasWKFQoICLC5NW/eXJJ0/vx5SX/9SrdYsWLy9/fPdr5/07ZtWwUEBCg4OFgjRozQG2+8ofbt20uSLly4oKtXr2b5+VWsWFEZGRk6derUv75GRESEgoKC1Lx5c1WsWFELFizINKZ79+6Z3v8/f7WdkZGhSZMmqWzZsvL09FThwoUVEBCgvXv32vzsHf253zR8+PBMYw8dOnTL952enq7//e9/6ty5s/VX/7cSGxurjz76SCNHjrT7JM7ff/89y7nvWcnOd7xWrVrKmzevRowYoV27dt3y88tKkSJFVLZsWWvZ3bBhgxo0aKCGDRvq7Nmz+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+fChQooIYNG2r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qZJN7cKFC+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": "iVBORw0KGgoAAAANSUhEUgAAArcAAAIjCAYAAAAZajMiAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAAB5kElEQVR4nO3dd3hUVf4G8Pfe6cmk94RAIKFJEQREBKVKKAoCiiBr/4m7drEsrIKCBcGGKMLqKupaFl1X3EWqCKKIKEiRIpAYiASSEELKJNPv+f0xZGRImSFM5sb4fp6HB+bOd+79zpDoy8m550hCCAEiIiIiohZAVrsBIiIiIqJgYbglIiIiohaD4ZaIiIiIWgyGWyIiIiJqMRhuiYiIiKjFYLglIiIiohaD4ZaIiIiIWgyGWyIiIiJqMRhuiYiIiKjFYLglIvod27hxIyRJwsaNG9VuJaSeeOIJSJKkdhsAmlcvahs0aBC6du2qdhv0B8dwSxSAJUuWIDs7G0lJSdDpdEhOTsbAgQPx7rvvQlEUtdsjIgrYa6+9hrffflvtNoiajFbtBoh+D9555x2kpKRg5syZiIyMRFlZGb777jvcfPPNWLVqFT788EO1WyQiCshrr72G+Ph43HzzzWq3QtQkGG6JArBp0ybodDqfY/feey/i4uLw6quvYu7cucjIyFCnOSKiJlJVVYXw8HC12yA6J5yWQBSAs4NtjZpAK8u/fSt99tlnGD16NFJTU2EwGJCZmYknn3wSbrfb57WDBg2CJEneX/Hx8Rg9ejT27NnjUydJEp544gmfY8899xwkScKgQYN8jttsNjzxxBPo0KEDjEYjUlJSMH78eO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fffduOyyy/DAAw/g8OHDuPrqqxETE+MTEgIxY8YMzJ8/H1dddRWys7Oxa9cuZGdn1/rMz0cgXzNCCIwZMwYbNmzAbbfdhh49emDNmjV4+OGHUVBQgJdeegkAsHfvXlx55ZXo3r075syZA4PBgJycHGzevNl7PUVRMGbMGHzzzTeYOnUqOnfujJ9++gkvvfQSDh48iOXLl5/X+3n66acxc+ZMTJw4Ef/3f/+HEydO4JVXXsHll1/u/fq77rrrsGjRInz++ee49tprva+trq7G//73P9x8883QaDQAgH/+85+46aabkJ2djXnz5qG6uhqLFy/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": "iVBORw0KGgoAAAANSUhEUgAAAq4AAAIjCAYAAADC0ZkAAAAAOXRFWHRTb2Z0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9jdwoULdeKJJ6qwsFDBYFAHH3ywfvzjHyd/12OOOUaSNHXq1OQ52/+baX+/ly9frpNPPlk5OTnJn62pqdHVV1+t8vJy+f1+HXHEEfrd736319/Ztm1dc8018nq9+tOf/pQcf/rpp5P/LRUXF+viiy/Wxo0b93o+AKmYcQX6qLq6OsViMTU2Nmr58uX6xS9+oYsvvliDBg1K1jz11FMKBoOaPn26gsGgXnvtNd12221qaGjQPffck3K+UaNG6ZZbbpFt21q7dq1+9atf6ayzztKGDRv22MOsWbM6jMfjcZ1zzjl69dVXdfHFF+sHP/iBGhsbtXDhQq1atUrDhw/v9Hxr1qzR448/3uX1XC6Xnn76ad1www3JsdmzZ8vv96u1tTWl9qmnntLUqVN1zDHHaNasWdq6dat+/etf64033tA///lPFRYWSpJWrlypk046SR6PR9dcc42GDBmitWvX6s9//rN++tOf6sILL9SIESOS573hhht0yCGH6JprrkmOHXLIIV32/GXs3LlTZ511li666CJdcskl+v3vf6/vfe978nq9uuqqq1JqZ82apUAgoJtuuklr1qzR/fffL4/HI9M0tXPnTs2YMUNvvvmmnnrqKQ0dOlS33Xbbl+rFtm2dd955WrRoka6++modeeSRmj9/vv7rv/5LmzZt0r333itJ+t///d/kz/ztb3/TY489pnvvvVelpaWSpPLy8i6v8cEHH+icc87RmDFjdMcdd8jn82nNmjV64403JCXe1zvuuEO33XabrrnmGp100kmSpOOPPz55ju3bt+vMM8/UxRdfrG9961sqLy9XKBTShAkTtGbNGl177bUaOnSonn/+eV155ZWqq6vTD37wg077icfjuuqqq/Tcc89p7ty5OvvssyVJP/3pT3Xrrbfqoosu0r/9279p27Ztuv/++3XyySen/LcEIA02gD7p4IMPtiUlvy6//HI7Go2m1LS0tHT4uX//93+3c3Jy7NbW1uTYKaecYp9yyikpdT/+8Y9tSXZNTU1yTJJ9++23J1//6Ec/ssvKyuyxY8em/Pxvf/tbW5L9q1/9qsP1Lcuybdu2161bZ0uyZ8+enTx20UUX2aNHj7arqqrsK664Ijk+e/ZsW5J9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mX79+Ovvss/Xb3/5WkvTb3/5WV1xxRYeg+9lnn0mSDj744A7nGDVqVPL4p59+KklZ3T/1448/Vr9+/VLWy86ZMyetn62srFRubm7K2MiRIyUl1gTvavegXVBQIEmqqqrqMG5ZVoe/77357LPPVFlZqby8vJTx9mUR7e9hJr75zW/qhBNO0L/927+pvLxcF198sX7/+99/qRA7YMAAeb3eDr0fdNBBHf676Kr3WbNm6YUXXtAf/vCHDmtyP/nkE9m2rYMOOij599r+9dFHH6mmpuZL/MYAWOMKQJL09a9/XbfccoveeustnXDCCaqrq9Mpp5yi/Px83XHHHRo+fLj8fr/effdd3XjjjR3CwZgxY/TLX/5SUmIm8je/+Y0mTJigd999VxUVFSm1H330kZ566ik9/fTTXd4s9mUsWLBAr7zyipYtW7bX2quuukqXX365rrvuOi1dulRPPPGE/va3v2XcQ7YMGTIkuU53+/bt+s1vfqNvf/vbGjZsmI477risXcflcn2pcXuXG6r2F4FAQEuXLtWiRYv017/+VfPmzdNzzz2n0047TQsWLOjyd9n9HJmaPHmy5s2bp5///OeaMGFCyiy9ZVkyDEMvv/xyp/3s/mkDgD0juAKQJIVCIUlfBJfFixdr+/b
"text/plain": [
"<Figure size 800x600 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAsAAAAKLCAYAAAD4sD5AAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAABuJklEQVR4nO3deVhU5f//8deAgKICLmwmrpiKorllZO4LKrlXrmmluaSZWqZ+MrcWt0zNyspKWjQrMy1NcddS3Pd9DzdcQwRX4Pz+6Md8HXFhaHDA83xc11wXc597znmfgcGXN/e5j8UwDEMAAACASbg4uwAAAADgQSIAAwAAwFQIwAAAADAVAjAAAABMhQAMAAAAUyEAAwAAwFQIwAAAADAV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LlysnT01P58uVT1apVNXPmTEn//rwMHDhQklS8ePE0v5umT5+uevXqyc/PTx4eHgoJCdHUqVNt9l+sWDHt3r1bq1atSvO9v9vnJvX7devvwE2bNik8PFwFCxZUrly5VLx4cb300kt2nSvACDCQQYcPH1bjxo3l4eGhqKgoBQYGpukTGRmpF198UdWqVdPo0aN15swZTZ48WWvWrNHWrVvvONrWqlUrtW7dWpL0559/6osvvrhnHXFxcRo9enSGz+PKlSuqXbu2Tp48qR49eqhIkSJau3athgwZotOnT9tcJNW1a1dFRkaqSZMm6tatm5KSkvTnn39q3bp1qlq1qr777jtr39TaJ06cqIIFC0qS/P39bY79v//9T2XLltXVq1f1448/6n//+5/8/PzUtWtXSdLu3btVs2ZNeXl56c0335Sbm5s+//xz1alTR6tWrVL16tXvel6JiYkqXLiwmjVrJi8vL+3atUuffPKJTp48maF5rkeOHNHcuXP17LPPqnjx4jpz5ow+//xz1a5dW3v27FGhQoXs2p897/t/sXr1av3xxx/p6jthwgSdOXPG7mMULlzY+jOYkJCgXr163bP/rT8T7733ns22S5cuqUmTJjIMQwMGDFBQUJAkqX///vetY8mSJWrfvr3q16+vsWPHSpL27t2rNWvW6LXXXrPp++qrryogIEAjR47UunXr9MUXX8jHx0dr165VkSJF9P777+uPP/7Q+PHjVb58eXXu3FmSZBiGmjdvrhUrVqhr16567LHHFBUVpYEDB+rkyZOaOHHiXesbOnSo3n//fX3++ed6+eWX73kuycnJCg8PV/Xq1fXBBx9o6dKlmjBhgkqWLGl9f1NSUtSsWTNt2LBBvXr1UpkyZTRv3jx16dLlvu/V7aZNm6a+ffvqmWee0WuvvaZr165px44dWr9+vTp06KDWrVvrwIED+uGHH2y+f76+vpKkqVOnqly5cmrevLly5Mih33//Xa+88opSUlLUu3dvSdKkSZP06quvKk+ePHrrrbckpf2dcD9nz55Vo0aN5Ovrq8GDB8vHx0fHjh3TnDlz7D5nmJwBIN2mT59uSDLmz59vlCxZ0pBkNGrU6I59b9y4Yfj5+Rnly5c3rl69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3Pz/jly5clSQUKFLCrDkny8fFRYmKilixZct++Xbt2tfm5rV69ugzDsP71Qfr3IsGqVavqyJEj1rY//vhDrq6uad6n119/XYZhaOHChTbthmGoT58+mjx5sr7//nu7Rmd79uxp87xmzZo2tSxatEhubm42o8kuLi7WEVd7+Pj46MSJE9q4caPdr5X+XVEkVernunbt2jpy5IguXbqUoX3eSepfzebPn6+bN286bL8wH6ZAABlw8eJFzZo1S61atdKePXv02muvqVGjRjZzgP/++29JUunSpdO8vkyZMvrrr79s2lKXFro9yN7L8OHDVahQIfXo0SPNPNawsDBZLBYNGTJE7777rnW
"text/plain": [
"<Figure size 800x600 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"# Список колонок для построения графиков\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": "markdown",
"metadata": {},
"source": [
"Создадим выборки данных. разбивать будем относительно параметра инсульта, ведь это тот самый параметр по которому наша выборка разбивается на классы. И собственно его нам и надо будет предсказывать"
]
},
{
"cell_type": "code",
"execution_count": 32,
"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": "iVBORw0KGgoAAAANSUhEUgAAAeYAAADECAYAAABKgIJGAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAAA3W0lEQVR4nO3dd1gU1/oH8O/2Xar0LqCAKHYssWLBgjUxRo2JGhMVE2OuJfEX47XGXK+X2CL2RI3Rm1iIGo2xl6hRrNhFqgXpIB2W3T2/P7i7Yd2lCsy6+36eh0d39sw578zOzDvtzPAYYwyEEEIIMQh8rgMghBBCyN8oMRNCCCEGhBIzIYQQYkAoMRNCCCEGhBIzIYQQYkAoMRNCCCEGhBIzIYQQYkAoMRNCCCEGhBIzIcRoqVQqZGRkID4+nutQSB1TKBRIS0vDkydPuA6lzlFiJoSgV69eaNmyJddh1ImUlBTMmDEDnp6eEIvFcHBwQIsWLZCbm8t1aK+Fw4cPIyoqSvP5wIEDuHfvHncBlRMTE4PJkyfDxcUFYrEYTk5O6NKlC4ztAZbCmhTevn07Jk6cqPkskUjQuH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tjV6/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+45z115cs8994bHGGMghBBCiM7icx0AIYQQQt4OJXNCCCFEx1EyJ4QQQnQcJXNCCCFEx1EyJ4QQQnQcJXNCCCFEx1EyJ4QQQnQcJXNCCCFEx1EyJ4QQohdycnLw8uVLpKWlcR1KlaNkTghBp06d0KRJE67DIDrqm2++gUKhAAAoFAosW7aM44j+tWfPHnTt2hUmJiaQSqWoV68evv32W67DqnKVSubbt28Hj8dT/YnFYjRo0ACTJ09GQkJCdcVICAGwYcMGbN++neswCNGwY8cOrFy5Eq9evcKqVauwY8cOrkMCAMyZMweBgYEwMTHBjz/+iKNHj+LYsWOYOHEi16FVOYM3mWnJkiVwdXVFfn4+zp07h40bN+Lvv//GvXv3YGRkVNUxEkJQnMytrKwwevRorkMhRM2SJUswcuRIfPHFFxCJRAgJCeE6JJw+fRrLly/HsmXL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TTcnNzWaNGjZidnZ1qOwUHBzMALCQkRFVOJpOxNm3aMKlUqsolyvX
"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+fMnBkeY4yBEEIIIdXG5zoAQgghxFBREiWEEEJqiJIoIYQQUkOURAkhhJAaoiRKCCGE1BAlUUIIIaSGKIkSQgghNURJlBBCCKkhIdcBEEIIqd8KCwuRmZkJoVAIe3t7rsOpVXQkSghB9+7d0bJlS67DINW0bt06ZGdna16vXr0aMpmMu4BKiYiIQGhoKCwtLSGVSuHi4oJ//etfXIdV66qVRLdv3w4ej6f5k0gk8Pb2xtSpU5GSkqKvGAkhADZs2IDt27dzHQZ5g/z+++9YsGABnj17ht27d2PevHmQSqVch4UNGzagX79+yMnJwZo1a3Dq1CmcOnUKixYt4jq0Wlej7txFixbBw8MDhYWFuHTpEjZu3Ig//vgDd+/ehbGxcW3HSAhByY7J1tYWo0eP5joU8oaYO3cuQkNDsWbNGvD5fHz//ffg87ntYIyJicHMmTMxceJEbNiwATwej9N49K1GSTQ4OBjt2rUDAIwfPx42NjZYuXIlDh8+jA8++KBWAySEVJ9MJoOJiQnXYRA9CwoKwpMnT/DgwQO4urqiUaNGXIeEH374A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sAwBhDaGgozp49i3HjxqFNmzY4ceIEPv/8cyQmJmq+R2rnz5/H3r17MX36dIjFYmzYsAH9+/fHlStXKrwo7tatWxg0aBBCQkKwfv16zfSUlBR07NhRk5zt7Oxw7NgxjBs3Di9fvsSMGTOqvsCsGrZt28YAsIiICJaWlsaePXvGfv31V2ZjY8OkUil7/vw5Y4yxwsJCplQqteaNj49nYrGYLVq0SDNt69atDABbuXKlTlsqlUozHwC2fPlynTK+vr4sKChI8/rs2bMMAHNxcWEvX77UTN+3bx8DwNasWaOpu2nTpqxfv36adhhjLD8/n3l4eLA+ffrotBUYGMhatmypeZ2WlsYAsPnz52umJSQkMIFAwJYsWaI17507d5hQKNSZHhMTwwCwHTt2aKbNnz+flf5YLl68yACw3bt3a817/Phxnelubm5swIABOrFPmTKFlf2oy8b+xRdfMHt7e+bv76+1Tnfu3Mn4fD67ePGi1vw//vgjA8AiIyN12istKChIU99///tfJhQK2axZs8otW5X1wVjJ51SaXC5nLVu2ZD179tSqi8/ns3fffVdnW1R/5tnZ2czMzIx16NCBFRQUlFtGLpcze3t71rJlS60yR48eZQDY119/rZk2atQo5ubmplXP5s2bGQB25cqVcpeZMcaysrIq3MZLK7u9q6m/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": [
"аугментация данных оверсемплингом(Этот метод увеличивает количество примеров меньшинства)"
]
},
{
"cell_type": "code",
"execution_count": 34,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Обучающая выборка после oversampling: (5831, 17)\n",
"stroke\n",
"0 2917\n",
"1 2914\n",
"Name: count, dtype: int64\n"
]
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAqIAAAH4CAYAAACR/I//AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwga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atGihWt3kHvvvbfE87tp06au9REUFKR69erpiiuuKDF9WJ7nZ1mP5ehtt6LrR5L27t2r6667TomJiYqIiFDnzp01bdo0t+sUL3Pq1KmKjo5W9+7d1aJFC91yyy1yOBwaNWpUifsq7fZHT6c2bdpUd911l/Ly8lzXK34+/Pzzz2Uu69jn8LJly9SlSxf997//dW03rVq10mOPPea23UgV+72VZ5stznv0frO//vqr4uPjNXjwYBUUFLguL8+2XZajt6MTvdaX9zFK5Xsdr+r33OOZMWOG2rVrp379+ql///6aMWNGuW8rSU2aNNHUqVOVl5enJ554olLL37x5s4KDg3XmmWeW+FlcXJwiIiJc37/00kvKzc3VuHHjJEnbt2/XhAkTdMUVV2jAgAElbn///fdrz549evnllyv0uEpTJUfNF5fG2rVrS5K2bNmiTz75RJdffrmaNWumPXv26JVXXlGfPn3022+/uY78Kyws1ODBg7Vw4UL9/e9/1+23367Dhw9rwYIFWrdunVq0aOG6j+HDh2vgwIFu9zt+/PhS8zz66KNyOBz6v//7P+3du1fPPPOM+vfvr9WrVysyMlKStGjRIg0YMEBdu3bVAw88oKCgIL311ls655xz9N1336lbt24lltuwYUNNnDhRkpSZmambbrqp1Pu+7777NGzYMF1//fXat2+fnn/+efXu3VurVq1SzZo1S9xmzJgx6tWrlyTpo48+0scff+z287Fjx2rq1KkaPXq0/vGPfyg5OVkvvPCCVq1ape+//16hoaGlroeKSE9Pdz22ozmdTg0ZMkRLlizRmDFjdMopp+iXX37R008/rT/++EOffPJJhe7nrbfe0n/+8x89+eSTGjFiRKnXOdH6ePbZZzVkyBBdeeWVysvL0/vvv6/LL79cn332mQYNGuS63oMPPqgJEyaoR48eeuihhxQWFqbly5dr0aJFOv/88yUVvfhee+21at++vcaPH6+aNWtq1apVmjt3ritf8bo/44wzNHHiRO3Zs0fPPvusvv/++xK/04SEBD399NOSpB07dujZZ5/VwIEDtX379lJ/91LRPpwLFy5Ur1691KxZs1Kvc8UVV2jMmDH67LPPdM8995x4Rf+pTp06evnll3XTTTdp6NChuuSSSyRJnTp1kiStXbtWvXr1UmhoqMaMGaOmTZtq8+bN+vTTT/Xoo49KKnoz6tWrl+Li4nT33XcrNDRUr7zyivr27atvv/1W3bt3d7vP2267TfXq1dODDz6oZcuW6dVXX1XNmjX1ww8/qHHjxvrvf/+rL774QpMmTVKHDh10zTXXuG57stt6Zdb/2LFj1b9/f9f3V199tdu6Kl6PxTZu3KgrrrhCN954o0aOHKm33npLl19+uebOnavzzjtPUtHvtE+fPkpNTdXYsWPVuHFj/fDDDxo/frx27dqlZ5555riPo7wWL16sL774osyfDxs2TE2bNtXEiRO1bNkyPffcczp48KDefvtt13Wuv/56TZs2TZdddpnuuOMOLV++XBMnTtT69etLPPd69eqlMWPGyOl0at26dXrmmWe0c+dOt7Jf3udnVTty5Ij69u2rTZs26dZbb1WzZs00a9YsjRo1Sunp6br99tvLvO2mTZv02muvVej+il+ncnNzNW/ePE2ePFkRERF6+OGHK/0Y0tLStGTJEi1ZskTXXnutunbtqoULF2r8+PFKSUnRlClTXNetyO+tPNvssbZv364LL7xQbdu21cy
"text/plain": [
"<Figure size 600x600 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"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('Распределение классов Outcome в тренировачной выборке после ADASYN')\n",
"plt.show()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"проведём также балансировку данных методом андерсемплинга. Этот метод помогает сбалансировать выборку, уменьшая количество экземпляров класса большинства, чтобы привести его в соответствие с классом меньшинства."
]
},
{
"cell_type": "code",
"execution_count": 37,
"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": "iVBORw0KGgoAAAANSUhEUgAAAtwAAADECAYAAACss/a2AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAAA+PklEQVR4nO3dd3gUVdsG8Ht30xtpkEJLTCD0RIPwUkIAIUCCCIg0C1VAiiAIin5IFxUUkCKK0oRXqsIrIh2khSIdKQZMEAKkQUIKu0l2z/dH3DWT3YRNWYYk9++6csHOTnnmzNmZZ8+cOasQQggQEREREZFFKOU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syZJd6HlJQUHDlyBEeOHMHgwYMRGhqKffv2YfLkyYiLi8OyZcsM8xbnuJlTZwu6desWOnfujHr16mHjxo2wsspLF8qiboeEhGDChAmSaWvWrMGePXsk08zdR3PO4/k9DdfcgsaMGQM3NzdMnToVcXFxWLBgAUaPHo0NGzYY5vnoo48wa9YsREZGIjIyEmfOnEFERITkix5Q/GOkv7MybNgw2Nrawt3dHcuXL8fbb7+NXr16Gb6oX7hwASdOnDCU6alTp3Ds2DH07dsXNWrUQFxcHL766iu0bdsWly9fNmo8Ks21AcirI+np6Rg1ahTUajUWLlyI9u3b4+LFi/Dy8rJImU+ePBmfffYZXnzxRXTq1Annz59Hp06djBouzCKKYeXKlQKA2Lt3r0hKShK3bt0S69evFx4eHsL
"text/plain": [
"<Figure size 200x200 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"array(['Male', 'Female'], dtype=object)"
]
},
"execution_count": 37,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# Применение 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('Распределение классов Outcome в тренировочной выборке после Undersampling')\n",
"plt.show()"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "laba",
"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.6"
}
},
"nbformat": 4,
"nbformat_minor": 2
}