pred_analytics/lec5.ipynb

1176 lines
2.6 MiB
Plaintext
Raw Normal View History

2025-01-13 14:42:39 +04:00
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Загрузка данных"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Ирисы Фишера -- набор данных для задачи классификации, на примере которого Рональд Фишер в 1936 году продемонстрировал работу разработанного им метода дискриминантного анализа. Иногда его также называют ирисами Андерсона, так как данные были собраны американским ботаником Эдгаром Андерсоном. Этот набор данных стал классическим и часто используется в литературе для иллюстрации работы различных статистических алгоритмов.\n",
"\n",
"Ирисы Фишера состоят из данных о 150 экземплярах ириса, по 50 экземпляров из трёх видов -- Ирис щетинистый (Iris setosa), Ирис виргинский (Iris virginica) и Ирис разноцветный (Iris versicolor).\n",
"\n",
"Для каждого экземпляра измерялись четыре характеристики (в сантиметрах):\n",
"1. Длина наружной доли околоцветника (англ. sepal length);\n",
"2. Ширина наружной доли околоцветника (англ. sepal width);\n",
"3. Длина внутренней доли околоцветника (англ. petal length);\n",
"4. Ширина внутренней доли околоцветника (англ. petal width).\n",
"\n",
"На основании этого набора данных требуется построить правило классификации, определяющее вид растения по данным измерений. Это задача многоклассовой классификации, так как имеется три класса -- три вида ириса.\n",
"\n",
"Один из классов (Iris setosa) линейно-разделим от двух остальных."
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>sepal length (cm)</th>\n",
" <th>sepal width (cm)</th>\n",
" <th>petal length (cm)</th>\n",
" <th>petal width (cm)</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>5.1</td>\n",
" <td>3.5</td>\n",
" <td>1.4</td>\n",
" <td>0.2</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>4.9</td>\n",
" <td>3.0</td>\n",
" <td>1.4</td>\n",
" <td>0.2</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>4.7</td>\n",
" <td>3.2</td>\n",
" <td>1.3</td>\n",
" <td>0.2</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>4.6</td>\n",
" <td>3.1</td>\n",
" <td>1.5</td>\n",
" <td>0.2</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>5.0</td>\n",
" <td>3.6</td>\n",
" <td>1.4</td>\n",
" <td>0.2</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" sepal length (cm) sepal width (cm) petal length (cm) petal width (cm)\n",
"0 5.1 3.5 1.4 0.2\n",
"1 4.9 3.0 1.4 0.2\n",
"2 4.7 3.2 1.3 0.2\n",
"3 4.6 3.1 1.5 0.2\n",
"4 5.0 3.6 1.4 0.2"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>sepal length (cm)</th>\n",
" <th>sepal width (cm)</th>\n",
" <th>petal length (cm)</th>\n",
" <th>petal width (cm)</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>145</th>\n",
" <td>6.7</td>\n",
" <td>3.0</td>\n",
" <td>5.2</td>\n",
" <td>2.3</td>\n",
" </tr>\n",
" <tr>\n",
" <th>146</th>\n",
" <td>6.3</td>\n",
" <td>2.5</td>\n",
" <td>5.0</td>\n",
" <td>1.9</td>\n",
" </tr>\n",
" <tr>\n",
" <th>147</th>\n",
" <td>6.5</td>\n",
" <td>3.0</td>\n",
" <td>5.2</td>\n",
" <td>2.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>148</th>\n",
" <td>6.2</td>\n",
" <td>3.4</td>\n",
" <td>5.4</td>\n",
" <td>2.3</td>\n",
" </tr>\n",
" <tr>\n",
" <th>149</th>\n",
" <td>5.9</td>\n",
" <td>3.0</td>\n",
" <td>5.1</td>\n",
" <td>1.8</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" sepal length (cm) sepal width (cm) petal length (cm) petal width (cm)\n",
"145 6.7 3.0 5.2 2.3\n",
"146 6.3 2.5 5.0 1.9\n",
"147 6.5 3.0 5.2 2.0\n",
"148 6.2 3.4 5.4 2.3\n",
"149 5.9 3.0 5.1 1.8"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n",
" 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n",
" 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n",
" 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n",
" 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,\n",
" 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,\n",
" 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2])"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"array(['setosa', 'versicolor', 'virginica'], dtype='<U10')"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"from sklearn import datasets\n",
"import pandas as pd\n",
"\n",
"iris = datasets.load_iris()\n",
"\n",
"irisdf = pd.DataFrame(data=iris.data, columns=iris.feature_names) # type: ignore\n",
"display(irisdf.head())\n",
"display(irisdf.tail())\n",
"\n",
"y = iris.target # type: ignore\n",
"display(y)\n",
"\n",
"y_names = iris.target_names # type: ignore\n",
"display(y_names)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Визуализация данных с учетом понимания из особенностей"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAABSUAAAPdCAYAAAB84A2oAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/GU6VOAAAACXBIWXMAAA9hAAAPYQGoP6dpAAEAAElEQVR4nOzdd5RURdrH8W/d7p4cyTlIVJAkImAATCjmtGbMrq5x3TWAYV3XFcMaX7OuYsacXROCORIUJCiSc56cum+9f/QwMMx09wzT0z3h9zmnD8ytulXPnZ7pqX66bpWx1lpEREREREREREREYsSJdwAiIiIiIiIiIiLSvCgpKSIiIiIiIiIiIjGlpKSIiIiIiIiIiIjElJKSIiIiIiIiIiIiElNKSoqIiIiIiIiIiEhMKSkpIiIiIiIiIiIiMaWkpIiIiIiIiIiIiMSUkpIiIiIiIiIiIiISU0pKioiIiIiIiIiISEwpKSkiIiIiIiIiIiIx5Y13ANvcfvvtTJgwgSuuuIL77ruv2jqTJ0/mnHPOqXQsMTGR4uLiGvfjui6rV68mPT0dY0xdQhYRERGJC2steXl5dOjQAcfRZ8y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KrP8PwISv5G4EWxCTeMIqnVmzev559RuHNEtKSoqIiIiIiIiIRItJJWJSEgdMYiyiiRBGi5rVMw1rYx5pGpSUFBERERERERGJEpM0FvCHqeGBxAMxxherkEJLGA14I9dLPa++I5FmSElJEREREREREZFoSRgBvoGAp5pCAxhM2kUxDqp
"text/plain": [
"<Figure size 1600x1200 with 4 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"from src.visual import draw_data_2d\n",
"import matplotlib.pyplot as plt\n",
"\n",
"plt.figure(figsize=(16, 12))\n",
"draw_data_2d(irisdf, 0, 1, y, y_names, plt.subplot(2, 2, 1))\n",
"draw_data_2d(irisdf, 2, 3, y, y_names, plt.subplot(2, 2, 2))\n",
"draw_data_2d(irisdf, 0, 2, y, y_names, plt.subplot(2, 2, 3))\n",
"draw_data_2d(irisdf, 1, 3, y, y_names, plt.subplot(2, 2, 4))"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Визуализация данных без понимания их особенностей"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAABSUAAAPdCAYAAAB84A2oAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/GU6VOAAAACXBIWXMAAA9hAAAPYQGoP6dpAAEAAElEQVR4nOzde3wU9b3/8fcmIQloshI0JAqSVCm4RISoaLBcbEUxNt7O6c8boKiIHFDQ1mqsGrDVFK1WPbURaRULWnr04AUPjVLkZsWiBpUYtWoTwDYhSnQDhBDJzu+PlMgm2WR3Mzuzs/t6Ph77eJDZ78z3M98ZZr7fz87FZRiGIQAAAAAAAACwSILdAQAAAAAAAACILyQlAQAAAAAAAFiKpCQAAAAAAAAAS5GUBAAAAAAAAGApkpIAAAAAAAAALEVSEgAAAAAAAIClSEoCAAAAAAAAsBRJSQAAAAAAAACWIikJAAAAAAAAw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un5btTlVJkUeT87JtjAwAAAAAnC+YMZcZZawa25lVjxnLYTzbNae1i8swDMPuIKzU2Ngot9str9er9PR0u8MBbFFeWatZyyrU8T//wd9OyqbkR+UBCwDQhv6M87ENASC2BTPmktTrMteNz9XjG6ojPrYzawxpxnIYz3bN6nYxoy/DMyWBONPqM7RgZVWnA5Wk9mkLVlap1RdXv1cAAAAAgCmCGXPNf+kDzX+p53HZ/Jc+CFjGkLR4Y+eEZMdl9HZsZ9YY0ozlMJ7tmlPbhaQkEGc2Vzf4XcrdkSGp1tuszdUN1gUFAAA
"text/plain": [
"<Figure size 1600x1200 with 4 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"plt.figure(figsize=(16, 12))\n",
"draw_data_2d(irisdf, 0, 1, subplot=plt.subplot(2, 2, 1))\n",
"draw_data_2d(irisdf, 2, 3, subplot=plt.subplot(2, 2, 2))\n",
"draw_data_2d(irisdf, 0, 2, subplot=plt.subplot(2, 2, 3))\n",
"draw_data_2d(irisdf, 1, 3, subplot=plt.subplot(2, 2, 4))"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Иерархическая агломеративная кластеризация"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Также формируется дендрограмма"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAiAAAAGhCAYAAABYjQ/8AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/GU6VOAAAACXBIWXMAAA9hAAAPYQGoP6dpAAAqeUlEQVR4nO3de3RU5b3G8SckZJIICYRbkhIwgAKCAQ8VCHI3gmgpHMCC0opK69EVUKBcmi4UEWustYDnNIBUBdslRdSi6FliFQtU5SIcKOVwCnJRkFxEMAmEMOTynj88mZNhJiGTmbyTSb6ftfZazJ5379/7zryT/bBnZk+YMcYIAADAomb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fr1U/PmzbVlyxbXusOHD+vkyZNKS0sLTI8BAEDI8+kMSEZGhtatW6e3335bLVu2dH2uIy4uTtHR0YqLi9P06dM1Z84cxcfHKzY2VjNnzlRaWhrfgAEAAC4+BZCVK1dKkoYPH+62fs2aNbrvvvskScuWLVOzZs00ceJEOZ1OjR49WitWrAhIZwEAQOPgUwAxxly1TVRUlLKzs5WdnV3nTgEAgMaN34IBAADWEUAAAIB1BBAAAGAdAQQAAFhHAAEAANYRQAAAgHUEEAAAYB0BBAAAWEcAAQAA1hFAAACAdQQQAABgHQEEAABYRwABAADWEUAAAIB1BBAAAGAdAQQAAFhHAAEAANYRQAAAgHUEEAAAYB0BBAAAWEcAAQAA1hFAAACAdQQQAABgHQEEAABYRwABAADWEUA
"text/plain": [
"<Figure size 640x480 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"from src.clusters import get_linkage_matrix, run_agglomerative\n",
"from src.visual import draw_dendrogram\n",
"from scipy.cluster import hierarchy\n",
"\n",
"tree = run_agglomerative(irisdf)\n",
"linkage_matrix = get_linkage_matrix(tree)\n",
"draw_dendrogram(linkage_matrix)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Получение результатов иерархической кластеризации"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Также производится сравнение с реальным разбиением\n",
"\n",
"https://joernhees.de/blog/2015/08/26/scipy-hierarchical-clustering-and-dendrogram-tutorial/"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"array([1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n",
" 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n",
" 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,\n",
" 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,\n",
" 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 3, 2, 2, 2, 2, 3, 2, 2, 2,\n",
" 2, 2, 2, 3, 3, 2, 2, 2, 2, 3, 2, 3, 2, 3, 2, 2, 3, 3, 2, 2, 2, 2,\n",
" 2, 3, 3, 2, 2, 2, 3, 2, 2, 2, 3, 2, 2, 2, 3, 2, 2, 3], dtype=int32)"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n",
" 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n",
" 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n",
" 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n",
" 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,\n",
" 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,\n",
" 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2])"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAABSUAAAd5CAYAAAAKInpDAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/GU6VOAAAACXBIWXMAAA9hAAAPYQGoP6dpAAEAAElEQVR4nOzdd3gUVdsG8PvM7qY3EiD03nv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H5Mj1yGd6+TURERERERERERB7FoiQRERERERERERF5FIuSRERERERERERE5FEsShIREREREREREZFHsShJREREREREREREHsWiJBEREREREREREXkUi5JERERERERERETkUSxKEhERERERERERkUexKElEREREREREREQexaIkEREREREREREReRSLkkRERERERERERORRLEoSERERERERERGRR7EoSURERERERERERB7FoiQRERERERERERF5FIuSRERERERERERE5FEsShIREREREREREZFHsShJREREREREREREHsWiJBEREREREREREXkUi5JERERERERERETkUUZvB0BE3qGqKnb/sx+xxy4iMDQAXYa1R3jFMG+HRURERETlyPljF7Bn9QFoqobm3RqjQdu63g6JiIg8hEVJonJoz+r9eOfej3Hl/FUIRUBqEkaTASMnDcH9M8bCYDB4O0QiIiIiKsNSrqbi7XvmYPuyPYAABASklGjauSGen/8komtX8naIRERUwnj7NlE5c2T7cUwb/CauXkgAAEhNAgCsFhW/zlqCuU9+7cXoiIiIiKiss2Rb8Gz/17Bzxb+2BRKQ0paTHtt1Ek/e+CJSElK9GCEREXkCi5JE5czXL86Hpsm8YmR+UgKLP16BS2cveyEyIiIiIioPNizcipN7z0BTNbt1qlXDldgELPv8Hy9ERkREnsSiJFE5knQ5GbtW7nOYAOYSisCa+Zs8GBURERERlScrv1sHoQin66UmseLrtZ4LiIiIvIJFSaJyJDUhrdA2iiKQciXFA9EQERERUXmUeCnZ4V07+SUzHyUiKvNYlCQqRyKrRMBgdP2xV1UNlTmwOBERERGVkKr1ol3mpEIIRNdhPkpEVNaxKElUjgSHB+OGW7q4TAINRgP6jOnhwaiIiIiIqDwZcn9fqFbnwwlJSAx7sL8HIyIiIm9gUZKonLnvjTsRFBoIxeD44//AjLsQFhXq4aiIiIiIqLxoP6A1ut3UEULYjyupGBQ07tAA/cf19EJkRETkSSxKEpUzVetF48Mtb6FtnxZAvjywUs0oPDPvUdz8xFDvBUdEREREZZ6iKHjh5ydx25QRCAwJyFtu8jdi0H198M4/L8EvwM+LERIRkScIKaXrEYbLmJSUFISHhyM5ORlhYWHeDofIqy6dvYzYE3EIDgtEg3Z1YTAYvB0SERG5gfmM7+NrSGSTmZ6F47tOQVM11G9TB6EVQrwdEhERuUGPXMaoc0xE5EOia1dCNCe1ISIiIiIvCQwOQKsbm3k7DCIi8gLevk1EREREREREREQexaIkEREREREREREReRSLkkRERERERERERORRHFOSSGfZWdk4e+g8hBCo1bQ6Zw4kIiIiIo+SUiL2RBzSEtMQXbsSKkRHeDskIiIiOyxKEunEkm3B968txB8fL0d6cgYAIDg8CCMfG4y7XroFRhM/bkRERERUsrb9uQvznv8Jp/adBQAIIdBleHs8+O441GhY1cvRERER/Ye3bxPpQFVVvHrLTPw047e8giQApCdn4Me3FuHVW96DqqpejJCIiIiIyrrVP23ECyNm4PT+c3nLpJTY9uduPN5lKs4fv+jF6IiIiApiUZJIB5t/34FtS3dBatJunZQSW5fswuY/dnohMiIiIiI
"text/plain": [
"<Figure size 1600x2400 with 8 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"result = hierarchy.fcluster(linkage_matrix, 10, criterion=\"distance\")\n",
"display(result)\n",
"display(y)\n",
"result = [0 if val == 1 else 1 if val == 3 else 2 for val in result]\n",
"\n",
"plt.figure(figsize=(16, 24))\n",
"draw_data_2d(irisdf, 0, 1, result, y_names, plt.subplot(4, 2, 1))\n",
"draw_data_2d(irisdf, 0, 1, y, y_names, plt.subplot(4, 2, 2))\n",
"draw_data_2d(irisdf, 2, 3, result, y_names, plt.subplot(4, 2, 3))\n",
"draw_data_2d(irisdf, 2, 3, y, y_names, plt.subplot(4, 2, 4))\n",
"draw_data_2d(irisdf, 0, 2, result, y_names, plt.subplot(4, 2, 5))\n",
"draw_data_2d(irisdf, 0, 2, y, y_names, plt.subplot(4, 2, 6))\n",
"draw_data_2d(irisdf, 1, 3, result, y_names, plt.subplot(4, 2, 7))\n",
"draw_data_2d(irisdf, 1, 3, y, y_names, plt.subplot(4, 2, 8))"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Неиерархическая четка кластеризация (k-means)"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Cluster 1 (53):\n",
"0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 57, 93, 98\n",
"\n",
"--------\n",
"Cluster 2 (97):\n",
"50, 51, 52, 53, 54, 55, 56, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 94, 95, 96, 97, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149\n",
"\n",
"--------\n"
]
},
{
"data": {
"text/plain": [
"array([[5.00566038, 3.36981132, 1.56037736, 0.29056604],\n",
" [6.30103093, 2.88659794, 4.95876289, 1.69587629]])"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n",
" 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n",
" 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n",
" 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n",
" 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,\n",
" 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,\n",
" 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2])"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"from src.clusters import print_cluster_result, run_kmeans\n",
"\n",
"random_state = 9\n",
"\n",
"labels, centers = run_kmeans(irisdf, 2, random_state)\n",
"print_cluster_result(irisdf, 2, labels)\n",
"display(centers)\n",
"display(y)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Визуализация результатов кластеризации"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAABRIAAAPKCAYAAADoHKbKAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/GU6VOAAAACXBIWXMAAA9hAAAPYQGoP6dpAAD+KElEQVR4nOz9f3xU5Z3//z8niSRQMrPEmh8IG9LWYsegFAtt4op0KxCxILvvivUmoray1g9Uad/fFuNKKaU10r67a11dtOxaqpRaaf0BLkatitom3aDILpjq1pogShLchs4kaEgzc75/HAhMkvmZM+fMmXncb7e56Zx5nXO9znWGmWteOedcHsMwDAEAAAAAAABADHlOJwAAAAAAAAAg81FIBAAAAAAAABAXhUQAAAAAAAAAcVFIBAAAAAAAABAXhUQAAAAAAAAAcVFIBAAAAAAAABAXhUQAAAAAAAAAcVFIBAAAAAAAABAXhUQAAAAAAAAAcVFIBAAAAAAAABBXwWhWvuOOO1RfX6+bb75Zd95554gxmzdv1nXXXRexrLCwUH19fQm3Ew6HdejQIRUXF8vj8YwmZQAAANsZhqGenh5NnDhReXn8HdeNGI8CAAC3s2JMmnIhcffu3brvvvt07rnnxo31er164403Bp8nO/g6dOiQJk+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Gt26WHl0nRfnnVflVq+pfory95wPxvrG0kGmNFESne/iTSTqZsIxs50C9WjGe4RyKQ4UJhQ+t2tA77aJFOftys29GqUDjj/yYAAAAAAJkpHDLPDIv6y8uQmu+O8bqkxlu
"text/plain": [
"<Figure size 1600x1200 with 4 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"from src.visual import draw_cluster_results\n",
"\n",
"plt.figure(figsize=(16, 12))\n",
"draw_cluster_results(irisdf, 0, 1, labels, centers, plt.subplot(2, 2, 1))\n",
"draw_cluster_results(irisdf, 2, 3, labels, centers, plt.subplot(2, 2, 2))\n",
"draw_cluster_results(irisdf, 0, 2, labels, centers, plt.subplot(2, 2, 3))\n",
"draw_cluster_results(irisdf, 1, 3, labels, centers, plt.subplot(2, 2, 4))"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Разбиение на 3 кластера и сравнение с реальным разбиением"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAABSUAAAd5CAYAAAAKInpDAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/GU6VOAAAACXBIWXMAAA9hAAAPYQGoP6dpAAEAAElEQVR4nOzdd3gUVdsG8PvM7KY3EiD03nvvSu9FEBuiKGJHseIn2CtYQLFhecWuKIoKiCDSpHek9xYCIUB635053x+bxIQt2YTJbja5f9eVCzJzZs8z2/LMMzPnCCmlBBEREREREREREZGHKN4OgIiIiIiIiIiIiCoWFiWJiIiIiIiIiIjIo1iUJCIiIiIiIiIiIo9iUZKIiIiIiIiIiIg8ikVJIiIiIiIiIiIi8igWJYmIiIiIiIiIiMijWJQkIiIiIiIiIiIij2JRkoiIiIiIiIiIiDyKRUkiIiIiIiIiIiLyKBYliYiIiIiIiIiIyKNM3g4gz8yZMzFt2jQ88sgjePfddx22+fLLLzFx4s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j+eGf46LDlW6JoOALh8LgHrftmMW54eg0mv3+rlCImIiIioPEtPTsdTA1/Bke3HIRQBqUtcir2Mw9uPY9GHy/D26hcRXpmTThEReRJv3yaiUpWWlI7nRs1ETrYlvyAJAJrV9v/5M3/FuoVbvBUeEREREVUA7z/0OY7tOgkAkLq0/SsBSODMoVjMmjTXi9EREVVMLEoSUala8fVaZKVn5yd/V1JUBb+8s9jDURERERFRRZF4IQmrf9xQ6AR5QbqmY9OS7Th/8oKHIyMiqthYlCSiUrV3/UFAOF+vazoObDoCXXecJBIRERERXY2DW45CtxaRa0pg/4bDngmIiIgAsChJRKVMCBcVSSIiIiKiUuZuPsq8lYjIs1iUJKJS1bZ3S0jp+NZtwHb7dqtezaAo/DoiIiIiIuM179YYqkl12UYIgdbXNPNQREREBLAoSUSlrP9t1yA4PAhCcXzmWdd03PjEKA9HRUREREQVRUSVcAy4/VooquPDX0VV0PP6Lqhap4qHIyMiqthYlCSiUhUcFoRXF09DQJB/oashVZPt/xNevAndR3byVnhEREREVAFMnjMRzbs1BoD84mTeSfMGbevi8U/v91psREQVlcnbARBR+deqZzN8cfg9/PHJCmz4bStysi1o1qURRj04BM27NvZ2eERERERUzgWGBOLtVS/in58348/PV+JizCVE1YjE4Dv7os8tPeHnb/Z2iEREFY6QrgZ7K4dSUlIQHh6O5ORkhIWFeTscIiIiomJjPuP7+BoSERGRLzMil+Ht20RERERERERERORRLEoSERERERERERGRR7EoSURERERERERERB7FoiQRERERERERERF5FIuSRERERERERERE5FEsShIREREREREREZFHsShJREREREREREREHsWiJBEREREREREREXkUi5JERERERERERETkUSxKEhERERERERERkUexKElEREREREREREQexaIkEREREREREREReRSLkkRERERERERERORRLEoSERERERERERGRR7EoSURERERERERERB7FoiQRERERERERERF5FIuSRERERERERERE5FEsShIREREREREREZFHsShJREREREREREREHmXydgBE5B2apmHn33sRe+Q8AkMD0G1ER4RXDvN2WERERERUgZw9cg67Vu2Drulo2aMpGrWv7+2QiIjIQ1iUJKqAdq3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/d8DY0TfNihERERERU3q36YT2eHTUTJ/eeyV8mpcSWP3bi4W7TcPboeS9GR0REVBiLkkQG2PjbNmxZsgNSl3brpJTYvHgHNv6+3QuREREREVF
"text/plain": [
"<Figure size 1600x2400 with 8 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"labels, centers = run_kmeans(irisdf, 3, random_state)\n",
"labels = [2 if val == 1 else 1 if val == 2 else val for val in labels]\n",
"\n",
"plt.figure(figsize=(16, 24))\n",
"draw_data_2d(irisdf, 0, 1, labels, y_names, plt.subplot(4, 2, 1))\n",
"draw_data_2d(irisdf, 0, 1, y, y_names, plt.subplot(4, 2, 2))\n",
"draw_data_2d(irisdf, 2, 3, labels, y_names, plt.subplot(4, 2, 3))\n",
"draw_data_2d(irisdf, 2, 3, y, y_names, plt.subplot(4, 2, 4))\n",
"draw_data_2d(irisdf, 0, 2, labels, y_names, plt.subplot(4, 2, 5))\n",
"draw_data_2d(irisdf, 0, 2, y, y_names, plt.subplot(4, 2, 6))\n",
"draw_data_2d(irisdf, 1, 3, labels, y_names, plt.subplot(4, 2, 7))\n",
"draw_data_2d(irisdf, 1, 3, y, y_names, plt.subplot(4, 2, 8))"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Понижение размерности до n=2"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"array([[-2.68412563, 0.31939725],\n",
" [-2.71414169, -0.17700123],\n",
" [-2.88899057, -0.14494943],\n",
" [-2.74534286, -0.31829898],\n",
" [-2.72871654, 0.32675451],\n",
" [-2.28085963, 0.74133045],\n",
" [-2.82053775, -0.08946138],\n",
" [-2.62614497, 0.16338496],\n",
" [-2.88638273, -0.57831175],\n",
" [-2.6727558 , -0.11377425],\n",
" [-2.50694709, 0.6450689 ],\n",
" [-2.61275523, 0.01472994],\n",
" [-2.78610927, -0.235112 ],\n",
" [-3.22380374, -0.51139459],\n",
" [-2.64475039, 1.17876464],\n",
" [-2.38603903, 1.33806233],\n",
" [-2.62352788, 0.81067951],\n",
" [-2.64829671, 0.31184914],\n",
" [-2.19982032, 0.87283904],\n",
" [-2.5879864 , 0.51356031],\n",
" [-2.31025622, 0.39134594],\n",
" [-2.54370523, 0.43299606],\n",
" [-3.21593942, 0.13346807],\n",
" [-2.30273318, 0.09870885],\n",
" [-2.35575405, -0.03728186],\n",
" [-2.50666891, -0.14601688],\n",
" [-2.46882007, 0.13095149],\n",
" [-2.56231991, 0.36771886],\n",
" [-2.63953472, 0.31203998],\n",
" [-2.63198939, -0.19696122],\n",
" [-2.58739848, -0.20431849],\n",
" [-2.4099325 , 0.41092426],\n",
" [-2.64886233, 0.81336382],\n",
" [-2.59873675, 1.09314576],\n",
" [-2.63692688, -0.12132235],\n",
" [-2.86624165, 0.06936447],\n",
" [-2.62523805, 0.59937002],\n",
" [-2.80068412, 0.26864374],\n",
" [-2.98050204, -0.48795834],\n",
" [-2.59000631, 0.22904384],\n",
" [-2.77010243, 0.26352753],\n",
" [-2.84936871, -0.94096057],\n",
" [-2.99740655, -0.34192606],\n",
" [-2.40561449, 0.18887143],\n",
" [-2.20948924, 0.43666314],\n",
" [-2.71445143, -0.2502082 ],\n",
" [-2.53814826, 0.50377114],\n",
" [-2.83946217, -0.22794557],\n",
" [-2.54308575, 0.57941002],\n",
" [-2.70335978, 0.10770608],\n",
" [ 1.28482569, 0.68516047],\n",
" [ 0.93248853, 0.31833364],\n",
" [ 1.46430232, 0.50426282],\n",
" [ 0.18331772, -0.82795901],\n",
" [ 1.08810326, 0.07459068],\n",
" [ 0.64166908, -0.41824687],\n",
" [ 1.09506066, 0.28346827],\n",
" [-0.74912267, -1.00489096],\n",
" [ 1.04413183, 0.2283619 ],\n",
" [-0.0087454 , -0.72308191],\n",
" [-0.50784088, -1.26597119],\n",
" [ 0.51169856, -0.10398124],\n",
" [ 0.26497651, -0.55003646],\n",
" [ 0.98493451, -0.12481785],\n",
" [-0.17392537, -0.25485421],\n",
" [ 0.92786078, 0.46717949],\n",
" [ 0.66028376, -0.35296967],\n",
" [ 0.23610499, -0.33361077],\n",
" [ 0.94473373, -0.54314555],\n",
" [ 0.04522698, -0.58383438],\n",
" [ 1.11628318, -0.08461685],\n",
" [ 0.35788842, -0.06892503],\n",
" [ 1.29818388, -0.32778731],\n",
" [ 0.92172892, -0.18273779],\n",
" [ 0.71485333, 0.14905594],\n",
" [ 0.90017437, 0.32850447],\n",
" [ 1.33202444, 0.24444088],\n",
" [ 1.55780216, 0.26749545],\n",
" [ 0.81329065, -0.1633503 ],\n",
" [-0.30558378, -0.36826219],\n",
" [-0.06812649, -0.70517213],\n",
" [-0.18962247, -0.68028676],\n",
" [ 0.13642871, -0.31403244],\n",
" [ 1.38002644, -0.42095429],\n",
" [ 0.58800644, -0.48428742],\n",
" [ 0.80685831, 0.19418231],\n",
" [ 1.22069088, 0.40761959],\n",
" [ 0.81509524, -0.37203706],\n",
" [ 0.24595768, -0.2685244 ],\n",
" [ 0.16641322, -0.68192672],\n",
" [ 0.46480029, -0.67071154],\n",
" [ 0.8908152 , -0.03446444],\n",
" [ 0.23054802, -0.40438585],\n",
" [-0.70453176, -1.01224823],\n",
" [ 0.35698149, -0.50491009],\n",
" [ 0.33193448, -0.21265468],\n",
" [ 0.37621565, -0.29321893],\n",
" [ 0.64257601, 0.01773819],\n",
" [-0.90646986, -0.75609337],\n",
" [ 0.29900084, -0.34889781],\n",
" [ 2.53119273, -0.00984911],\n",
" [ 1.41523588, -0.57491635],\n",
" [ 2.61667602, 0.34390315],\n",
" [ 1.97153105, -0.1797279 ],\n",
" [ 2.35000592, -0.04026095],\n",
" [ 3.39703874, 0.55083667],\n",
" [ 0.52123224, -1.19275873],\n",
" [ 2.93258707, 0.3555 ],\n",
" [ 2.32122882, -0.2438315 ],\n",
" [ 2.91675097, 0.78279195],\n",
" [ 1.66177415, 0.24222841],\n",
" [ 1.80340195, -0.21563762],\n",
" [ 2.1655918 , 0.21627559],\n",
" [ 1.34616358, -0.77681835],\n",
" [ 1.58592822, -0.53964071],\n",
" [ 1.90445637, 0.11925069],\n",
" [ 1.94968906, 0.04194326],\n",
" [ 3.48705536, 1.17573933],\n",
" [ 3.79564542, 0.25732297],\n",
" [ 1.30079171, -0.76114964],\n",
" [ 2.42781791, 0.37819601],\n",
" [ 1.19900111, -0.60609153],\n",
" [ 3.49992004, 0.4606741 ],\n",
" [ 1.38876613, -0.20439933],\n",
" [ 2.2754305 , 0.33499061],\n",
" [ 2.61409047, 0.56090136],\n",
" [ 1.25850816, -0.17970479],\n",
" [ 1.29113206, -0.11666865],\n",
" [ 2.12360872, -0.20972948],\n",
" [ 2.38800302, 0.4646398 ],\n",
" [ 2.84167278, 0.37526917],\n",
" [ 3.23067366, 1.37416509],\n",
" [ 2.15943764, -0.21727758],\n",
" [ 1.44416124, -0.14341341],\n",
" [ 1.78129481, -0.49990168],\n",
" [ 3.07649993, 0.68808568],\n",
" [ 2.14424331, 0.1400642 ],\n",
" [ 1.90509815, 0.04930053],\n",
" [ 1.16932634, -0.16499026],\n",
" [ 2.10761114, 0.37228787],\n",
" [ 2.31415471, 0.18365128],\n",
" [ 1.9222678 , 0.40920347],\n",
" [ 1.41523588, -0.57491635],\n",
" [ 2.56301338, 0.2778626 ],\n",
" [ 2.41874618, 0.3047982 ],\n",
" [ 1.94410979, 0.1875323 ],\n",
" [ 1.52716661, -0.37531698],\n",
" [ 1.76434572, 0.07885885],\n",
" [ 1.90094161, 0.11662796],\n",
" [ 1.39018886, -0.28266094]])"
]
},
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"from sklearn.decomposition import PCA\n",
"\n",
"\n",
"reduced_data = PCA(n_components=2).fit_transform(irisdf)\n",
"reduced_data"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Визуализация данных после понижения размерности"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAABSoAAAIRCAYA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WrWLp0KXl5efTo0YNrrrmGtWvX8vjjjwMwdepUevfuzb777ktlZSUPPvggc+fO5Z133onVKYiIiIhIAtN4VERERCRyEipR+emnnzJs2LD6rydNmgTA2WefzaOPPkphYSE///xz/ePV1dVceeWVrF27lqysLPbff39mz57d4BgiIiIiIsHSeFREREQkchK2mU60qPi8iIiIJDqNZxKbvn8iIiKS6IIdz7S6GpUiIiIiIiIiIiISf5SoFBERERERERERkZhTolJERERERERERERiTolKERERERERERERiTklKkVERERERERERCTmlKgUERERERERERGRmFOiUkRERERERERERGIuJdYBiIiIiIiIiIiIJBNrLTgbAAuuzhijuYLBUKJSREREko7HsSxeVcSG0ko6t81gSO883C4T67BEREREJMlZa6HiWWzZg+D52bvRlQ/ZZ0PWORjjjm2AcU6JShEREUkqs5YVMuW15RQWV9ZvK8jNYPK4fozpXxDDyEREREQkmVlrsSU3QcUMYKeb5M46bOltUP0VtPuPZlcGoP8ZERERSRqzlhUyccaSBklKgHXFlUycsYRZywpjFJmIiIiIJL2aT7cnKQHsLg9aqHoTqt6NdlQJRYlKERERSQoexzLlteWNhoSwY5g45bXleBxfe4iIiIiItIwtfxoItLTbjS17MlrhJCQlKkVERCQpLF5V1Ggm5c4sUFhcyeJVRdELSkRERERaj9rvAU+AHTzgWRGtaBKSalRKTKjJgYiIhNuGUv9JylD2E5HktuHnjXz5wTdYx9Lv0D3p1lc1bEVEpIVMG7y1KQOs4DHZ0YomISlRKVGnJgciIhIJndtmhHU/EUlO27aW8Z8LpjH/xY+9nVm3O2jMQP7yyMW079IudsGJiEhCMxnHYms+D7CHCzKOj1o8iUhLvyWq1ORAREQiZUjvPApyM/A3P9/gvTE2pHdeNMMSkThSU13D1aNv4qOXFzdIUgIsmf0lk466gfLSihhFJyIiCS/zN+DqhO86lW4wbTBZZ0Q7qoSiRKVEjZociIhIJLldhsnj+gE0SlbWfT15XD+VGhFpxT58YRHffbISx+M0esxT67B2xTrefuS9GEQmIiLJwLjaYvJmgHu37VtSqF/M7OqIyXsc4+4cq/ASghKVEjVqciAiIpE2pn8B908YTH5uw+Xd+bkZ3D9hsEqMiLRybz/6Hq4ANyustcx6eG4UIxIRkWRjUnphOr6Naf8/yDoLsiZg2t2N6fQeJrVfrMOLe6pRKVGjJgciIhINY/oXMKpfvpq2iUgjmwu34jSxemfL+q3RCUZERJKWMS5IPxqTfnSsQ0k4SlRK1KjJgYiIRIvbZRjap0OswxCRONO5R0fWfLvW59JvAGMMnbp3jHJUIiIiUkdLvyVq1ORARERERGJp7B+G+01SAlgsY/84IooRiYiIyM6UqJSoUZMDEREREYmlQ088iIHD+vusU+lyu+g7sDejzjoyBpGJiIgIKFEpUaYmByIiIiISK+4UNze9djXHnj+SlLQdVbBcKS6GnX4Yt8+ZTHpmegwjFBERad2MtTZwNelWrqSkhNzcXIqLi8nJyYl1OEnD41g1ORAREYkSjWcSm75/kVFSVMo3i1ZgHcteB/WhfZd2sQ5JREQkaQU7nlEzHYkJNTkQERERkVjKyWvLwccOjnUYIiIishMt/RYREREREREREZGYU6JSREREREREREREYk6JShEREREREREREYk5JSpFREREREREREQk5pSoFBERERERERERkZhTolJERERERERERERiTolKERERERERERERiTklKkVERERERERERCTmlKgUERERERERERGRmFOiUkRERERERERERGJOiUoRERERERERERGJOSUqRUREREREREREJOaUqBQREREREREREZGYU6JSREREREQShqfWQ3VldazDEBERkQhIiXUAkjg8jmXxqiI2lFbSuW0GQ3rn4XaZWIclIiISMfrdJxI/Pp/7Fc/e+gpLZn+JtdBtj3xOuvRYxl14DO4Ud6zDExERiQjrlEHlm9jaFWCyMBmjMKn7xjqsiFGiUoIya1khU15bTmFxZf22gtwMJo/rx5j+BTGMTEREJDL0u08kfrz54BzuvGAaLrcLa73bfv1hPfdd9ghLZn/F5BeuVLJSRESSjq18B1v8V7DleFN4Flt2HzbtcEy7uzCutrEOMey09FuaNGtZIRNnLGnwQQ1gXXElE2csYdaywhhFJiIiEhn63ScSPzas2cRdE/8HgONx6rdba7HWsvC1T5j18NxYhSciIhIRtvpT7NY/g63YvqUW8Hj/Wb0Au+VibN3duySiRKUE5HEsU15bjq8f/bptU15bjsdJvjeHiIi0TvrdJxJf3npwTsDHDYaX734rStGIiIhEh912X92/fDzqQM0iqPkimiFFhRKVEtDiVUWNZpPszAKFxZUsXlUUvaBEREQiSL/7ROLLj1+ubjCTclfWWn5evgbH8b+PiIhIIrFOGVR/BAT63ZaCrUy+G3VKVEpAG0r9f1ALZT8REZF4p999IvElLTMNlztwEyt3agrGqNGViIgkCVuJ75mUu+5XFvFQok2JSgmoc9uMsO4nIiIS7/S7TyS+DD3+AByP/w9r7hQXh510kBKVIiKSPFy5YJpqlOPBpOwelXCiSYlKCWhI7zwKcjPwN+wzeDugDumdF82wREREIka/+0Tiy+G/PYT83p1xp/j46GLAWjj1yhOiH5iIiEiEGJMCWacTOG3nhsyTohRR9ChRKQG5XYbJ4/oBNPrAVvf15HH9cLt0B1tERJKDfveJxJe09FRue/cGOvfoBHhnULrcLozLkJqWyt+evpy9Duob4yhFRETCy2RfCCl9aJy6835tcm7EuJLvxrmxydjLPIxKSkrIzc2luLiYnJycWIcTM7OWFTL
"text/plain": [
"<Figure size 1600x600 with 2 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"plt.figure(figsize=(16, 6))\n",
"draw_data_2d(\n",
" pd.DataFrame({\"Column1\": reduced_data[:, 0], \"Column2\": reduced_data[:, 1]}),\n",
" 0,\n",
" 1,\n",
" subplot=plt.subplot(1, 2, 1),\n",
")\n",
"draw_data_2d(\n",
" pd.DataFrame({\"Column1\": reduced_data[:, 0], \"Column2\": reduced_data[:, 1]}),\n",
" 0,\n",
" 1,\n",
" y,\n",
" y_names,\n",
" plt.subplot(1, 2, 2),\n",
")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Визуализация результатов неиерархической кластеризации для двух кластеров с учетом понижения размерности"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGg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pDyeunXriocPH0rbU1NTBQCxZcsWaVtgYKDw8vISjx8/lrbt3btX+oyVx8vLS0RHR6ttV35O09LSxL1798T169fFd999J+rWrSusra3FjRs3hBBCODs7i9atW5f7PCUlJCQIb29v6f3btWuXACBOnjyp0/0BCDMzM3Hu3DmV7aNGjRIeHh7i/v37Ktvj4uKEo6Oj9JmeP3++ACDWrl0r7ZObmysaN26s9j77+PiofIeUSn++vvrqKwFAzJs3T21f5XEeOHBAABCrV69WuX3Hjh0q2+/evSssLCxE7969pfsKIcT7778vAGgsT0mbNm0SAMSsWbOkbQUFBSIkJETte6Lpe75mzRq17/Ts2bMFAHHlyhW1/XX9rVCysLAQf/vb38o8Bqp8bCYwEXfu3IGVlRW8vb31vu/o0aOl/zc3N8err74KIQRGjRolbXdyckKzZs1w+fJladu6devQokULNG/eHPfv35f+Kat+09PTpX2tra2l/8/Ozsb9+/cRGhqKy5cvIzs7W6U8/v7+CAkJkf52dXVVe24nJyecO3cOGRkZeh1rSkoKWrdujf79+6vdZog2RycnJ+Tm5urUXFHa7t27kZWVhcGDB6u8nubm5mjfvr3K66n0t7/9TefHHzRoEJydnaW/la+x8nW9desWfv31VwwbNgx2dnbSfqGhoQgMDNTpOR48eKDyHKV1794drq6u8Pb2RlxcHOzs7LBx40ap5iEnJwf29vY6H1NBQQG+//57DBo0SHr
"text/plain": [
"<Figure size 640x480 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"from src.clusters import fit_kmeans\n",
"from src.visual import draw_clusters\n",
"\n",
"\n",
"kmeans = fit_kmeans(reduced_data, 2, random_state)\n",
"draw_clusters(reduced_data, kmeans)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Визуализация результатов неиерархической кластеризации для трех кластеров с учетом понижения размерности"
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAgMAAAGwCAYAAAA0bWYRAAAAOXRFW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bU2bNhW+vr4iOztb2rZv3z7pPVYaX19f0bdvX7XtyvdpSkqKuH//vrhx44b48ccfRfXq1YW9vb24efOmEEIId3d30bx581Ifp6jx48cLPz8/6fXbvXu3ACBOnTql0/0BCCsrK3H+/HmV7cOHDxc+Pj7iwYMHKtvj4+OFq6ur9J6eM2eOACDWrFkj7ZOTkyPq1aun9jr7+/urfIaUir+/vvvuOwFAzJ49W21f5XkePHhQABArV65UuX3nzp0q2+/duydsbGxEjx49pPsKIcT7778vAGgsT1GbNm0SAMSXX34pbcvPzxdhYWFqnxNNn/PVq1erfaZnzpwpAIgrV66o7a/rd4WSjY2N+Mc//lHiOZDxsZnATNy9exd2dnbw8/PT+74jRoyQ/m1tbY2WLVtCCIHhw4dL293c3NCwYUNcvnxZ2rZ27Vo0btwYjRo1woMHD6T/lFW/qamp0r729vbSvzMzM/HgwQOEh4fj8uXLyMzMVClPUFAQwsLCpL89PDzUHtvNzQ3nz59HWlqaXue6fv16NG/eHL1791a7zRBtjm5ubsjJydGpuaK4PXv2ICMjAwMGDFB5Pq2trdG6dWuV51PpH//4h87H79+/P9zd3aW/lc+x8nm9ffs2fv/9dwwZMgROTk7SfuHh4WjatKlOj/Hw4UOVxyiuc+fO8PDwgJ+fH+Lj4+Hk5ISNGzdKNQ9ZWVlwdnbW+Zzy8/Px008/oX///tL
"text/plain": [
"<Figure size 640x480 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"kmeans = fit_kmeans(reduced_data, 3, random_state)\n",
"draw_clusters(reduced_data, kmeans)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Сравнение результатов кластеризации с реальным разбиением с учетом понижения размерности"
]
},
{
"cell_type": "code",
"execution_count": 13,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAABSoAAAPfCAYAAADAI/cuAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/GU6VOAAAACXBIWXMAAA9hAAAPYQGoP6dpAAEAAElEQVR4nOzdd3xUVfrH8c+5d9IbvRdRQOnYUGyAotgr9t7dtfzsbe26trUrrrr2jgWxYcGCioAoilQpioB0EkhPptzz+2NCICYzCSGZSfm+X68sm3vv3HmG4OSZ55zzHGOttYiIiIiIiIiIiIjEkRPvAERERERERERERERUqBQREREREREREZG4U6FSRERERERERERE4k6FShEREREREREREYk7FSpFREREREREREQk7lSoFBERERERERERkbhToVJERERERERERETiToVKERERERERERERiTsVKkVERERERERERCTuVKgUERERERERERGRuGtUhcpvv/2WI444gk6dOmGMYfz48VGvnzRpEsaYSl+rV6+OTcAiIiIi0qQoHxURERGpP42qUFlYWMigQYMYM2bMVj1uwYIFrFq1qvyrXbt29RShiIiIiDRlykdFRERE6o8v3gFsjUMOOYRDDjlkqx/Xrl07WrRoUavn9DyPlStXkpGRgTGmVvcQERERiSdrLfn5+XTq1AnHaVTj1A2O8lERERGRrVfTfLRRFSpra/DgwZSWltK/f39uu+029t5774jXlpaWUlpaWv79ihUr6Nu3byzCFBEREalXy5cvp0uXLvEOo1lSPioiIiJSfT7apAuVHTt25KmnnmK33XajtLSUZ599luHDh/PDDz+wyy67VPmYe+65h9tvv73S8eXLl5OZmVnfIYuIiIjUuby8PLp27UpGRka8Q2l2lI+KiIiI1DwfNdZaG6OY6pQxhvfee4+jjz56qx43bNgwunXrxiuvvFLl+b+PYG/6i8zNzVViKCIiIo1SXl4eWVlZymfqmPJRERERkZqpaT7apGdUVmXIkCFMnjw54vmkpCSSkpJiGJGIiIiINCfKR0VERESq1uy6qc+cOZOOHTvGOwwRERERaaaUj4qIiIhUrVHNqCwoKGDx4sXl3y9ZsoSZM2fSqlUrunXrxg033MCKFSt4+eWXAXjkkUfo0aMH/fr1o6SkhGeffZavvvqKzz//PF4vQUREREQaMeWjIiIiIvWnURUqf/rpJ0aMGFH+/ZVXXgnAmWeeyYsvvsiqVatYtmxZ+X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9G1yMzb0RAjM3HzRpmLTzIO0fGNN4FkrXNJ9pPK9I4mLyez/w4i1vAoSLlAAWrLXkZedzw8F3EfAH4hihiIhI3bNFr2Pz/lWxSAkQWoLNOQvrnxGfwESaoeKCYm44+N8U5RWXFymhLDe18N8rXuTnL2bFMUIREZG6Z4PLsNknQWD2304UYgsexebfHZ/A6pkKlRLVWw98gONUvcTNC3msX5HDd+/+EOOoRERE6o/1irD590U46wFelPMiUte+en0yeTn5eCGvyvOO6/D2Ax/EOCoREZH6ZQueBFsIhKq+oOgVbHBZTGOKBRUqJaLS4lLmT12I50XuDuD6HH7RCLaIiDQlpV+ALY5ygQeBmdjg0piFJNKczfhiVtTesF7I45evZqOOViIi0lRY64eSD4lYpATAwRa/F6uQYkaFSokoWoFyE2shFGF0W0REpFHy1gFuDa5bW++hiEi4EEk1Rcia5K0iIiKNhpcHVNdmzzTJfFSFSokoJS2Zbn06E21zU8/z6Dt0x9gFJSIiUt+cNkQfvd50Xdt6D0VEoO+evYmWkDqOYachPaPOuhQ
"text/plain": [
"<Figure size 1600x1200 with 3 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"labels = [2 if val == 1 else 1 if val == 2 else val for val in kmeans.labels_]\n",
"\n",
"plt.figure(figsize=(16, 12))\n",
"draw_data_2d(\n",
" pd.DataFrame({\"Column1\": reduced_data[:, 0], \"Column2\": reduced_data[:, 1]}),\n",
" 0,\n",
" 1,\n",
" labels,\n",
" y_names,\n",
" plt.subplot(2, 2, 1),\n",
")\n",
"draw_data_2d(\n",
" pd.DataFrame({\"Column1\": reduced_data[:, 0], \"Column2\": reduced_data[:, 1]}),\n",
" 0,\n",
" 1,\n",
" result,\n",
" y_names,\n",
" plt.subplot(2, 2, 2),\n",
")\n",
"draw_data_2d(\n",
" pd.DataFrame({\"Column1\": reduced_data[:, 0], \"Column2\": reduced_data[:, 1]}),\n",
" 0,\n",
" 1,\n",
" y,\n",
" y_names,\n",
" plt.subplot(2, 2, 3),\n",
")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Выбор количества кластеров на основе инерции\n",
"\n",
"Инерция -- сумма квадратов расстояний выборок до ближайшего центра кластера, взвешенная по весам выборок, если таковые имеются."
]
},
{
"cell_type": "code",
"execution_count": 14,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"range(2, 13)"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"[152.3479517603579,\n",
" 78.85144142614601,\n",
" 57.25600931571815,\n",
" 49.84981451052335,\n",
" 39.03998724608725,\n",
" 35.73675177600178,\n",
" 30.186555194805198,\n",
" 28.74142653983444,\n",
" 26.572328111946536,\n",
" 25.281078256538784,\n",
" 24.845747490899196]"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAArMAAAHUCAYAAAAp/qBkAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/GU6VOAAAACXBIWXMAAA9hAAAPYQGoP6dpAABK2UlEQVR4nO3deVhV5d7/8c8GFBAZhGJSHFJPODQ4lJmzojhkx9TKstTqp08dLac6as9RO08a2tOgNpl2TtZR62RpqQ2KiuNRcqKszNRISUXNAUQFGdbvj/WwdcsgILD23rxf17UuFvdae+0vbi/7tPiu+7YZhmEIAAAAcEEeVhcAAAAAlBVhFgAAAC6LMAsAAACXRZgFAACAyyLMAgAAwGURZgEAAOCyCLMAAABwWYRZAAAAuCzCLAAAAFwWYRaAy1m/fr1sNps+/fRTq0ux69y5szp37mz/3hlrvF5X/4wA4AwIswCcgs1mK9G2fv36Sqvpt99+K7aWGTNmVFot5W3YsGEOP0vNmjV10003aeDAgfrss8+Ul5dndYkAUCJeVhcAAJL0r3/9y+H7Dz/8UPHx8QXGmzRpor1791ZmaXrooYfUu3fvAuMtWrSo1DrKm7e3t9577z1J0sWLF3Xo0CGtWLFCAwcOVOfO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913tWrVKjVt2lQLFy7UkiVLtH79evt5np6e+vLLLzV69Gh98MEH8vDw0H333aepU6eqXbt
"text/plain": [
"<Figure size 800x500 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"from src.clusters import get_clusters_inertia\n",
"from src.visual import draw_elbow_diagram\n",
"\n",
"\n",
"inertias, clusters_range = get_clusters_inertia(irisdf, random_state)\n",
"display(clusters_range)\n",
"display(inertias)\n",
"draw_elbow_diagram(inertias, clusters_range)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Выбор количества кластеров на основе коэффициента силуэта\n",
"\n",
"Коэффициент силуэта рассчитывается с использованием среднего расстояния внутри кластера (а) и среднего расстояния до ближайшего кластера (b) для каждого образца. Коэффициент силуэта для образца равен (b - a) / max(a, b). Для пояснения: b — это расстояние между образцом и ближайшим кластером, частью которого образец не является. Обратите внимание, что коэффициент силуэта определяется только в том случае, если количество меток равно 2 <= n_labels <= n_samples - 1.\n",
"\n",
"Эта функция возвращает средний коэффициент силуэта по всем образцам. \n",
"\n",
"Лучшее значение — 1, худшее — -1. Значения около 0 указывают на перекрывающиеся кластеры. Отрицательные значения обычно указывают на то, что образец был отнесен к неправильному кластеру."
]
},
{
"cell_type": "code",
"execution_count": 15,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"range(2, 13)"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"[0.6810461692117462,\n",
" 0.5528190123564095,\n",
" 0.4974551890173751,\n",
" 0.37267902612312465,\n",
" 0.36483400396700255,\n",
" 0.3177403273169618,\n",
" 0.35745369258527154,\n",
" 0.3357877717812255,\n",
" 0.31153956064328736,\n",
" 0.2897041029666296,\n",
" 0.28314769898585324]"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAArgAAAHUCAYAAADRHluTAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjku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r166dy5cpp27Ztuu6661S+fHndfvvtF3wdAHwHI7gAiq3//Oc/CggI0NChQ5Wenq5nnnlGt99+u1atWuXe55tvvtG1116r2NhYjRkzRgEBAXrjjTf0r3/9S8uWLVObNm3yPX+tWrXkdDr11ltvqW/fvoVWd8+ePVWnTh0lJydr7dq1eu2111S1alVNmDDBvc8999yjWbNmqUePHhoyZIhWrVql5ORkbdy4UR988IHHn3n8+HF16NBBe/fu1f3336+aNWtq+fLlGjlypPbv369JkyapSpUq7qkXN910k7p37y5Jatq0qTIzM7Vv3748p41I0v3336+ZM2cqISFBDz/8sHbs2KEXX3xRP/30k77//vuzjnDffPPN+vXXXzVw4EDVrl1bBw4c0KJFi7Rr1y73Pxpmzpypu+66S40bN9bIkSNVoUIF/fTTT1q4cKFuu+029z4JCQlq3bq1kpOTlZaWpsmTJ+v777/XTz/9pAoVKrg/8+TJk+rcubOuuOIK/fe//1WZMmUu+DoA+BALAHzQgAEDrPz+ilq8eLElybrkkkusrKws9/bJkydbkqwNGzZYlmVZLpfLql+/vtW5c2fL5XK59zt+/LhVp04dq1OnTmetITU11apSpYolyWrYsKH1wAMPWLNnz7aOHDmSa9++fftatWrVyrFNkjVmzBj36zFjxliSrLvuuivHfjfddJNVuXJl9+t169ZZkqx77rknx35Dhw61JFnffPNNvp+RrVatWlbfvn3dr8eNG2eVLVvW2rx5c479RowYYQUGBlq7du2yLMuyDh48mO858/uZLFu2zJJkvfPOOzm2L1y4MM/tp/vrr78sSdazzz6b7z5Hjhyxypcvb8XFxVn/+9//cryX/XM9ceKEVbVqVatJkyY59vn0008tSVZSUpJ7W9++fS1J1ogRIwrtOgD4FqYoACi2EhIScsyDbd++vSRp+/btkqR169Zpy5Ytuu2223T48GEdOnRIhw4dUmZmpq6++mp9++23Z70xLDIyUj///LMeeOAB/fXXX5o2bZpuu+02Va1aVePGjZNlWedV9wMPPJDjdfv27XX48GFlZGRIMjdzSVJiYmKO/YYMGSJJ+uyzzzz+zPfee0/t27dXxYoV3d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z/JzIdcBwLcwggvAbwUEBOi1117Ttddeq8aNGyshIUHVq1fX3r17tXjxYoWFhemTTz7J9/i33npL77zzjm666SbFxsYqKChIGzdu1Ouvv66QkBCNGjWqSOpu1qyZ+vbtq1dffVVHjhxRhw4dtHr1as2aNUvdunXTVVdd5d73nnvu0QMPPKCbb75ZnTp10s8//6wvv/xSEREROc756KOP6uOPP9YNN9ygfv36KTY2VpmZmdqwYYPmz5+vnTt3KiIiQqGhoWrUqJHmzp2rBg0aqFKlSmrSpImaNGmi2NhYSdLDDz+szp07KzAwUL1791aHDh10//33Kzk5WevWrdM111yj0qVLa8uWLXrvvfc0efJk9ejRI89r3bx5s66++mr17NlTjRo1UqlSpfTBBx8oLS1NvXv3lmRG4J9//nndc889at26tW677TZVrFhRP//8s44fP65Zs2apdOnSmjBhghISEtShQwfdeuut7jZhtWvX1iOPPHLO7/uFXAcAH2NvEwcAyFtB2oS99957Obbv2LHDkmS98cYbObb/9NNPVvfu3a3KlStbwcHBVq1atayePXtaKSkpZ61h/fr11qOPPmq1bNnSqlSpklW
"text/plain": [
"<Figure size 800x500 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"from src.clusters import get_clusters_silhouette_scores\n",
"from src.visual import draw_silhouettes_diagram\n",
"\n",
"silhouette_scores, clusters_range = get_clusters_silhouette_scores(irisdf, random_state)\n",
"display(clusters_range)\n",
"display(silhouette_scores)\n",
"draw_silhouettes_diagram(silhouette_scores, clusters_range)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Пример анализа силуэтов для разбиения от 2 до 12 кластеров\n",
"\n",
"max_clusters = int(math.sqrt(len(df)))\n",
"\n",
"https://scikit-learn.org/1.5/auto_examples/cluster/plot_kmeans_silhouette_analysis.html"
]
},
{
"cell_type": "code",
"execution_count": 16,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAABZoAAAKgCAYAAAAS1si3AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/GU6VOAAAACXBIWXMAAA9hAAAPYQGoP6dpAAEAAElEQVR4nOzdd1xT1/8/8FdCQtgblCUgLnChuBc4Ko6666yKqNXWuq2f1g5Xq7baWq1W7fhUq/bTOlq11lX31rr3rIiKC1FBNknO7w9/3C+BAEHGZbyePniY3HXeuSvnvnPuuQohhAARERERERERERER0StSyh0AEREREREREREREZVuTDQTERERERERERERUYEw0UxEREREREREREREBcJEMxEREREREREREREVCBPNRERERERERERERFQgTDQTERERERERERERUYEw0UxEREREREREREREBcJEMxEREREREREREREVCBPNRERERERERERERFQgTDQTUYmzYsUKKBQK6S+z0NBQafiQIUOk4bdv3zaYZ9++fcUbNJVI06dPl/YJX1/fYi17yJAhUtmhoaFFVs7Dhw8REREBT09PqFQqqcyNGzcWWZlU+uV0Li0vcvueofKrpOwXJSWOkqCg66Ksr0s56zlERETGMNFMREXut99+Q1hYGCpUqAC1Wg17e3v4+fkhNDQU48aNw44dO+QOsUQzNYle3hNH5ZEQAm+88QZWrFiB+/fvQ6fTyR0SAGDfvn0G++yKFSsMxj979gyNGjWSxiuVSixdutTovAqFAl27djVazo4dO7JNy32/dCjryR+ikiTrefX27dtyh1QoeB6RHxt6mObcuXOYM2cOOnbsiOrVq8Pe3h4ajQbe3t7o06cPDhw4IHeIRESFRiV3AERUtg0ePBirVq0yGBYfH4/4+Hjcvn0b+/fvR1RUFMLCwqTxDRs2xLx584o7VKJC1a9fP9SqVQsA4O3tXSRl3LlzB4cPH5bev/7662jZsiWUSqVUdkkTExOD1157DefOnQMAKJVK/Pjjj4iIiMhxni1btuDWrVuoXLmywfCFCxcWaaxUdvF7hqh04LFKZcH7779vtGHNvXv3sG7dOqxbtw5ffPEF/vOf/8gQHRFR4WKimYiKzPbt2w2SzMHBwQgLC4ONjQ1iYmJw+vRpHD16NNt8NWvWRM2aNYszVKJC16FDB3To0KFIy4iKijJ4v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WahUqmzTOjs7i2bNmhk9H+SloMdvfuLPSX7PfQU9fpycnIx+T7q6uooNGzYIjUaTbVzW7/as+3GbNm2MxtKwYUOD+XLbLwr7+zMyMlJUrFjR6Prp1KlTjnFMmjQp1/Vrbm4udu7cKU2f1/GWcfy/ePEiz2nbtWsntFptnp9Nr9cLZ2dnab5ffvlFGteiRQtpeIMGDaTh69atk4bb2dlJ5RjbJvk5j2SdP6f64aBBg0zedoV9jGW1ZcsWo8vM+Bs3bpw0bW51zszzZD3mCqOOYkodNcPGjRtzXa6np6e4fPlyjus5p7pIfs9PuTHleyzzX9b1/SouXLhgsMwvv/yywMskIpIbu84goiJTv3596fWTJ09QrVo1BAUFoWHDhggODkbr1q1RpUqVIil7x44daNiwIcLCwrB3716pH9sbN25g48aN6NevHwDgwIEDmDhxotTKsFKlSujfvz8SEhKwfPlyJCUlIS4uDr169cLNmzfh6Oj4yjHpdDr06NFDaiHo6uqKAQMGwMnJCTt27MCRI0eQmpqKwYMHIzg4GJUrV8ZHH32E27dvY/bs2dJy3n77bal7BG9vb3h7e8PGxgZLly7FrVu3AAANGjRA3759pXmcnJwAAIMGDcLZs2cBALa2thgwYAC8vLxw+PBhbN++HXq9HhM
"text/plain": [
"<Figure size 1800x700 with 2 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAABZoAAAKgCAYAAAAS1si3AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/GU6VOAAAACXBIWXMAAA9hAAAPYQGoP6dpAAEAAElEQVR4nOzdd3gUVdsG8Hu2pvcEUiAJCSXUQADpCaCEIggovSuC0hF5FQtNgVewgCBgeQUBP6UoICIgvYP0XiW00FtCenb3fH/EjNlkk2xImZT7d125Mjv1mbpnnj1zRhJCCBARERERERERERERPSOV0gEQERERERERERERUcnGRDMRERERERERERER5QsTzURERERERERERESUL0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7ZlUXyen3KiTXfYxn/Mm/vvEhKShLnzp0TL730ktk8T5069czzJCIqLth0BhEVmnr16sndDx48QJUqVRAaGooGDRogLCwMLVu2RHBwcKEse9OmTWjQoAEiIyOxfft2uR3bS5cuYc2aNejZsycAYNeuXXjrrbfkWoYVK1ZEr169EBcXh0WLFiEhIQExMTF4+eWXcfnyZbi6uj5zTEajEV26dJFrCHp6eqJ3795wc3PDpk2bsG/fPiQnJ6N///4ICwtDpUqV8P777+Pq1auYPn26PJ833nhDbh6hQoUKqFChAhwcHLBgwQJcuXIFAFC/fn306NFDnsbNzQ0A0K9fPxw/fhwA4OjoiN69e8PPzw979+7Fxo0
"text/plain": [
"<Figure size 1800x700 with 2 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAABZoAAAKgCAYAAAAS1si3AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/GU6VOAAAACXBIWXMAAA9hAAAPYQGoP6dpAAEAAElEQVR4nOzdd1xV9f8H8NddXC57iSIoIDjAEYp74UYzzZF7UqalpqlZ2XBV+ksr9aup2dC05Sg1MzX31jT31sSFe4Fs7r2f3x83jly4wEXGucDr+XjcB+ee+T7zfs6bz/kchRBCgIiIiIiIiIiIiIjoGSnlDoCIiIiIiIiIiIiIijcmmomIiIiIiIiIiIgoX5hoJiIiIiIiIiIiIqJ8YaKZiIiIiIiIiIiIiPKFiWYiIiIiIiIiIiIiyhcmmomIiIiIiIiIiIgoX5hoJiIiIiIiIiIiIqJ8YaKZiIiIiIiIiIiIiPKFiWYiIiIiIiIiIiIiyhcmmonI5ixZsgQKhUL6ZNSiRQup/+DBg6X+V65cMZtmx44dRRs02aTJkydLx0RAQECRLnvw4MHSslu0aFFoy7l9+zaioqLg6+sLtVotLXPNmjWFtkwq/rK7lpYWOf3OUOllK8eFrcRhC/K7LUr6tpSznEN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qNGDNmDOrWrYsmTZrkuk5arRYNGzZEWFgYPD094eTkhNjYWGzduhWHDh2CEALjxo1Dr169oNPpskz/4MEDPHr0CAMHDkT58uXxzTffSLVa5syZgw8++AB2dnY
"text/plain": [
"<Figure size 1800x700 with 2 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAABZoAAAKgCAYAAAAS1si3AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/GU6VOAAAACXBIWXMAAA9hAAAPYQGoP6dpAAEAAElEQVR4nOzdd3gUVdvH8e+mbXpIIRCKIfRQQxEEgdAUEEFAqVIVQUFFVF71sQA2HsUCioIVFBvgIzYUpKMgiCJIUYo06T0hvey8f4SM2fSQsim/z157ZXbqPbMzs2funDljMQzDQERERERERERERETkKjk5OgARERERERERERERKduUaBYRERERERERERGRQlGiWUREREREREREREQKRYlmERERERERERERESkUJZpFREREREREREREpFCUaBYRERERERERERGRQlGiWUREREREREREREQKRYlmERERERERERERESkUJZpFREREREREREREpFCUaBaRUmfBggVYLBbznVHnzp3N/qNHjzb7Hz582G6adevWlWzQUipNmzbN3Cdq1apVossePXq0uezOnTsX23JOnTrFmDFjqF69Oi4uLuYyv/zyy2JbppR9OZ1LK4rcfmek4iot+0VpiaM0KOy2KO/b0pHlHBERkewo0Swixe6zzz6jR48eVKlSBVdXV/z8/AgLC6Nz585MmjSJFStWODrEUi2/SfSKnjiqiAzD4LbbbmPBggWcOHGC1NRUR4cEwLp16+z22QULFtgNv3jxIm3atDGHOzk5MXfu3GyntVgs9O3bN9vlrFixIsu42vfLhvKe/BEpTTKfVw8fPuzokIqEziOOp4oe+ZN5O2X3dnFxcXSYIiJFQmczESlWI0eOZOHChXb9oqOjiY6O5vDhw6xfv54jR47Qo0cPc/i1117LzJkzSzpUkSI1ZMgQmjRpAkDNmjWLZRlHjx5l48aN5uebb76Zjh074uTkZC67tDl79iw33HADO3bsAMDJyYl3332XMWPG5DjNsmXLOHjwILVr17brP3v27GKNVcov/c6IlA06VkVERMoWJZpFpNgsX77cLsncqlUrevTogbe3N2fPnmXbtm38/PPPWaZr3LgxjRs3LslQRYpcz5496dmzZ7Eu48iRI3afZ82aRZ06dYp1mUlJSRiGgdVqLfC0p06dolu3buzZswcAZ2dnPvzwQ4YNG5brdDabjTlz5vDKK6+Y/fbt28fy5csLHINUbNHR0fj6+up3RqSM0LEq2SlMWcTRateuzT333JOlv5OTbjYXkfJBZzMRKTY//PCD2V23bl22bNnCc889x2OPPcYrr7zCunXrOHv2LFOmTLGbrqhuhVy6dCnt2rXD09MTf39/Bg4cyD///JPtuL/99hsjR44kLCwMd3d3vL29adKkCQ899BDHjh3LMn6tWrXM+KZNm2Y3LK/28qKjo5kxYwZt27bFz88PNzc3rrnmGkaPHs3u3buzLCcsLMyuX5cuXeza/k1f3vr1681xPvjggxxvk01MTGTOnDl06tSJgIAA3NzcCAkJYeDAgdkm/nOzfft2JkyYQNu2balevToeHh64u7sTGhrK4MGD+emnn7JMk3n7REVFMWXKFEJDQ3Fzc6N27do8//zzGIZR6GVlJzo6Gh8fHzOGt99+O8s4AwcONIf36tXL7P/jjz/Sv39/qlevjpubG97e3tSqVYtevXoxbdo0oqKizHFza6N5586dDB8+nFq1amG1WvHw8OCaa66ha9euPPbYYxw/fjzP9bBYLERGRtr1q1u3brbHTUH378zNsOzatYt+/foRGBiI1Wrlzz//zDO+zI4dO0ZkZKSZZHZ1dWXRokV5JpnTL7zef/99YmNjzf6vv/66uY84OzvnOo/Tp0/zn//8h4iICHx8fHB3d6du3bpMnDiRo0ePZhm/JPfr2NhYnn76aVq2bImPjw+urq4EBwcTERHBXXfdVeBk+tatWxkzZgx169bF09MTb29v6tevz5gxY/j777/znD6vW+xzO/d9/fXX9OzZ02wmydfXlzp16tCvXz9mzJiBzWYzbx/OXIM94zIzz/fHH39kyJAhXHPNNVitVnx9fWn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R7qczn2Zz9vZvePj47Ocq7N7Z5zvf/7zn1zH7dixoxETE2MXY+bhmb/v7OLNKOO2adasmbmvZd4HVq1aZTfdN998Y7i4uGQZNzAw0Gjfvn2254O8FPb4LUj8OSnoua+wx09AQEC2v5OVK1c2li5dalit1izDMv+2Z96Pu3btmm0s1157rd10ue0XRf37eejQIaNq1arZbp+bbropxzgeeuihXLevm5ubsXLlSnP8vI639OP/8uXLeY7bvXt3IyUlJc91s9lsRmBgoDndxx9/bA7r0KGD2b9169Zm/yVLlpj9fX19zeVk950U5DySefqcyocjRozI93dX1MdYZsuWLct2nunvSZMmmePmVubMOE3mY64oyij5KaOm+/LLL3Odb/Xq1Y09e/bkuJ1zKosU9PyUm/z8jmV8Z97eucm4z/r4+BhVqlQxXFxcjKCgIKN79+7GJ598ku95iYiUdmo6Q0SKTcuWLc3uc+fOUb9+fSIiIrj22mtp1aoVXbp0oW7dusWy7BUrVnDttdfSo0cP1q5da7Zju3//fr788kuGDBkCwIYNG3jwwQfNWobXXHMNQ4cOJSYmhvnz5xMXF0dUVBS33norBw4cwN/f/6pjSk1NpX///mYNwcqVKzNs2DACAgJYsWIFmzZtIjExkZEjR9KqVStq167N448/zuHDh3n++efN+dx9991m8wg1a9akZs2aeHt7M3fuXA4ePAhA69atGTx4sDlNQEAAACNGjGD79u0A+Pj4MGzYMGrUqMHGjRtZvnw5NpuNyZMn07p1a66//vo818lqtXLdddcRERFBYGAg3t7eREVFsXr1arZu3YphGDz00EMMHjwYDw+PLNOfP3+eixcvMnL
"text/plain": [
"<Figure size 1800x700 with 2 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAABZoAAAKgCAYAAAAS1si3AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/GU6VOAAAACXBIWXMAAA9hAAAPYQGoP6dpAAEAAElEQVR4nOzd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z0sV66cWLt2rdBqtRbjMv+2Zz6On376aauxNGzY0Gy+7I6Lgv79jI6OFhUqVLC6f5555pks4xg3bly2+1ej0YgtW7bI0+d0vhnP/4cPH+Y4bdu2bUV6enqO26bX64WHh4c834oVK+RxLVq0kIc3aNBAHr569Wp5uLOzs7wea99JXq4jmefPqnw4aNCgXH93BX2OZbZhwwaryzR+xowZI0+bXZnTdJ7M51xBlFFyU0Y1WrduXbbL9fX1FadOncpyP2dVFsnr9Sk7ufkdM/1k3t/ZGTx4sDxfhw4dxJAhQ0SVKlWEVqsVFStWFCNGjBBXr17N9fKIiIozNp1BRIWmXr16cvedO3dQrVo1hIaGomHDhqhfvz5at26NoKCgQln35s2b0bBhQ0RERGDHjh1yO7bnzp3DunXr0LdvXwDA7t278frrr8u1DCtVqoR+/fohPj4eS5YsQWJiImJjY9GjRw+cP38ebm5uTxxTRkYGunXrJtcQLFeuHPr37w93d3ds3rwZe/fuRUpKCgYPHoz69eujSpUqeOedd3Dx4kVMnz5dXs5LL70kN49QsWJFVKxYEY6OjliwYAEuXLgAAGjQoAH69Okjz+Pu7g4AGDR
"text/plain": [
"<Figure size 1800x700 with 2 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAABZoAAAKgCAYAAAAS1si3AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/GU6VOAAAACXBIWXMAAA9hAAAPYQGoP6dpAAEAAElEQVR4nOzdd3wT5R8H8M9lNG3TvaAUKKVllFkoQ2YZQkEE2UtWFUGGbFRcDBUUfgoIAuIAAQdDQRAB2SBLlL1Byip7tXS3yfP7I+RI2rRNadOU9vPmlVdv3/cud5fnvjz3nCSEECAiIiIiIiIiIiIiekoKewdARERERERERERERM82JpqJiIiIiIiIiIiIKE+YaCYiIiIiIiIiIiKiPGGimYiIiIiIiIiIiIjyhIlmIiIi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Rkdi+fbvcju358+exZs0a9OzZEwCwa9cujBkzRq5lWLZsWfTq1Qvx8fFYtGgREhMTERsbiy5duuDChQvw9PR86ph0Oh06deok1xD09fVF79694eXlhU2bNmHv3r1ISUlBv379EB4ejvLly+Pdd9/FpUuXMHXqVHk5r7/+utw8QpkyZVCmTBm4uLhg/vz5uHjxIgCgTp066NGjhzyPl5cXAKBv3744cuQIAMDV1RW9e/dG6dKlsWfPHmzcuBF6vR6jR49GnTp10KhRoxy3SaPR4LnnnkNYWBi8vb3h4uKC2NhYbN26FQcPHoQQAmPHjkWPHj3g5OSUaf579+7hwYMH6NevH0qVKoVvvvlGrtUye/ZsvPf
"text/plain": [
"<Figure size 1800x700 with 2 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAABZoAAAKgCAYAAAAS1si3AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/GU6VOAAAACXBIWXMAAA9hAAAPYQGoP6dpAAEAAElEQVR4nOzdd1wT5x8H8E9CQghhLwVUQHDgKoqjTtxoHXXUPbGOqq3b7tbRVn/VDq1WrR1aR1u1rauuuq2zWvfWilhxL5A98vz+CDkTCBCEEMbn/Xrlxe373uXu8tyX556TCSEEiIiIiIiIiIiIiIiek9zaARARERERERERERFR8cZEMxERERERERERERHlCxPNRERERERERERERJQvTDQTERERERERERERUb4w0UxERERERERERERE+cJEMxERERERERERERHlCxPNRERERERERERERJQvTDQTERERERERERERUb4w0UxERERERERERERE+cJEMxEVOUuXLoVMJpM+hpo3by4NHzx4sDT8+vXrRvPs2bOncIOmImnq1KnSMeHv71+o6x48eLC07ubNm1tsPXfu3EFERAR8fX2hUCikda5bt85i66TiL7traWmR0+8MlV5F5bgoKnEUBfndFyV9X1qznENERGQKE81EZHG//PILwsPDUaZMGSiVSjg7OyMgIADNmzfH2LFjsW3bNmuHWKSZm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Lly8PBwQELFy7EtWvXAAB169ZFr169pHnc3NwAAAMGDMDJkycBAI6Ojuj
"text/plain": [
"<Figure size 1800x700 with 2 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAABZoAAAKgCAYAAAAS1si3AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/GU6VOAAAACXBIWXMAAA9hAAAPYQGoP6dpAAEAAElEQVR4nOzdd3gUVdsG8HtmWzab3iAJEEJCDSVUpQYEBESQIlVaEEFBEUReu4AFPsECgoBYQAGVIqCIgHSQJr1KkwDSOyG97Pn+2Oy4LcmGlE3I/cu1V2anPjs7Mznz5Mw5khBCgIiIiIiIiIiIiIjoAcmuDoCIiIiIiIiIiIiISjYmmomIiIiIiIiIiIgoX5hoJiIiIiIiIiIiIqJ8YaKZiIiIiIiIiIiIiPKFiWYiIiIiIiIiIiIiyhcmmomIiIiIiIiIiIgoX5hoJiIiIiIiIiIiIqJ8YaKZiIiIiIiIiIiIiPKFiWYiIiIiIiIiIiIiyhcmmomo2Jk3bx4kSVJellq2bKmMHzRokDL+3LlzVsts3ry5aIOmYmn8+PHKMVGxYsUi3fagQYOUbbds2bLQtnP16lXExsYiNDQUarVa2eaKFSsKbZtU8mV3LS0tcvo7Q6VXcTkuikscxUF+98XDvi9dWc4hIiJyhIlmIip0P/30E9q1a4cyZcpAo9HA29sb4eHhaNmyJV5++WWsXbvW1SEWa84m0Ut74qg0EkLg6aefxrx583D58mVkZma6OiQAwObNm62O2Xnz5llNv3PnDho1aqRMl2UZs2bNcrisJEno3Lmzw+2sXbvWbl4e+yXDw578ISpObK+r586dc3VIBYLXEddjRQ/nJSYmYtKkSWjQoAE8PT3h5uaGyMhIjBgxAv/++6+rwyMiKjBqVwdARA+3AQMGYP78+Vbj4uPjER8fj3PnzmHLli04f/482rVrp0xv2LAhpkyZUt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rY7zX3/91allu3Tpogx/8cUXQggh7t27Jzw9PZX4LM8Ty+uCEELs2LFDBAQE5Pj5t27darVMUR7XLVu2zHFbvXr1ynFfW5owYYKQJCnbdS1fvlyZN7trqe3+N187zLK79tletx29kpOT7a7Vjl6W633zzTdznLd58+YiISHBKkbb6bbft6N4LVnum9q1ayvHmu0xsH79eqvlVq5cKdRqtd28/v7+okmTJg6vB7nJ7/mbl/izk9drX37PHz8/P4d/JwMDA8Xy5cuFTqezm2b7t932OH7sscccxtKwYUOr5XI6Lgr672dcXJwoW7asw/3zxBNPZBvHmDFjcty/Wq1WrFu3Tpk/t/PNfP7fv38/13nbtGkjMjIycv1sRqNR+Pv7K8stXLhQmdasWTNlfIMGDZTxS5YsUcZ7eXkp23H0neTlOmK7fHblw/79+zv93RX0OWZr1apVDtdpfr388svKvDmVOS2XsT3nCqKM4kwZ1WzFihU5rjc0NFQcP3482/2cXVkkr9ennDjzd8zyZbu/s7Njxw6r5ZYsWWI1PSgoSJnWunVrp9ZJRFScsekMIio09erVU4Zv3ryJKlWqIDo6Gg0bNkT9+vXRqlUrREZGFsq2165di4YNG6Jdu3bYtGmT0o7t6dOnsWLFCvTu3RsAsHXrVrzyyitKLcMKFSqgT58+SEhIwNy5c5GUlIR79+6he/fuOHPmDHx9fR84pszMTHTt2lWpIRgYGIi+ffvCz88Pa9euxY4dO5CamooBAwagfv36qFSpEt566y2cO3cOEydOVNbz/PPPK80jlC9fHuXLl4eHhwdmzZqFs2fPAgAaNGiAXr16Kcv4+fkBAPr374+DBw8CADw9PdG3b1+UK1cO27d
"text/plain": [
"<Figure size 1800x700 with 2 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAABZoAAAKgCAYAAAAS1si3AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/GU6VOAAAACXBIWXMAAA9hAA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GDWlfs9wHNm3aZDbdmjVrhFKptBrX19dXNGrUyOb5ICd5PX5zE789uT335fX48fHxsfk76e/vL1atWiU0Go3VMMvfdsv9+Nlnn7UZS7169cymy26/yO/fz9jYWFGqVCmb2+e5556zG8fo0aOz3b5qtVps3LhRGj+n4814/D969CjHcVu1aiX0en2O62YwGISvr6803bJly6RhTZo0kfrXrVtX6r9y5Uqpv4eHh7QcW99Jbs4jltPbKx/269fP4e8uv48xS2vXrrU5T+N7xIgR0rjZlTlNp7E85vKjjOJIGdVo9erV2c43JCREnDp1yu52tlcWye35KTuO/I6Zvi23d26Yrpu934TJkyebLe/evXvSMIPBIDw8PKRhr7322hPHQkRUWNh0BhHlWe3ataXuu3fvomLFioiKikK9evVQp04dtGjRAhEREQWy7A0bNqBevXpo27Yttm7dKrVje/78eaxevRq9evUCAOzYsQNvvfWWVMuwbNmy6N27NxITE7FgwQIkJycjPj4e3bp1w4ULF+Dt7f3EMWVmZqJLly5SDUF/f3/06dMHPj4+2LBhA3bv3o20tDT0798fderUQfny5fH+++/
"text/plain": [
"<Figure size 1800x700 with 2 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAABZoAAAKgCAYAAAAS1si3AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/GU6VOAAAACXBIWXMAAA9hAAAPYQGoP6dpAAEAAElEQVR4nOzdd3wT9f8H8NdlNt2LlrZAW1r2KlN2QUBABBkyRaCIIKBM+SouhgI/wQGKgDhAwMGQIbJkI1OQDcqQAlL2auluk8/vj5AjSZM2pSMtfT15hF4+t953ubt+7t1PPicJIQSIiIiIiIiIiIiIiB6TwtkBEBEREREREREREVHxxkQzEREREREREREREeUJE81ERERERERERERElCdMNBMRERERERERERFRnjDRTERERERERERERER5wkQzEREREREREREREeUJE81ERERERERERERElCdMNBMRERERERERERFRnjDRTERERERERERERER5wkQzETnNwoULIUmS/DLXokULuXzAgAFy+cWLFy3m2bFjR+EGTUXSxIkT5WMiLCysUNc9YMAAed0tWrQosPVcv34dMTExCAkJgUqlkte5evXqAlsnFX/2rqUlRXa/Z6jkKirHRVGJoyjI67540velM+s5REREucFEMxHlm59//hlt27ZFYGAg1Go1vLy8EB4ejhYtWmDkyJHYtGmTs0Ms0hxNopf0xFFJJITACy+8gIULF+Lq1avQ6/XODgkAsGPHDotjduHChRbj7927hwYNGsjjFQoF5s6da3NeSZLQqVMnm+vZtGlTlml57BcPT3ryh6gosb6uXrx40dkh5QteR5yPDT0ck5GRgc8++wwvvvgiKlWqBIVC4VBjhL///hvvvvsu2rVrB39//2zrVkRERZ3K2QEQ0ZOhX79+WLx4sUVZQkICEhIScPHiRezcuROXLl1C27Zt5fH169fHjBkzCjtUonzVq1cvVK9eHQBQtmzZAlnH5cuXsWfPHvn9c889h2bNmkGhUMjrLmpu3bqFNm3a4NixYwAAhUKBb775BjExMXbnWbduHS5cuIDy5ctblM+aNatAY6UnF3/PEBUPPFfpSZCUlIQxY8bker5NmzZhypQpBRAREVHhY6KZiPJs48aNFknmunXrom3btnB3d8etW7dw+PBh7Nu3L8t81apVQ7Vq1QozVKJ8165dO7Rr165A13Hp0iWL9zNnzkRERESBrjM9PR1CCGi12lzPe/36dbRq1QqnT58GACiVSixatAh9+vTJdj6DwYDZs2fj008/lcvOnj2LjRs35joGKtkSEhLg6enJ3zNExQTPVbIlL3URZ1Gr1ahWrRrq1auHrVu3IjY21qH5fHx8UKdOHURERGD+/PkFHCURUcFh1xlElGe///67PBwZGYkDBw5gypQpGD9+PD799FPs2LEDt27dwrhx4yzmy6+vQq5atQqNGjWCq6srfHx80L17d/z33382p/3rr7/Qr18/hIeHw8XFBe7u7qhevTrGjh2LK1euZJk+LCxMjm/ixIkW43LqLy8hIQHTpk3DU089BS8vL2g0GpQrVw4DBgzAqVOnsqwnPDzcoqxly5YWX7czrW/nzp3yNN9//73dr8mmp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2LVrF8aMGSO3MixXrhx69+6NxMRELFiwAMnJyYiPj0e3bt1w/vx5+Pj4PHZMer0eXbp0kVsIlipVCn369IGvry82bdqEvXv3Ii0tDf369UPdunVRvnx5vPPOO7h48SKmTp0qL+fVV1+Vu0coW7YsypYtC3d3d8ydOxcXLlwAANSrVw89e/aU5/H19QUAvPTSSzh69CgAwMPDA3369EGZMmWwZ88ebNy4EQaDAaN
"text/plain": [
"<Figure size 1800x700 with 2 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAABZoAAAKgCAYAAAAS1si3AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/GU6VOAAAACXBIWXMAAA9hAAAPYQGoP6dpAAEAAElEQVR4nOzdd3wT9f8H8NdlNt2LlrZAKZRRZpnKLAhSEEGGTFlFBEVkyldxASrwExwgCIgDBBwMBUUEZCNTVpmypICUvVq62+Tz+yPkyGqb0pGWvp48Qi6fW++7XC6fe/eTz0lCCAEiIiIiIiIiIiIiokekcHYARERERERERERERFSyMdFMRERERERERERERPnCRDMRERERERERERER5QsTzURERERERERERESUL0w0ExEREREREREREVG+MNFMRERERERERERERPnCRDMRERERERERERER5QsTzURERERERERERESUL0w0ExEREREREREREVG+MNFMRE6zaNEiSJIkP8y1atVKLh80aJBcfuHCBYt5tm3bVrRBU7E0adIk+ZioWLFika570KBB8rpbtWpVaOu5du0aYmJiEBISApVKJa9z9erVhbZOKvmyO5eWFjl9z1DpVVyOi+ISR3GQ333xuO9LZ9ZziIiI8oKJZiIqMD/99BOio6MRGBgItVoNLy8vhIWFoVWrVhg1ahQ2bNjg7BCLNUeT6KU9cVQaCSHw/PPPY9GiRbhy5Qr0er2zQwIAbNu2zeKYXbRokcX4u3fvonHjxvJ4hUKBefPm2Z1XkiR07tzZ7no2bNhgMy2P/ZLhcU/+EBUn1ufVCxcuOD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NnDhRHhcaGmox7syZM6JixYrZrkur1Yrly5fbXY+9R1RUlMX6snvExcUJIYS4ceOGiIyMzHY6hUIhZs6c6dD7JIQQs2fPznG9kiSJhQsXZrt//Pz8REREhN1533333QJdl/l78eqrr8rljRo1spgnKSlJuLq6yuNN78emTZuEUqnMMYZ//vlHXs7AgQMt3ieTEydOWCzf3mPdunW57vvc3nOTRzm+zT9n9erVE25ubhbzHD58OMfYtm7dajH9xIkTRVhYmMVx/ttvvzk0b5cuXeThL774QgghREJCgvDw8JDjM/+cmJ8XhBBi9+7dwt/fP8ft37Fjh8U8RXlct2rVKsd19erVK8d9bW7y5MlCkqRsl7Vq1Sp52uzOpdb733TuMMnu3Gd93rb3SE1NtTlX23uYL/ett97KcdoWLVqIpKQkixitx1u/3/biNWe+b+rUqSMfa9bHwKZNmyzmW7NmjVCpVDbT+vn5iaZNm9o9H+Qmv5/fvMSfnbye+/L7+fH19bX7PVmmTBmxatUqodVqbcZZf7dbH8dPPfWU3VgaNWpkMV9Ox0VBf3/GxcWJsmXL2t0/zzzzTLZxjBs3Lsf9q9FoxMaNG+Xpc/u8mT7/9+/fz3Xatm3biqysrFy3zWAwCD8/P3m+77//Xh7XvHlzubxhw4Zy+YoVK+RyT09PeT323pO8nEes58+ufti/f3+H37uC/oxZW7t2rd1lmh6jRo2Sp82pzmk+j/VnriDqKI7UUU1Wr16d43JDQkLEyZMns93P2dVF8np+yokj32PmD+v9nRfm25aX7wQT6/PArVu3HjkWIqKiwq4ziCjf6tevLw/funULVatWRWRkJBo1aoQGDRqgdevWCA8PL5R1b9iwAY0aNUJ0dDS2bt0q92N79uxZrF69Gr179wYA7NixA2PHjpVbGVaoUAF9+vRBUlISFi5ciJSUFCQkJKB79+44d+4cfHx8HjkmvV6Prl27yi0Ey5Qpg759+8LX1xcbNmzA7t27kZ6ejgEDBqBBgwaoVKkS3n77bVy
"text/plain": [
"<Figure size 1800x700 with 2 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"from src.clusters import get_clusters_silhouettes\n",
"from src.visual import draw_silhouettes\n",
"\n",
"\n",
"silhouettes = get_clusters_silhouettes(reduced_data, random_state)\n",
"draw_silhouettes(reduced_data, silhouettes)"
]
}
],
"metadata": {
"kernelspec": {
"display_name": ".venv",
"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.7"
}
},
"nbformat": 4,
"nbformat_minor": 2
}