You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
628 lines
820 KiB
628 lines
820 KiB
2 years ago
|
{
|
||
|
"cells": [
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"___\n",
|
||
|
"\n",
|
||
|
"<a href='http://www.pieriandata.com'><img src='../Pierian_Data_Logo.png'/></a>\n",
|
||
|
"___\n",
|
||
|
"<center><em>Copyright by Pierian Data Inc.</em></center>\n",
|
||
|
"<center><em>For more information, visit us at <a href='http://www.pieriandata.com'>www.pieriandata.com</a></em></center>"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"# Introduction to DBSCAN\n",
|
||
|
"\n",
|
||
|
"\n",
|
||
|
"Let's briefly explore visually the differences between DBSCAN and other clustering techniques, such as K-Means Clustering."
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"## DBSCAN and Clustering Examples"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 1,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"import numpy as np\n",
|
||
|
"import pandas as pd\n",
|
||
|
"import matplotlib.pyplot as plt\n",
|
||
|
"import seaborn as sns"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 2,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"blobs = pd.read_csv('../DATA/cluster_blobs.csv')"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 3,
|
||
|
"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>X1</th>\n",
|
||
|
" <th>X2</th>\n",
|
||
|
" </tr>\n",
|
||
|
" </thead>\n",
|
||
|
" <tbody>\n",
|
||
|
" <tr>\n",
|
||
|
" <th>0</th>\n",
|
||
|
" <td>4.645333</td>\n",
|
||
|
" <td>6.822294</td>\n",
|
||
|
" </tr>\n",
|
||
|
" <tr>\n",
|
||
|
" <th>1</th>\n",
|
||
|
" <td>4.784032</td>\n",
|
||
|
" <td>6.422883</td>\n",
|
||
|
" </tr>\n",
|
||
|
" <tr>\n",
|
||
|
" <th>2</th>\n",
|
||
|
" <td>-5.851786</td>\n",
|
||
|
" <td>5.774331</td>\n",
|
||
|
" </tr>\n",
|
||
|
" <tr>\n",
|
||
|
" <th>3</th>\n",
|
||
|
" <td>-7.459592</td>\n",
|
||
|
" <td>6.456415</td>\n",
|
||
|
" </tr>\n",
|
||
|
" <tr>\n",
|
||
|
" <th>4</th>\n",
|
||
|
" <td>4.918911</td>\n",
|
||
|
" <td>6.961479</td>\n",
|
||
|
" </tr>\n",
|
||
|
" </tbody>\n",
|
||
|
"</table>\n",
|
||
|
"</div>"
|
||
|
],
|
||
|
"text/plain": [
|
||
|
" X1 X2\n",
|
||
|
"0 4.645333 6.822294\n",
|
||
|
"1 4.784032 6.422883\n",
|
||
|
"2 -5.851786 5.774331\n",
|
||
|
"3 -7.459592 6.456415\n",
|
||
|
"4 4.918911 6.961479"
|
||
|
]
|
||
|
},
|
||
|
"execution_count": 3,
|
||
|
"metadata": {},
|
||
|
"output_type": "execute_result"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"blobs.head()"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 4,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"text/plain": [
|
||
|
"<AxesSubplot:xlabel='X1', ylabel='X2'>"
|
||
|
]
|
||
|
},
|
||
|
"execution_count": 4,
|
||
|
"metadata": {},
|
||
|
"output_type": "execute_result"
|
||
|
},
|
||
|
{
|
||
|
"data": {
|
||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAZYAAAEGCAYAAABGnrPVAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8vihELAAAACXBIWXMAAAsTAAALEwEAmpwYAABl0ElEQVR4nO29eXxU1d34/z4zWSZ7QkIWE5IYkrCEnYjoA7QSpWijqKCofWi12Dy2RWjt4lLRutSKWqyIVlG7+bSKLa5UUQT9gd9H1KDsW0IgITEbScg2mSwz5/fHzL3McicEyQrn/XrxInPvmXtPbu69n/PZhZQShUKhUCh6C9NAT0ChUCgUZxdKsCgUCoWiV1GCRaFQKBS9ihIsCoVCoehVlGBRKBQKRa8SMNAT6E/i4uJkenr6QE9DoVAohhTbt28/LqUc3tPx55RgSU9Pp7CwcKCnoVAoFEMKIUTp6YxXpjCFQqFQ9CpKsCgUCoWiV1GCRaFQKBS9ihIsCoVCoehVBlSwCCH+LISoEULscds2TAixUQhR5Po/xs93f+AaUySE+EH/zVqhUCgU3THQGstfgble2+4CNkkps4BNrs8eCCGGAfcDFwLTgPv9CSCFQnHu4nBISmpb+PTwcUpqW3A4BnfR3aE2X38MaLixlHKLECLda/M84Nuun/8GfAzc6TXmO8BGKWU9gBBiI04B9UpfzVWhUAwtHA7Jhr1V3PHaD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eBJhNdXQ4CAkxUN9korWvTI9U0Ou12H81OVTdW9Bgj04DRDdTWeTK+Xnvg1haWER9h8TFRabH7gWZxWsEAY5MifB6qtNgQQgLNfHr4OKFBAT6F+7yFoL9jzxmTQFmDVQm
|
||
|
"text/plain": [
|
||
|
"<Figure size 432x288 with 1 Axes>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {
|
||
|
"needs_background": "light"
|
||
|
},
|
||
|
"output_type": "display_data"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"sns.scatterplot(data=blobs,x='X1',y='X2')"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 5,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"moons = pd.read_csv('../DATA/cluster_moons.csv')"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 6,
|
||
|
"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>X1</th>\n",
|
||
|
" <th>X2</th>\n",
|
||
|
" </tr>\n",
|
||
|
" </thead>\n",
|
||
|
" <tbody>\n",
|
||
|
" <tr>\n",
|
||
|
" <th>0</th>\n",
|
||
|
" <td>0.674362</td>\n",
|
||
|
" <td>-0.444625</td>\n",
|
||
|
" </tr>\n",
|
||
|
" <tr>\n",
|
||
|
" <th>1</th>\n",
|
||
|
" <td>1.547129</td>\n",
|
||
|
" <td>-0.239796</td>\n",
|
||
|
" </tr>\n",
|
||
|
" <tr>\n",
|
||
|
" <th>2</th>\n",
|
||
|
" <td>1.601930</td>\n",
|
||
|
" <td>-0.230792</td>\n",
|
||
|
" </tr>\n",
|
||
|
" <tr>\n",
|
||
|
" <th>3</th>\n",
|
||
|
" <td>0.014563</td>\n",
|
||
|
" <td>0.449752</td>\n",
|
||
|
" </tr>\n",
|
||
|
" <tr>\n",
|
||
|
" <th>4</th>\n",
|
||
|
" <td>1.503476</td>\n",
|
||
|
" <td>-0.389164</td>\n",
|
||
|
" </tr>\n",
|
||
|
" </tbody>\n",
|
||
|
"</table>\n",
|
||
|
"</div>"
|
||
|
],
|
||
|
"text/plain": [
|
||
|
" X1 X2\n",
|
||
|
"0 0.674362 -0.444625\n",
|
||
|
"1 1.547129 -0.239796\n",
|
||
|
"2 1.601930 -0.230792\n",
|
||
|
"3 0.014563 0.449752\n",
|
||
|
"4 1.503476 -0.389164"
|
||
|
]
|
||
|
},
|
||
|
"execution_count": 6,
|
||
|
"metadata": {},
|
||
|
"output_type": "execute_result"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"moons.head()"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 23,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"text/plain": [
|
||
|
"<AxesSubplot:xlabel='X1', ylabel='X2'>"
|
||
|
]
|
||
|
},
|
||
|
"execution_count": 23,
|
||
|
"metadata": {},
|
||
|
"output_type": "execute_result"
|
||
|
},
|
||
|
{
|
||
|
"data": {
|
||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAZAAAAEGCAYAAABLgMOSAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMiwgaHR0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ryKwsJpozAbBRVNnbQ4XKTFRunraaXH8uvpo9nf6YwYdC8rziJQF7Krx637Wg3tPYySwXfJacJpv5dWFGWZoigliqKUpKWl9fdwTkoiKeRmJkTrBqpjLL51R1aiLSjQ7FWIWPex+NoxzCs9mMVUnJWg+9qK4vu/w6k/AX/x7QHu+scGvF6fSysj3qp73uCkaBJsJm44P5fnPvUF8Z/9pIobzs+lpauHu1dsYvbL6/hmTxvxVjNPTBtFjNWkO6adTZ3c9Y8NGBAsmFoUFHSfOymf18prMRrA4K+AB7BF6b/Wlr1trNrSgNvtPSpVYonkZORkNyB1wOCA37P9xyIdlxwlkeTS3W4viTYTD4dMmA9PLWJQQhS5KdF8u78rbPLWmzRzU2KIt5o4KzeJX11dxB0X51Pf5mReaXAG1IKpRRRnJ3DHxflaDUnoaynKwV3GzyYPR1EU5pXmkZlgDTovMcbCzobOsN3J4tUVuDxK0O9V+7uIs5pJiTGHjWnupHxeX1+Ls9fLr1Zt58xUG/NK87njkgKemD4agwFmlmRzVm4SqTEWXl9fC8Cf1u7ioSsKdY3NwlXb+Ofm+qBr/s7GvTKjS3LKcbK7sN4G5gghXsEXRG9TFKVeCPEv4DEhhOpMngzc21+DPFXQqxo/lMTHog92MOs/zmTZ9WfR7nRjNhh4+qMKdjZ18ttrxpAcYwly6ax
|
||
|
"text/plain": [
|
||
|
"<Figure size 432x288 with 1 Axes>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {
|
||
|
"needs_background": "light"
|
||
|
},
|
||
|
"output_type": "display_data"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"sns.scatterplot(data=moons,x='X1',y='X2')"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 8,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"circles = pd.read_csv('../DATA/cluster_circles.csv')"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 9,
|
||
|
"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>X1</th>\n",
|
||
|
" <th>X2</th>\n",
|
||
|
" </tr>\n",
|
||
|
" </thead>\n",
|
||
|
" <tbody>\n",
|
||
|
" <tr>\n",
|
||
|
" <th>0</th>\n",
|
||
|
" <td>-0.348677</td>\n",
|
||
|
" <td>0.010157</td>\n",
|
||
|
" </tr>\n",
|
||
|
" <tr>\n",
|
||
|
" <th>1</th>\n",
|
||
|
" <td>-0.176587</td>\n",
|
||
|
" <td>-0.954283</td>\n",
|
||
|
" </tr>\n",
|
||
|
" <tr>\n",
|
||
|
" <th>2</th>\n",
|
||
|
" <td>0.301703</td>\n",
|
||
|
" <td>-0.113045</td>\n",
|
||
|
" </tr>\n",
|
||
|
" <tr>\n",
|
||
|
" <th>3</th>\n",
|
||
|
" <td>-0.782889</td>\n",
|
||
|
" <td>-0.719468</td>\n",
|
||
|
" </tr>\n",
|
||
|
" <tr>\n",
|
||
|
" <th>4</th>\n",
|
||
|
" <td>-0.733280</td>\n",
|
||
|
" <td>-0.757354</td>\n",
|
||
|
" </tr>\n",
|
||
|
" </tbody>\n",
|
||
|
"</table>\n",
|
||
|
"</div>"
|
||
|
],
|
||
|
"text/plain": [
|
||
|
" X1 X2\n",
|
||
|
"0 -0.348677 0.010157\n",
|
||
|
"1 -0.176587 -0.954283\n",
|
||
|
"2 0.301703 -0.113045\n",
|
||
|
"3 -0.782889 -0.719468\n",
|
||
|
"4 -0.733280 -0.757354"
|
||
|
]
|
||
|
},
|
||
|
"execution_count": 9,
|
||
|
"metadata": {},
|
||
|
"output_type": "execute_result"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"circles.head()"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 10,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"text/plain": [
|
||
|
"<AxesSubplot:xlabel='X1', ylabel='X2'>"
|
||
|
]
|
||
|
},
|
||
|
"execution_count": 10,
|
||
|
"metadata": {},
|
||
|
"output_type": "execute_result"
|
||
|
},
|
||
|
{
|
||
|
"data": {
|
||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAYoAAAEGCAYAAAB7DNKzAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8vihELAAAACXBIWXMAAAsTAAALEwEAmpwYAACXKUlEQVR4nO2deXwU9f3/X5+9skc2yWZDDhISCElIyEmIin4JVYIUbRTktLbYWjRfWzEo2qJWpIoXarEitpZKrdJWwXqCSFHQH/JV1IDcV0IgISEXm3uP7DHz+2Mzk5mdmSVgSEL4PB8PH5LNZnd2dubz/ryv15uwLAsKhUKhUJRQDfQBUCgUCmVwQw0FhUKhUIJCDQWFQqFQgkINBYVCoVCCQg0FhUKhUIKiGegD6GuioqLYkSNHDvRhUCgUyiXF7t27z7IsO0zud0POUIwcORJlZWUDfRgUCoVySUEIqVL6HQ09USgUCiUo1FBQKBQKJSjUUFAoFAolKNRQUCgUCiUo1FBQKBQKJShDruqJQhnqMAyLUzY7GtpdiAnTY6TVBJWKDPRhUYYw1FBQKJcQDMNiy6F6LN6wFy4PA71WhZVz8zAtM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hhm27FGpMeGYfVt47Dw39/zzX0AZHMZK+fmITZMDxYs5hQkSD7H0g8P8ol0bpe+/q4JEqOw60QTXv35eOypbgHD+s/zvIJErC+rxqz8eFH1VGVTJ3aeOAuGlffuXF4Ga3dWSsphgynecjmkQGP32peVNAQ1iBjoqqefnuP3LIB7+ulwKBcRTkOpvl3aufzy9nKUTBotSow+dUs2gFO88bgiKRJXjYzESKsR89bsEv396Wb
|
||
|
"text/plain": [
|
||
|
"<Figure size 432x288 with 1 Axes>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {
|
||
|
"needs_background": "light"
|
||
|
},
|
||
|
"output_type": "display_data"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"sns.scatterplot(data=circles,x='X1',y='X2')"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"## Label Discovery"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 11,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"def display_categories(model,data):\n",
|
||
|
" labels = model.fit_predict(data)\n",
|
||
|
" sns.scatterplot(data=data,x='X1',y='X2',hue=labels,palette='Set1')"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"## Kmeans Results"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 12,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"from sklearn.cluster import KMeans\n",
|
||
|
"model = KMeans(n_clusters = 2)"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 27,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgA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FWURQH7Ge/ADwPzAIcwKWiKG7s2XcJ8Neero+KovjOoRn18YPT7WPe1iZeXliG3e1jxqAELp+Uhcvjp6TJglEtJyCKXDEpCwHosntYXd7OnSf1Y3R2NN+sr8Pp8fc655aaLqwuHxqFhBMGJFDbYceglmNxekN9TilKoqnbxfM/lZAdpydKp2RbXTe58XoqWmzUtNsRRbh9Zj4LdzQToVUwuyiJr9c3IJUImDRykiI0DE41IZFIKG60gACZsTqc3j3jcfsCvPBzKffP7o8oBoMUp/SP5/KJmbi9uzP57nECiDWoeOrHXaHt2nYHz80t5txRaShkEvonGwEBf0BEJhFYXdHBz9saMaoVjMmNJjfBQFJEeMYS5tjhcM9A3gZeAN79lf0zgZyePyOBl4GRgiBEAg8BwwAR2CAIwreiKHb9ynnC/AE2VHXyxPc7Q9s/bG5Ep5KxrrKTylYb/zy7kB83N6KUS/H5RSbkxTBtQDz3fhq0PZwzKpVWs7vXOZMjNfxS3IrLK3LnxxsZnR3DPacUsLykjep2O2Nzo0mN0lLZYuXaqTlsq+tGq5Rx2rBkVpe3U91m4+m5JQCo5FLOHZ1KZoyOdZWdxJtUPDRnAJ02NwqZFI9P5JGv98yO5m5u5JEzB7FwewsLelyBZVKBFquLVeXt/GVWPx78fCt2d9Cecv6YdOTl7ZQ1W4FgQOS+bKzu4rwx6RQ3WWkyO/l5axNWl5/Thyfz5Pd7xGbhjmZuOiGXaQMS0KvDHlxhjg0Oq4CIorhUEIT
|
||
|
"text/plain": [
|
||
|
"<Figure size 432x288 with 1 Axes>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {
|
||
|
"needs_background": "light"
|
||
|
},
|
||
|
"output_type": "display_data"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"display_categories(model,moons)"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 14,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"image/png": "iVBORw0K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jyopCU/RFnyrV6NISkR35BQ6HnkM8zVX4xMCz4oVKKIi0c86He3oUfgrK/E31KOMjUX06YPj888x9u1LxN134Zw3D1V+PqqkJNquux7JGVyZ+WsuRZ2VFZynVovru+9D92Z79bXgtcrL8ZWXo+rTB9N112B7/MlQn4g770DTty8Aks+H7ZXXcHwwB4BAYyOt/76C2M8+QTtixP79QR1CZGHpwTR0OClvsKMQgqx4I7HmA5tWQkbmj6IZMICIh/4HSiWq5OTf3Lra+UG6U1QA/Dt24Pj0UzTDC1BmZWE47lgCra1IgQDKuDgkhQLXt9+iGToE66uv4122DHQ6Iu64HcPMmSgMBjT9+kG/fvgaG/F9VYYwGLDMno23pATTf67F8f4c9EdPRzdjBqrMDJyff4F3xQr0M2fimrcAz7p1RL/wHDHvvI1z/nzc8+Zjvu5aFElJEAggDIagsGg0KHZZkSiio0CpDDkHSFYrHffdT+TTT2G+9VZUkRH4R41EO6wAf309yowMNIMGhp5PoLEJxyefdHtO3qKtaEeMwLulCNfChQQaG9EeMRnNsGEHPJ3MgUAWlkPEtgYbxbXBPED5yRay4sJdNcsbbNz4/hoarC4m5MeTGWtk2qAkUqONB32uPn+AqhYHbl+A5Eg9Zn1333+Zfw7e8nJsTz+D4/MvUGVkEHHv3aj69MG/fQfCaECdnY3QaICgLcG7tajbGP7tO+hY8B2W2dfTeuVVodUBajVRTz5O+/MvgFpNxJ134E1PQxEfj+PDj1H374922DACXi+etWtxzl+AdsxoIlJ
|
||
|
"text/plain": [
|
||
|
"<Figure size 432x288 with 1 Axes>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {
|
||
|
"needs_background": "light"
|
||
|
},
|
||
|
"output_type": "display_data"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"model = KMeans(n_clusters = 3)\n",
|
||
|
"display_categories(model,blobs)"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 25,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|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mNq2AD3+AlRIwHG1puyYwfOB+5H9/kQHQ4C380hsnkzUrdu6LqOun8/mj+AlJUVz/v4h3GqVxTvAy8DH/7C+xcC9cv/6wC8Vv7/OP9ipGqV/RFS9eoIKcZTs66qCJIUfU85cICiQYNR9+wFIPjtdziG3kTCkMGUPTUqZpzI5s1YL+wJQMKgQQS//hrr+ecjpqaiFRVF+8nZdVD3GY5oS9czMTVqiJiWhvWiC1GKilD27EVISABVRbBaSbhhCJ4Xxxv7zSYTrnuHI2fXQdm9JzpmcN58LB3aE1q0CPXwEbTi4krXqRYVYevdG2XPHvyfz8RutUaNRHScb7/D2aDBsevfsQPPpEm4Hn8MuXyrR3K5kCpsX+mqivedd2NPpmkEvv6ayJYtYLGAIED5zT+ydSumZk3xTJiI7623ARBcLlz3Die0eg1qheuKzmP3bgKfz0QrKQHAec/daIEAmt+Pf8ZnuJ8ehe73Y+7ckaRnn8NUv16lMeKcnpzSqCdd1xcBlX8tx7gU+FA3WAYkCYIQj937l2Nq1NBw6JXvkwsJCSSPfxHtSAElDz5EYb/++GbMQC0sBIy98qNG4ii+d99DLSmJ+iQqIqal4hrxAOGNG5EbNwarFdfDD2Hu0AGsVizndMcxaBD+zz7H0rUrYkYGnnHPUzZiJCW33YHkSkRuUB/7ZX1wXDWAxGdG4Zn00jGnZCSC+/kXsPXpE3NeqUoVwuvWU3LbHQQ+n4mt3GBFkWWkqlUJr1+PVK0atkt7I5QXl7EPvBbnfffivPsuXCMfQEhKjDk0tGo1kS1bf/VzFUSpcqMk4Rh4Lc4778B5950kTRiPWKMGcmY1Ips3R40
|
||
|
"text/plain": [
|
||
|
"<Figure size 432x288 with 1 Axes>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {
|
||
|
"needs_background": "light"
|
||
|
},
|
||
|
"output_type": "display_data"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"model = KMeans(n_clusters = 2)\n",
|
||
|
"display_categories(model,circles)"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"## DBSCAN Results"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 16,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"from sklearn.cluster import DBSCAN"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 17,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"model = DBSCAN(eps=0.6)"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 18,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAZYAAAEGCAYAAABGnrPVAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8vihELAAAACXBIWXMAAAsTAAALEwEAmpwYAACcZklEQVR4nOydd5hU1d3HP3d6n22zvfddFnaBpXcFLNh77zWamG6qSUzTNE2i0dduYuyKFREriNSlLrC99zJbpvf7/jHLwLCAJSCg9+Pjw8655577m9nZ+73nnF8RRFFEQkJCQkLiSCE71gZISEhISHy9kIRFQkJCQuKIIgmLhISEhMQRRRIWCQkJCYkjiiQsEhISEhJHFMWxNuCrJCEhQczOzj7WZkhISEicUGzZsmVQFEXL5+3/jRKW7OxsqqqqjrUZEhISEicUgiC0fZH+0lKYhISEhMQRRRIWCQkJCYkjiiQsEhISEhJHFElYJCQkJCSOKMdUWARBeEIQhH5BEHbt1xYnCMJ7giA0jP0be4hzrx7r0yAIwtVfndUSEhISEofjWM9YngJOPaDtJ8AHoigWAB+MvY5CEIQ44FfADGA68KtDCZCEhMQ3F6vdy4bGQT7Y1UNDr41Q6PhNuit6vXi3bMX5wou4V60i0NN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Z4iZyTNJN2awIH0hKYaUr9zWYChIj7MbX9BHkj4ZvVL/2SdJfG3xt7Tg+Mc/cb32OoqsLMy//Q2KkhKCbe0Ieh3K3FwElSrcNxiiqc8xboyuYTef1PVz46J8fvVKdWR2oJAL3HXuRP6ztgWFXOCOU4pIjdURb1SzYns3RclGJmbG4g8E2dN
|
||
|
"text/plain": [
|
||
|
"<Figure size 432x288 with 1 Axes>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {
|
||
|
"needs_background": "light"
|
||
|
},
|
||
|
"output_type": "display_data"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"display_categories(model,blobs)"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 28,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAABRMAAAMECAYAAAAsPLIwAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8vihELAAAACXBIWXMAABcSAAAXEgFnn9JSAAEAAElEQVR4nOzdd3hUZdrH8e+Znt4TSKdDQu9VFDsCKth7r6uudXVf17Wsu65rXV17LygKoiKKighIDb2EGkJ6723qOef9Y0hMyEwyuCKu3p/r8mKdOefMM5PJOvzmvp9b0XUdIYQQQgghhBBCCCGE6I7hWC9ACCGEEEIIIYQQQgjxv0HCRCGEEEIIIYQQQgghREAkTBRCCCGEEEIIIYQQQgREwkQhhBBCCCGEEEIIIURAJEwUQgghhBBCCCGEEEIERMJEIYQQQgghhBBCCCFEQCRMFEIIIYQQQgghhBBCBETCRCGEEEIIIYQQQgghREAkTBRCCCGEEEIIIYQQQgREwkQhhBBCCCGEEEIIIURAJEwUQgghhBBCCCGEEEIERMJEIYQQQgghhBBCCCFEQCRMFEIIIYQQQgghhBBCBMR0rBcgjj5FUcqAYKDwWK9FCCGE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fZlyWEEEL8irQ4Pby9MpdXvz/QIUhs5fRo/PubfXyyoYAWV+ehI8eCoigsyCoM6NgDFU0U17Z0ul3XdZocbhodbpocbrTD9josrbOTX9Xc6bzDpcYE0+hw41ZVThnSM6A1WU0GpgyID+hYIYQQQgghxC9HKhOFEEKIbrhUjXdWHez2uJeX5XDW6JR
|
||
|
"text/plain": [
|
||
|
"<Figure size 1500x900 with 1 Axes>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {
|
||
|
"needs_background": "light"
|
||
|
},
|
||
|
"output_type": "display_data"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"model = DBSCAN(eps=0.15)\n",
|
||
|
"plt.figure(figsize=(10,6),dpi=150)\n",
|
||
|
"display_categories(model,moons)"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 20,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAYoAAAEGCAYAAAB7DNKzAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8vihELAAAACXBIWXMAAAsTAAALEwEAmpwYAADwwklEQVR4nOyddZxU9frH32fOdM92d8Eu3SAtgoVgoF7s9urVa1zreu3Wn3VtvXa3GAgCUiLdtb2w3bvTfX5/zDIwLDYC6rxfL18yJ77nO7Mz5znfJz6PIEkSUaJEiRIlyg8hO9wTiBIlSpQoRzZRQxElSpQoUX6UqKGIEiVKlCg/StRQRIkSJUqUHyVqKKJEiRIlyo8iP9wTONjExcVJWVlZh3saUaJEifKHYt26dW2SJMUfaN+fzlBkZWWxdu3awz2NKFGiRPlDIQjCrh/aF3U9RYkSJUqUHyVqKKJEiRIlyo8SNRRRokSJEuVH+dPFKKJEiRLlcOHz+airq8Ptdh/uqfwgarWatLQ0FArFzz4naiiiRIkS5SBRV1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b5sB8gPdaiU3LZ5Dx2NnSTl2hAJZdxxZQCBmaaUclljMqL47ThGczd1MDwnFhi9SpeWFTBg59v57YPN6NXi2TH65jaP5npg1O5/rg+vLK0KhxE9gckXvy2gqn9Ir+qcQYV2+u7ue2jzXy9uZEJfRIi9osygXijih0NVhKMaqb0S0Iuhn6iM4emcfHEPM4fn8Nlk/Mx7RfD2FzXRUWz/Uc/V9kBfu2iEBr7/HE5nD8+h9tmlpBiVpNgVFPWZA0bCQjpTH2
|
||
|
"text/plain": [
|
||
|
"<Figure size 432x288 with 1 Axes>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {
|
||
|
"needs_background": "light"
|
||
|
},
|
||
|
"output_type": "display_data"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"display_categories(model,circles)"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"Let's further explore DBSCAN Hyperparameters!"
|
||
|
]
|
||
|
}
|
||
|
],
|
||
|
"metadata": {
|
||
|
"anaconda-cloud": {},
|
||
|
"kernelspec": {
|
||
|
"display_name": "Python 3",
|
||
|
"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.8.5"
|
||
|
}
|
||
|
},
|
||
|
"nbformat": 4,
|
||
|
"nbformat_minor": 1
|
||
|
}
|