{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Activity 3 - Clustering\n", "\n", "In this example we show a method of k-means clustering. The idea is that we inform the system of how many clusters we want (e.g., 3). The system generates k random points that we use as our group centroids. For each point in our data, we then see which group the point is closest to, and we assign it to that group. Once we have considered all points, we then update the position of the centroid, so that it is at the mean of the selected points. We then repeat this process, of measuring distance to the centroids and updating our centroids. We do this until the centroids are positioned such that they no longer move (i.e., we have found our clusters)." ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "import matplotlib.pyplot as plt\n", "import numpy as np\n", "import pandas as pd\n", "import seaborn as sns" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Generate some sample data" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "" ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" }, { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAWoAAAD4CAYAAADFAawfAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjMsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+AADFEAAAgAElEQVR4nO2dX4hsyV3Hv7/u7SHpeyOB3lXW7Ha3gggSQpK9rEIkhFwj67oY8ck4hjwEBjoGIkEkOqDkYRBfJE8+XDRLQrcJYgxKFGPQFRPUJHOT3SSbNWGJMzfXjexmRXSZh93slA8zfben51Sd+nuqzjnfDxz27nSfc+p0/epbv/rVr+qIUgqEEELKZZC7AIQQQsxQqAkhpHAo1IQQUjgUakIIKRwKNSGEFM5dKS569913q/l8nuLShBDSSW7evPl9pdQ9VZ8lEer5fI7Dw8MUlyaEkE4iIse6zxj6IISQwqFQE0JI4VCoCSGkcCjUhBBSOBRqQggpHAo1IYQUDoW6haxWK8zncwwGA8znc6xWq9xFIsQL2rIdFOoKSjae1WqFvb09HB8fQymF4+Nj7O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JeuIyJXAXwKwG8qpf43d3lioZR6WSn1RgD3AXhQRDoRuhKRRwA8q5S6mbssiXiLUurNAH4BwG+chx+DoFCfcRvA/Rv/fx+AZzKVhThwHr/9FICVUuovc5cnBUqp/wHwTwAeylyUWLwFwC+dx3I/CeDtIrLMW6R4KKWeOf/vswA+jbPQahAU6jO+DOAnROTHRGQHwK8C+OvMZSI1nE+4/SmAp5RSf5S7PDERkXtE5LXn/341gJ8D8O95SxUHpdTvKKXuU0rNcdbW/lEp9euZixUFEblyPrENEbkC4OcBBGdcUagBKKV+AOD9AD6LswmpP1dKPZm3VHEQkU8A+FcAPykit0XkvbnLFJG3AHg3zjyyx8+Ph3MXKhL3AnhMRL6GM0fic0qpTqWxdZQfAfAFEXkCwJcA/I1S6u9CL8r0PEIIKRx61IQQUjgUakIIKRwKNSGEFA6FmhBCCodCTQghhUOhJoSQwqFQE0JI4fw/ikChNcWCtnkAAAAASUVORK5CYII=\n", "text/plain": [ "
" ] }, "metadata": { "needs_background": "light" }, "output_type": "display_data" } ], "source": [ "# We will define three clusters where we know the \"ground truth\" of how the data was constructed\n", "\n", "cluster1 = np.random.normal(0.0,0.5,[100,2])\n", "cluster1[:,0] = cluster1[:,0] + 1.0\n", "cluster1[:,1] = cluster1[:,1] + 1.0\n", "\n", "cluster2 = np.random.normal(0.0,0.6,[100,2])\n", "cluster2[:,0] = cluster2[:,0] + 1.0\n", "cluster2[:,1] = cluster2[:,1] + 4.0\n", "\n", "cluster3 = np.random.normal(0.0,0.7,[100,2])\n", "cluster3[:,0] = cluster3[:,0] + 3.5\n", "cluster3[:,1] = cluster3[:,1] + 3.5\n", "\n", "# We will then stack this data together so that it 'appears' all together\n", "\n", "all_data = np.vstack([cluster1, cluster2, cluster3])\n", "plt.scatter(all_data[:,0], all_data[:,1], color='k')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Defining ***k***\n", "\n", "***k*** is the number of clusters that we wish to discover. We may either know ***k***, or have some expectation of ***k*** - or, we may have to try different values of ***k*** to see how the results compare.\n", "\n", "For our example, we will say that ***k*** = 3" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "k = 3" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Generate ***k*** initial centroid points\n", "\n", "Here we essentially generate ***k*** randomised centroid points - i.e., a random value of x and a random value of y, for each of our centroid points." ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "array([[4.47517996, 4.4403502 ],\n", " [3.79748152, 3.7095377 ],\n", " [2.57755496, 1.4314328 ]])" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "def generate_initial_points(k):\n", " centroids = []\n", " for i in range(k):\n", " c = [1+np.random.random()*4, 1+np.random.random()*4]\n", " centroids.append(c)\n", " centroids = np.array(centroids)\n", " return centroids\n", "\n", "centroids = generate_initial_points(k)\n", "centroids" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Plotting our data\n", "\n", "We can use a scatter plot to show all of our data, along with the ***k*** centroid points." ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" }, { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAWoAAAD4CAYAAADFAawfAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjMsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+AADFEAAAgAElEQVR4nO2dX4wkx13HvzVzM7LnzijK2CATe2ZAQkgoipJ4ZZCCoiiH8WEsEiFFIixWHiKtNCHSoQihwEpc8rBCvJA88XCCWIlnSIQIESgQQgRGJAKS7Dl2EsckssLu5XCQHSME1j7Y8RQPu3PXO9tVXX+7qru/H6l1tzPT3dXdv/rWr371q2ohpQQhhJB86aUuACGEED0UakIIyRwKNSGEZA6Fm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wjxrBDig6nLEwohxMeEEM8LIb6ZuiyhEULcK4R4XAjxjBDiaSHE5dRlCoUQ4jYhxFeEEE+dXNuHU5cpNEKIvhDia0KIz6YuS0iEEAdCiG8IIZ4UQgRZ75kxahwbDIDvAHgAwA0AXwXwbinlt5IWLABCiLcCeAnAJ6SUr09dnpAIIe4GcLeU8gkhxB0ArgF4Z0uemwBwXkr5khBiAOBLAC5LKf8tcdGCIYT4AIAtAD8ipXw4dXlCIYQ4ALAlpQw2mYce9TH3A3hWSvldKeXLAD4F4B2JyxQEKeU/A/jv1OWIgZTy+1LKJ07+/38AngHwurSlCoM85qWTPwcnW2u8KiHEPQB+GcCfpC5LE6BQH/M6AN8r/H0DLanwXUEIMQPwJgBfTluScJyEBp4E8DyAL0gpW3NtAD4K4HcArFIXJAISwN8LIa4JIXZCHJBCfYwo+aw13kvbEUJcAPBpAL8lpfzf1OUJhZTyVSnlGwHcA+B+IUQrQldCiIcBPC+lvJa6LJF4i5TyzQB+CcBvnoQfvaBQH3MDwL2Fv+8B8FyishALTuK3nwawlFL+ZeryxEBK+T8A/gnApcRFCcVbAPzKSSz3UwDeLoRYpC1SOKSUz538+zyAz+A4tOoFhfqYrwL4KSHETwghhgB+DcBfJy4TqeBkwO1PATwjpfyj1OUJiRDiLiHEa07+fzuAXwDw72lLFQYp5e9KKe+RUs5wXNf+UUr5G4mLFQQhxPmTgW0IIc4D+EUA3hlXFGoAUsofAng/gM/jeEDqz6WUT6ctVRiEEJ8E8K8AfloIcUMI8d7UZQrIWwA8gmOP7MmT7aHUhQrE3QAeF0J8HceOxBeklK1KY2spPwbgS0KIpwB8BcDfSCn/zvegTM8jhJDMoUdNCCGZQ6EmhJDMoVATQkjmUKgJISRzKNSEEJI5FGpCCMkcCjUhhGTO/wNGqTqjC1v4HAAAAABJRU5ErkJggg==\n", "text/plain": [ "
" ] }, "metadata": { "needs_background": "light" }, "output_type": "display_data" } ], "source": [ "plt.scatter(all_data[:,0], all_data[:,1], color='k')\n", "plt.scatter(centroids[0,0], centroids[0,1], marker='x', color='r')\n", "plt.scatter(centroids[1,0], centroids[1,1], marker='x', color='g')\n", "plt.scatter(centroids[2,0], centroids[2,1], marker='x', color='b')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## First pass of the algorithm\n", "\n", "Here, we will assess each point in the data by measuring the distance between each point and each of the ***k*** centroids. We assign each data point to a class as denoted by the group colour." ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" }, { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAWoAAAD4CAYAAADFAawfAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjMsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+AADFEAAAgAElEQVR4nO2dbYwd13nf/89e7lq7fFN4SQSC5b0bQEKBoHQdc+F8kGGkVppYlB07+mRhSRBWgAXJJFjJKBQ3+0FUmw1afSjFNmFY1nXCaC9iFDAVRxYd1aBlJAIa20tXIq04rYyYS6s2KnEZUWTIltTu0w93Zzl37jkz58ycM3Nm7vMDLsi9d+7cM3fu/Oc5z9shZoYgCIIQLiNVD0AQBEFIR4RaEAQhcESoBUEQAkeEWhAEIXBEqAVBEAJnk4+d7ty5k6empnzsWhAEoZGcO3fuMjPvUr3mRainpqawtLTkY9eCIAiNhIiWda+J60MQBCFwRKgFQRACR4RaEAQhcESoBUEQAkeEWhAEIXBEqAVBEAJHhLqmdC90MfXsFEaeHsHUs1PoXuhWPSRBEDwhQp1CqGLYvdDF7AuzWL66DAZj+eoyZl+YDWZ8gmBMtwtMTQEjI71/u/IbViFCrSFkMZw/O48bt2/0PXfj9g3Mn52vaESCkINuF5idBZaXAebev7OzItYKRKg1hCyGl65esnpeEIJkfh640X+N4caN3vNCHyLUGkIWw8ntk1bPC0KQXN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54h4ALxPRefSMiG8wc6NS2RrIzwJ4hYheA/AdAC8y818W3amk5wmCIASOWNSCIAiBI0ItCIIQOCLUgiAIgSNCLQiCEDgi1IIgCIEjQi0IghA4ItSCIAiB8/8BOuE4ICBe3hYAAAAASUVORK5CYII=\n", "text/plain": [ "
" ] }, "metadata": { "needs_background": "light" }, "output_type": "display_data" } ], "source": [ "group1 = []\n", "group2 = []\n", "group3 = []\n", " \n", "def find_groups(centroids, all_data):\n", " group1 = []\n", " group2 = []\n", " group3 = []\n", " for i in range(all_data.shape[0]):\n", " distance1 = np.sqrt(np.abs(all_data[i, 0] - centroids[0,0]) ** 2 + np.abs(all_data[i, 1] - centroids[0,1]) ** 2)\n", " distance2 = np.sqrt(np.abs(all_data[i, 0] - centroids[1,0]) ** 2 + np.abs(all_data[i, 1] - centroids[1,1]) ** 2)\n", " distance3 = np.sqrt(np.abs(all_data[i, 0] - centroids[2,0]) ** 2 + np.abs(all_data[i, 1] - centroids[2,1]) ** 2)\n", " distances = [distance1, distance2, distance3]\n", " #print (distances)\n", " if np.argmin(distances) == 0:\n", " group1.append([all_data[i, 0], all_data[i, 1]])\n", " elif np.argmin(distances) == 1:\n", " group2.append([all_data[i, 0], all_data[i, 1]])\n", " elif np.argmin(distances) == 2:\n", " group3.append([all_data[i, 0], all_data[i, 1]])\n", " group1 = np.array(group1)\n", " group2 = np.array(group2)\n", " group3 = np.array(group3)\n", " return group1, group2, group3\n", " \n", "group1, group2, group3 = find_groups(centroids, all_data)\n", "\n", "#print (\"group 1:\", group1)\n", "#print (\"group 2:\", group2)\n", "#print (\"group 3:\", group3)\n", "\n", "plt.scatter(group1[:,0], group1[:,1], color='r')\n", "plt.scatter(group2[:,0], group2[:,1], color='g')\n", "plt.scatter(group3[:,0], group3[:,1], color='b')\n", "\n", "plt.scatter(centroids[0,0], centroids[0,1], marker='x', color='r')\n", "plt.scatter(centroids[1,0], centroids[1,1], marker='x', color='g')\n", "plt.scatter(centroids[2,0], centroids[2,1], marker='x', color='b')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Update our centroids\n", "\n", "Now that the data has been labelled against potential grroup membership, we update each centroid position, based on the mean values denoted by the data in each group." ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAWoAAAD4CAYAAADFAawfAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjMsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+AADFEAAAgAElEQVR4nO2df4wc53nfv88t76w7UqTCJREIlm/PiIkCQeg45sH5Q4bRRmlk0Xbs+C8LR4KwAhxIJsFZRqGkOaCiUlyQ6o9SbBOGZV0nDG8Ro4CpOLaoqAYtQxWQ2D66EmnHaeXGPFm1UYnHiBLBQ0ndPf1jb46zs/O+874z7zvzzuzzARbk7c7OvrOz853nfX69xMwQBEEQwmWk6gEIgiAIekSoBUEQAkeEWhAEIXBEqAVBEAJHhFoQBCFwtvjY6a5du3hqasrHrgVBEBrJxYsXrzLz7rTXvAj11NQUlpaWfOxaEAShkRDRsuo1cX0IgiAEjgi1IAhC4IhQC4IgBI4ItSAIQuCIUAuCIASOCLUgCELgiFDXlO7lLqaemsLIEyOYemoK3cvdqockCIInRKg1hCqG3ctdzH51FsvXl8FgLF9fxuxXZ4MZnyAY0+0CU1PAyEjv3678htMQoVYQshjOX5jHzds3+567efsm5i/MVzQiQchBtwvMzgLLywBz79/ZWRHrFESoFYQshq9ef9XqeUEIkvl54Gb/NYabN3vPC32IUCsIWQwnd0xaPS8IQfKq4lpSPT/EiFArCFkMFx5YwMToRN9zE6MTWHhgwWo/ofrghSFhUnEtqZ4fYkSoFbgSQx/M7J3B6U+cRmdHBwRCZ0cHpz9xGjN7Z4z3EbIPXnBMqAG7hQVgov8aw8RE73mhD/KxuO309DQ3oXte93IX8xfm8er1VzG5YxILDy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ItCIIQOP8fs4uhnxIk/cEAAAAASUVORK5CYII=\n", "text/plain": [ "
" ] }, "metadata": { "needs_background": "light" }, "output_type": "display_data" } ], "source": [ "centroids = np.array([np.mean(group1, axis=0), np.mean(group2, axis=0), np.mean(group3, axis=0)])\n", "\n", "plt.scatter(group1[:,0], group1[:,1], color='r')\n", "plt.scatter(group2[:,0], group2[:,1], color='g')\n", "plt.scatter(group3[:,0], group3[:,1], color='b')\n", "\n", "plt.scatter(centroids[0,0], centroids[0,1], marker='x', color='r')\n", "plt.scatter(centroids[1,0], centroids[1,1], marker='x', color='g')\n", "plt.scatter(centroids[2,0], centroids[2,1], marker='x', color='b')\n", "\n", "plt.show()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Second pass of the algorithm\n", "\n", "Here, we repeat ourselves - for each point in the data, find which k marker is closest. If we are not at our optimal solution yet then this should give a different result to the one observed in our first pass." ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAWoAAAD4CAYAAADFAawfAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjMsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+AADFEAAAgAElEQVR4nO2df2wd13Xnv4ePZEzallw9CYUbh48BaixQxPllItmuscE27taxkjaJF+g2SxFctwBhqQVoBUH2B4G1HYBAWxQr64/KWiEbQys+NAi20rautc0GTgJvijYJlbWlpOlugoZ03QSwJdU/VAmRTJ79YzjivOG9d+7M3DtzZ975AA8SH+fN3Hl87ztnzvnec4mZIQiCIITLSN0DEARBEMyIUAuCIASOCLUgCELgiFALgiAEjgi1IAhC4Iz62OnevXt5enrax64FQRBayblz5y4y8z7V77wI9fT0NFZXV33sWhAEoZUQ0brud5L6EARBCBwRakEQhMARoRYEQQgcEWpBEITAEaEWBEEIHBFqQRCEwBGhFgRB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rYjoYwBeYeZzdY/FE/cx8/sBPAjgt7fSjqUQoR7kZQDvSPx8F4Af1zQWwZKt/O0fA+gz8+m6x+MDZn4NwNcBfKTmobjgPgC/tpXL/SKADxPRSr1Dcgcz/3jr31cAnEGUUi2FCPUg3wZwNxG9k4jGAfwGgD+teUyCga2C238F8H1m/s91j8clRLSPiO7Y+v8EgF8G8Df1jqo8zPwfmPkuZp5G9B37KjMfqHlYTiCiW7eK2iCiWwH8CoDSTisR6gTM/BaA3wHwZURFqS8x8/fqHZUbiOiPAPwlgH9CRC8T0W/VPSZH3AdgDlFU9sLWY3/dg3LEnQC+RkTnEQURX2HmVlnZWsjPAvgGEb0I4FsAnmXmPy+7U7HnCYIgBI5E1IIgCIEjQi0IghA4ItSCIAiBI0ItCIIQOCLUgiAIgSNCLQiCEDgi1IIgCIHz/wHW8U959Y/P+gAAAABJRU5ErkJggg==\n", "text/plain": [ "
" ] }, "metadata": { "needs_background": "light" }, "output_type": "display_data" } ], "source": [ "all_data = np.vstack([group1, group2, group3])\n", "group1, group2, group3 = find_groups(centroids, all_data)\n", "\n", "plt.scatter(group1[:,0], group1[:,1], color='r')\n", "plt.scatter(group2[:,0], group2[:,1], color='g')\n", "plt.scatter(group3[:,0], group3[:,1], color='b')\n", "\n", "plt.scatter(centroids[0,0], centroids[0,1], marker='x', color='r')\n", "plt.scatter(centroids[1,0], centroids[1,1], marker='x', color='g')\n", "plt.scatter(centroids[2,0], centroids[2,1], marker='x', color='b')\n", "\n", "plt.show()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Update our centroids\n", "\n", "Just as we did earlier, we update our centroids again. By now you should be able to see the updating cycle - for each data point find which k marker is closest, and then update the k marker position based on the group membership." ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAWoAAAD4CAYAAADFAawfAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29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2YKIriOibxLRC1vn9mDVY7IJEbWJ6P8Q0Z9XPRabENEqEZ0joueJyMoq35KjjkBEbQD/D8C/BfAygG8B+BQz/22lA7MAEX0YwCUAX2Tmd1c9HlsQ0U0AbmLmbxPRLgBnAXyiIX8zAnA9M18iomEAzwJYYOZvVDw0KxDRpwFMAtjNzB+vejy2IKJVAJPMbG0ij0TU/XwQwPeZ+e+Z+QqALwG4u+IxWYGZ/wrAxarHYRtm/jEzf3vr/28CeAnAO6sdlR044NLWj8Nbj0ZEVkR0M4C7AHyh6rHUARHqft4J4IeRn19GQ770gwARTQB4P4Dnqh2JPbbSA88DeAXA15i5Kef2EIDPAtiseiAOYAD/i4jOEtGcjR2KUPdDiucaEcE0HSK6AcCfAriXmd+oejy2YOYNZn4fgJsBfJCIap+2IqKPA3iFmc9WPRZH3M7MHwBwJ4Df2Uo7FkKEup+XAdwS+flmAD+qaCyCIVv52z8F0GPm01WPxwXM/BqAvwTwsYqHYoPbAfzqVi73SwA+QkTL1Q7JHsz8o61/XwHwOIKUaiFEqPv5FoADRPQuIhoB8OsAvlLxmIQEtgpufwzgJWb+71WPxyZEtJ+Ibtz6/yiAXwLwd9WOqjjM/F+Y+WZmnkDwHfs6Mx+seFhWIKLrt4raIKLrAfwygMJOKxHqCMz8NoDfBfAUgqLUl5n5u9WOyg5E9CcA/gbAzxLRy0T0W1WPyRK3A5hBEJU9v/WYqnpQlrgJwDNE9CKCIOJrzNwoK1sD+WkAzxLRCwC+CeBJZv6LojsVe54gCILnSEQtCILgOSLUgiAIniNCLQiC4Dki1IIgCJ4jQi0IguA5ItSCIAieI0ItCILgOf8fRIVrnDLlOs4AAAAASUVORK5CYII=\n", "text/plain": [ "
" ] }, "metadata": { "needs_background": "light" }, "output_type": "display_data" } ], "source": [ "centroids = np.array([np.mean(group1, axis=0), np.mean(group2, axis=0), np.mean(group3, axis=0)])\n", "\n", "plt.scatter(group1[:,0], group1[:,1], color='r')\n", "plt.scatter(group2[:,0], group2[:,1], color='g')\n", "plt.scatter(group3[:,0], group3[:,1], color='b')\n", "\n", "plt.scatter(centroids[0,0], centroids[0,1], marker='x', color='r')\n", "plt.scatter(centroids[1,0], centroids[1,1], marker='x', color='g')\n", "plt.scatter(centroids[2,0], centroids[2,1], marker='x', color='b')\n", "\n", "plt.show()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Third pass of the algorithm\n", "\n", "We run a third pass of the algorithm, however at this point, we would likely have converged to a solution. Nevertheless, the run the algorithm again to validate this (essentially to check that the update distance of each k marker is zero - i.e., they do not move again)." ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAWoAAAD4CAYAAADFAawfAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjMsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+AADFEAAAgAElEQVR4nO2dbWwd13nn/w8vyZiUJbu6EgojNi8L1Fi0iJsXE8kWBoLduFvHSlon/lC0oAmiLUpIbAHaQRF0IaC2AxDYXSxW1oeVZTVrQxEvGiy29m4SK/UGjosixcYJlbWtpO5uglZU3ASwRNUvWqmRTD77YTji3OE5Z87MnDNzZu7zAy4kXs6dOXN573+eeV6JmSEIgiCEy0jdCxAEQRDMiFALgiAEjgi1IAhC4IhQC4IgBI4ItSAIQuCM+tjpvn37eHp62seuBUEQWsmZM2cuMvN+1e+8CPX09DRWV1d97FoQBKGVENGa7nfi+hAEQQgcEWpBEITAEaEWBEEIHBFqQRCEwBGhFgRBCBwRakEQhMARoRYEQQgcEeqG0j/bx/QT0xh5fATTT0yjf7Zf95IEQfCECLWBUMWwf7aPha8uYO3tNTAYa2+vYeGrC8GsTxBy0e8D09PAyEj0b18+x2lEqDWELIaHXzyMK9evDDx35foVHH7xcE0rEoSC9PvAwgKwtgYwR/8uLIhYpxCh1hCyGJ5/+3yu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LGoBUEQAkeEWhAEIXBEqFMQ0SeJ6P8Q0Y+I6E/qXo8riOhpInqTiL5f91pcQkR3ENFLRPQ6Ef2AiJbqXpMriOgmIvoOEb26dW6P170mlxBRh4j+NxF9re61uISIzhHRWSJ6hYicTPkWH3UCIuoA+L8A/g2ANwB8F8DvMPPf1rowBxDRxwFcBvAlZv5A3etxBRHdBuA2Zv4eEe0GcAbAZ1ryNyMAu5j5MhGNAfgWgCVm/nbNS3MCEX0OwAyAPcz86brX4woiOgdghpmdFfKIRT3IRwH8iJn/npmvAfgygAdqXpMTmPmvAVyqex2uYeafMvP3tv7/LoDXAby/3lW5gSMub/04tvVohWVFRLcD+BSAL9a9liYgQj3I+wH8OPHzG2jJl34YIKJpAB8G8HK9K3HHlnvgFQBvAvgGM7fl3J4A8HkAm3UvxAMM4H8S0RkiWnCxQxHqQUjxXCssmLZDRDcD+AsADzPzO3WvxxXMvMHMHwJwO4CPElHj3VZE9GkAbzLzmbrX4ol7mPkjAO4H8IdbbsdSiFAP8gaAOxI/3w7gJzWtRbBky3/7FwD6zPxs3evxATO/BeCvAHyy5qW44B4Av7nly/0ygE8Q0Uq9S3IHM/9k6983ATyHyKVaChHqQb4L4E4i+gUiGgfw2wC+UvOaBANbAbf/AuB1Zv5Pda/HJUS0n4hu3fr/BIBfA/B39a6qPMz8b5n5dmaeRvQd+yYzP1TzspxARLu2gtogol0Afh1A6UwrEeoEzPwegD8C8AKioNR/ZeYf1LsqNxDRnwP4XwD+BRG9QUS/X/eaHHEPgDlEVtkrW48DdS/KEbcBeImIXkNkRHyDmVuVytZCfh7At4joVQDfAfA8M/9l2Z1Kep4gCELgiEUtCIIQOCLUgiAIgSNCLQiCEDgi1IIgCIEjQi0IghA4ItSCIAiBI0ItCIIQOP8fMQBDED+5QkAAAAAASUVORK5CYII=\n", "text/plain": [ "
" ] }, "metadata": { "needs_background": "light" }, "output_type": "display_data" } ], "source": [ "all_data = np.vstack([group1, group2, group3])\n", "group1, group2, group3 = find_groups(centroids, all_data)\n", "\n", "plt.scatter(group1[:,0], group1[:,1], color='r')\n", "plt.scatter(group2[:,0], group2[:,1], color='g')\n", "plt.scatter(group3[:,0], group3[:,1], color='b')\n", "\n", "plt.scatter(centroids[0,0], centroids[0,1], marker='x', color='r')\n", "plt.scatter(centroids[1,0], centroids[1,1], marker='x', color='g')\n", "plt.scatter(centroids[2,0], centroids[2,1], marker='x', color='b')\n", "\n", "plt.show()" ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAWoAAAD4CAYAAADFAawfAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjMsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+AADFEAAAgAElEQVR4nO2dbYwd13nf/89e7lq7okiGl0QgWN67ASIUCEy/SAungQAjldLEop3Y1ocgwWqxSAIsyE0AikZgJFigeoEXaIuiFD+UoglXAsu9iVE0UhtbTFRDVhI4SGUvXUm0o7hyY5JWZEDkspLIkjWp3acfZoc7d/acM+fMnDNv9/kBF+S9O3fmnHvv/OeZ5+0QM0MQBEGoLyNVD0AQBEEwI0ItCIJQc0SoBUEQao4ItSAIQs0RoRYEQag520LsdM+ePTw1NRVi14IgCK3kzJkzl5h5r+pvQYR6amoKKysrIXYtCILQSojovO5v4voQBEGoOSLUgiAINUeEWhAEoeaIUAuCINQcEWpBEISaI0ItCIJQc0SoBUEQao4IdUPpn+1j6skpjDw+gqknp9A/2696SIIgBEKE2kBdxbB/to/5r83j/LvnwWCcf/c85r82X5vxCYIT/T4wNQWMjET/9uV3nEaEWkOdxXDxxUVcu3lt4LVrN69h8cXFikYkCDnp94H5eeD8eYA5+nd+XsQ6hQi1hjqL4YV3Lzi9Lgi1ZXERuDZ4nuHateh14RYi1BrqLIaTOyedXheE2nJBcz7pXh9SRKg11FkMlx5YwsTo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CzRGLWhAEoeaIUAuCINQcEeoURPQpIvoBEf2QiP6o6vH4goieJqK3ieh7VY/FJ0T0ISJ6iYheJ6LvE9GhqsfkCyK6jYi+TUSvbszt8arH5BMi6hDR/ySir1c9Fp8Q0TkiOktErxCRl1W+xUedgIg6AP4XgH8J4E0A3wHw28z895UOzANE9EkAVwH8J2b+cNXj8QUR3QngTmb+LhHdAeAMgM+15DsjALcz81UiGgXwLQCHmPl/VDw0LxDRFwBMA9jBzJ+pejy+IKJzAKaZ2Vshj1jUg3wCwA+Z+R+Z+QaArwL4bMVj8gIz/w2Ay1WPwzfM/BNm/u7G/68AeB3AB6sdlR844urG09GNRyssKyK6C8CnAXyl6rE0ARHqQT4I4MeJ52+iJSf9MEBEUwA+DuDlakfijw33wCsA3gbwDWZuy9yeBPBFAOtVDyQADOC/E9EZIpr3sUMR6kFI8VorLJi2Q0TbAfwZgEeY+b2qx+MLZl5j5o8BuAvAJ4io8W4rIvoMgLeZ+UzVYwnEfcx8D4AHAfz+htuxECLUg7wJ4EOJ53cBeKuisQiWbPhv/wxAn5mfrXo8IWDmdwD8FYBPVTwUH9wH4Dc2fLlfBXA/ES1XOyR/MPNbG/++DeA5RC7VQohQD/IdAHcT0c8R0RiA3wLw5xWPSTCwEXD7jwBeZ+Z/X/V4fEJEe4lo18b/xwH8CoB/qHZUxWHmP2bmu5h5CtE59k1mfrjiYXmBiG7fCGqDiG4H8KsACmdaiVAnYOb3AfwBgBcQBaX+MzN/v9pR+YGI/hTA3wH4Z0T0JhH9XtVj8sR9AGYRWWWvbDz2Vz0oT9wJ4CUieg2REfENZm5VKlsL+VkA3yKiVwF8G8DzzPyXRXcq6XmCIAg1RyxqQRCEmiNCLQiCUHNEqAVBEGqOCLUgCELNEaEWBEGoOSLUgiAINUeEWhAEoeb8f2wd0meEntgOAAAAAElFTkSuQmCC\n", "text/plain": [ "
" ] }, "metadata": { "needs_background": "light" }, "output_type": "display_data" } ], "source": [ "centroids = np.array([np.mean(group1, axis=0), np.mean(group2, axis=0), np.mean(group3, axis=0)])\n", "\n", "plt.scatter(group1[:,0], group1[:,1], color='r')\n", "plt.scatter(group2[:,0], group2[:,1], color='g')\n", "plt.scatter(group3[:,0], group3[:,1], color='b')\n", "\n", "plt.scatter(centroids[0,0], centroids[0,1], marker='x', color='r')\n", "plt.scatter(centroids[1,0], centroids[1,1], marker='x', color='g')\n", "plt.scatter(centroids[2,0], centroids[2,1], marker='x', color='b')\n", "\n", "plt.show()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Result\n", "\n", "Above we have found our solution, and have identified the three original clusters of the data. Try editing this notebook to see how the algorithm performs when different data distributions are provided, or when different values of k are used." ] }, { "cell_type": "code", "execution_count": 12, "metadata": {}, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAWoAAAD4CAYAAADFAawfAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjMsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+AADFEAAAgAElEQVR4nO2df4wd13Xfv2cfd6NdySLDFREIlvZtgAgFAss/5IVTQICQSm5i0U5s6Q8jwWqxSIwsxE0AikZhtCBQSYY3KIqiFP8oTROuhC33IUaBSEFssVENW0XhoJW9ciXRiuLKjbmMKgMiqepXqYbU7ukfs8OdN3vvnXtn7p25M+98gAfyvZ03c+ftvu+cOfd7ziVmhiAIghAvY00PQBAEQTAjQi0IghA5ItSCIAiRI0ItCIIQOSLUgiAIkbMnxE5vuukmnp2dDbFrQRCETvL8889fZOYDqp8FEerZ2Vmsr6+H2LUgCEInIaIN3c8k9SEIghA5ItSCIAiRI0ItCIIQOSLUgiAIkSNCLQiCEDki1IIgCJEjQi0IghA5ItQtZnB2gNnHZjH26BhmH5vF4Oyg6SEJghAAEWoDMQvh4OwAS99ewsbbG2AwNt7ewNK3l6IaoyBYMRgAs7PA2Fjy70D+hvOIUGu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BFqQRCEyBGhzkFEnyGinxLRz4jonzc9Hl8Q0eNE9AYR/aTpsfiEiG4lomeJ6BUiepmIDjc9Jl8Q0XVE9EMienH73B5tekw+IaIeEf0PIvpO02PxCRGdI6KzRPQCEXlZ5Vty1BmIqAfgfwL4pwBeA/AjAL/PzH/T6MA8QER3AXgPwH9g5o80PR5fENHNAG5m5h8T0YcAPA/gCx35nRGA65n5PSIaB/ADAIeZ+b83PDQvENGXAcwBuJGZP9f0eHxBROcAzDGzt0IeiaiH+RSAnzHz3zHzFQDfAvD5hsfkBWb+rwDebHocvmHmXzDzj7f//y6AVwB8uNlR+YET3tt+Or796ERkRUS3APgsgG82PZY2IEI9zIcB/H3m+WvoyJd+FCCiWQCfAPBcsyPxx3Z64AUAbwD4LjN35dweA/AVAFtNDyQADOA/E9HzRLTkY4ci1MOQ4rVORDBdh4huAPDnAB5i5neaHo8vmHmTmT8O4BYAnyKi1qetiOhzAN5g5uebHksg7mTmOwDcC+CPt9OOlRChHuY1ALdmnt8C4PWGxiJYsp2//XMAA2Z+sunxhICZ3wLwXwB8puGh+OBOAL+7ncv9FoC7iWit2SH5g5lf3/73DQBPIUmpVkKEepgfAbiNiH6ViCYA/B6Av2x4TIKB7Qm3fw/gFWb+t02PxydEdICI9m3/fxLApwH8bbOjqg4z/wtmvoWZZ5F8x77PzA80PCwvENH125PaIKLrAfwWgMpOKxHqDMz8AYA/AfAMkkmp/8jMLzc7Kj8Q0Z8B+G8A/hERvUZEX2p6TJ64E8ACkqjshe3HwaYH5YmbATxLRC8hCSK+y8ydsrJ1kF8B8AMiehHADwE8zcx/VXWnYs8TBEGIHImoBUEQIkeEWhAEIXJEqAVBECJHhFoQBCFyRKgFQRAiR4RaEAQhckSoBUEQIuf/A8n4DK/wmnhbAAAAAElFTkSuQmCC\n", "text/plain": [ "
" ] }, "metadata": { "needs_background": "light" }, "output_type": "display_data" } ], "source": [ "all_data = np.vstack([group1, group2, group3])\n", "group1, group2, group3 = find_groups(centroids, all_data)\n", "\n", "plt.scatter(group1[:,0], group1[:,1], color='r')\n", "plt.scatter(group2[:,0], group2[:,1], color='g')\n", "plt.scatter(group3[:,0], group3[:,1], color='b')\n", "\n", "plt.scatter(centroids[0,0], centroids[0,1], marker='x', color='r')\n", "plt.scatter(centroids[1,0], centroids[1,1], marker='x', color='g')\n", "plt.scatter(centroids[2,0], centroids[2,1], marker='x', color='b')\n", "\n", "plt.show()" ] }, { "cell_type": "code", "execution_count": 13, "metadata": {}, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAWoAAAD4CAYAAADFAawfAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjMsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+AADFEAAAgAElEQVR4nO2df2wd13Xnv4dPZEPKvypKKIw4fCxQY4Eibn6YCBYwYOzG3TZm3Cb2H0ELmiDaIITEFpAdLIIu9IftAgQWi8XK+mNlrZq1wRVfGyxQe9HE2nqDxEWQYjcJlbWtuOmug1ZUvQlgSd7I9sqoZPLsH8MR5w3vvXPvzL0zd+adD/Ag8XHezJ33+L5z5pzvPZeYGYIgCEK8jDU9AEEQBMGMCLUgCELkiFALgiBEjgi1IAhC5IhQC4IgRM6+EDs9ePAgz87Ohti1IAhCJzl37txlZj6k+l0QoZ6dncXGxkaIXQuCIHQSItrU/U5SH4IgCJEjQi0IghA5ItSCIAiRI0ItCIIQOSLUgiAIkSNCLQiCEDki1IIgCJEjQt1iBucHmH16FmNPjWH26VkMzg+aHpIgCAEQoTYQsxAOzg+w/PVlbF7dBIOxeXUTy19fjmqMgmDFYADMzgJjY8m/A/kbziNCrSF2ITz2rWO4duPa0HPXblzDsW8da2hEglCCwQBYXgY2NwHm5N/lZRHrHCLUGmIXwotXLzo9LwhRcuwYcG34e4Zr15LnhZuIUGuIXQhnbp9xel4QouSi5vuke35EEaHWELsQrj6w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8COMrM/6PhoXmBiL4MYA7Abcz8UNPj8QURXQAwx8zeJvJIRD3MpwD8hJn/jpmvA/gagM81PCYvMPN3ALzd9Dh8w8w/Y+Yf7vz/XQA/BvDhZkflB054b+fH8Z1HJyIrIroLwGcBfLXpsbQBEephPgzgHzI/v4mOfOlHASKaBfAJAN9rdiT+2EkPvALgLQDfZOaunNvTAL4CYLvpgQSAAfw3IjpHRMs+dihCPQwpnutEBNN1iOgWAH8O4DFmfqfp8fiCmbeY+eMA7gLwKSJqfdqKiB4C8BYzn2t6LIG4j5k/CeBBAH+wk3ashAj1MG8C+Ejm57sA/LShsQiW7ORv/xzAgJmfb3o8IWDmnwP4KwCfaXgoPrgPwG/v5HK/BuDTRLTe7JD8wcw/3fn3LQAvIEmpVkKEepgfALibiH6ZiCYA/A6Av2h4TIKBnYLbfwTwY2b+d02PxydEdIiI7tj5/ySAXwfwt82OqjrM/K+Y+S5mnkXyHfs2Mz/a8LC8QET7d4raIKL9AH4DQGWnlQh1Bmb+AMAfAngJSVHqPzPz682Oyg9E9GcA/juAf0JEbxLRF5sekyfuA7CIJCp7Zecx3/SgPHEngJeJ6DUkQcQ3mblTVrYO8ksAvktErwL4PoAXmfkvq+5U7HmCIAiRIxG1IAhC5IhQC4IgRI4ItSAIQuSIUAuCIESOCLUgCELkiFALgiBEjgi1IAhC5Px/ifQVML5fG04AAAAASUVORK5CYII=\n", "text/plain": [ "
" ] }, "metadata": { "needs_background": "light" }, "output_type": "display_data" } ], "source": [ "centroids = np.array([np.mean(group1, axis=0), np.mean(group2, axis=0), np.mean(group3, axis=0)])\n", "\n", "plt.scatter(group1[:,0], group1[:,1], color='r')\n", "plt.scatter(group2[:,0], group2[:,1], color='g')\n", "plt.scatter(group3[:,0], group3[:,1], color='b')\n", "\n", "plt.scatter(centroids[0,0], centroids[0,1], marker='x', color='r')\n", "plt.scatter(centroids[1,0], centroids[1,1], marker='x', color='g')\n", "plt.scatter(centroids[2,0], centroids[2,1], marker='x', color='b')\n", "\n", "plt.show()" ] }, { "cell_type": "code", "execution_count": 14, "metadata": {}, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAWoAAAD4CAYAAADFAawfAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjMsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+AADFEAAAgAElEQVR4nO2db2wd13nmn5dXZEPK/ypKKIw4vCxQY4Eibv6YCBYwYOzG3TZm3Cb2h6AFTRBtEEJiC8gOiqALfbBdgMBiP6ysDytr1awNrnjbYIHaRRNr6w0SF0GK3SRU1rbiprsOWlH1JoAleSPbkFHJ5NkPwxHnDs85c86cc+acmfv+gAuSl3NnzlzyPvPO+z7nPSSEAMMwDJMuY7EHwDAMw+hhoWYYhkkcFmqGYZjEYaFmGIZJHBZqhmGYxNkXYqcHDx4Us7OzIXbNMAzTSc6dO3dZCHFI9rsgQj07O4uNjY0Qu2YYhukkRLSp+h2nPhiGYRKHhZphGCZxWKgZhmESh4WaYRgmcVioGYZhEoeFmmEYJnFYqBmGYRKHhbrFDM4PMPv0LMaeGsPs07MYnB/EHhLDMAFgodaQshAOzg+w/PVlbF7dhIDA5tVNLH99OakxMowRgwEwOwuMjWVfB/w/XIaFWkHqQnjsW8dw7ca1oeeu3biGY986FmlEDFODwQBYXgY2NwEhsq/LyyzWJVioFaQuhBevXrR6nmGS5Ngx4Nrw5wzXrmXPMzdhoVaQuhDO3D5j9TzDJMlFxedJ9fyIwkKtIHUhXH1gFVPjU0PPTY1PYfWBVeN9pJyDZ0aEGcXnSfX8iMJCrcCHEIZk4Z4FnP6t0+jf3geB0L+9j9O/dRoL9ywYvT71HDzjkZSLdaurwNTw5wxTU9nzzE0oxCrkc3NzogttTgfnBzj2rWO4ePUiZm6fweoDq8ZCmDqzT89i8+reror92/u48NiF5gfEhCEv1hXzwFNTwOnTwEIi/8uDQZaT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oRwXQdIroFwF8AeEwI8U7s8fhCCLElhPg4gLsAfIqIWp+2IqKHALwlhDgXeyyBuE8I8UkADwL4g520oxMs1MO8CeAjhZ/vAvDTSGNhDNnJ3/4FgIEQ4vnY4wmBEOLnAP4GwGciD8UH9wH47Z1c7tcAfJqI1uMOyR9CiJ/ufH0LwAvIUqpOsFAP8wMAdxPRLxPRBIDfAfBXkcfEaNgpuP1nAD8WQvyH2OPxCREdIqI7dr6fBPDrAP4+7qjcEUL8WyHEXUKIWWSfsW8LIR6NPCwvENH+naI2iGg/gN8A4Oy0YqEuIIT4AMAfAngJWVHqvwohXo87Kj8Q0Z8D+B8A/gURvUlEX4w9Jk/cB2ARWVT2ys5jPvagPHEngJeJ6DVkQcQ3hRCdsrJ1kF8C8F0iehXA9wG8KIT4a9edsj2PYRgmcTiiZhiGSRwWaoZhmMRhoWYYhkkcFmqGYZjEYaFmGIZJHBZqhmGYxGGhZhiGSZz/Dw8sglooEIS5AAAAAElFTkSuQmCC\n", "text/plain": [ "
" ] }, "metadata": { "needs_background": "light" }, "output_type": "display_data" } ], "source": [ "all_data = np.vstack([group1, group2, group3])\n", "group1, group2, group3 = find_groups(centroids, all_data)\n", "\n", "plt.scatter(group1[:,0], group1[:,1], color='r')\n", "plt.scatter(group2[:,0], group2[:,1], color='g')\n", "plt.scatter(group3[:,0], group3[:,1], color='b')\n", "\n", "plt.scatter(centroids[0,0], centroids[0,1], marker='x', color='r')\n", "plt.scatter(centroids[1,0], centroids[1,1], marker='x', color='g')\n", "plt.scatter(centroids[2,0], centroids[2,1], marker='x', color='b')\n", "\n", "plt.show()" ] }, { "cell_type": "code", "execution_count": 15, "metadata": {}, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAWoAAAD4CAYAAADFAawfAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjMsIGh0dHA6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F8I3IY2I0bBfc/hOAnwoh/n3s8fiEiA4S0a3b308C+ASAv407KneEEP9WCHG7EGIW2Wfse0KI+yMPywtEtHe7qA0i2gvgtwA4O61YqAsIId4F8EcAvo2sKPVfhBAvxx2VH4jozwH8DwD/jIheJaIvxh6TJ+4GsIAsKnth+3E49qA8cRuAZ4noJWRBxHeEEJ2ysnWQXwPwAyJ6EcAPATwjhPhL152yPY9hGCZxOKJmGIZJHBZqhmGYxGGhZhiGSRwWaoZhmMRhoWYYhkkcFmqGYZjEYaFmGIZJnP8PRxl9jxbDqCIAAAAASUVORK5CYII=\n", "text/plain": [ "
" ] }, "metadata": { "needs_background": "light" }, "output_type": "display_data" } ], "source": [ "centroids = np.array([np.mean(group1, axis=0), np.mean(group2, axis=0), np.mean(group3, axis=0)])\n", "\n", "plt.scatter(group1[:,0], group1[:,1], color='r')\n", "plt.scatter(group2[:,0], group2[:,1], color='g')\n", "plt.scatter(group3[:,0], group3[:,1], color='b')\n", "\n", "plt.scatter(centroids[0,0], centroids[0,1], marker='x', color='r')\n", "plt.scatter(centroids[1,0], centroids[1,1], marker='x', color='g')\n", "plt.scatter(centroids[2,0], centroids[2,1], marker='x', color='b')\n", "\n", "plt.show()" ] }, { "cell_type": "code", "execution_count": 16, "metadata": {}, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAWoAAAD4CAYAAADFAawfAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjMsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+AADFEAAAgAElEQVR4nO2df2wd13Xnv4dPZEPKtlxRQuGNw8cuaixQxPllIljAQLAbZetYSZvEf2Tb0gQbBCEstgDtoAh2oQK2CxAI9o+V9cfKWiFrQyu+Nlig9iKJtc0GiYsgxa4TOmtbcdNdB42oehPAkry2ZcitZPLuH8MR5w3vvXPv3Hvn3pl3PsADycd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F7cfh2IPyxG0AniWil5AFEd8RQnTKytZBfg3AD4joRQA/BPCMEOIvXXfK9jyGYZjE4YiaYRgmcVioGYZhEoeFmmEYJnFYqBmGYRKHhZphGCZxWKgZhmESh4WaYRgmcf4/4chuj0oLAF8AAAAASUVORK5CYII=\n", "text/plain": [ "
" ] }, "metadata": { "needs_background": "light" }, "output_type": "display_data" } ], "source": [ "all_data = np.vstack([group1, group2, group3])\n", "group1, group2, group3 = find_groups(centroids, all_data)\n", "\n", "plt.scatter(group1[:,0], group1[:,1], color='r')\n", "plt.scatter(group2[:,0], group2[:,1], color='g')\n", "plt.scatter(group3[:,0], group3[:,1], color='b')\n", "\n", "plt.scatter(centroids[0,0], centroids[0,1], marker='x', color='r')\n", "plt.scatter(centroids[1,0], centroids[1,1], marker='x', color='g')\n", "plt.scatter(centroids[2,0], centroids[2,1], marker='x', color='b')\n", "\n", "plt.show()" ] }, { "cell_type": "code", "execution_count": 17, "metadata": {}, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAWoAAAD4CAYAAADFAawfAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjMsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+AADFEAAAgAElEQVR4nO2df2wd13Xnv4dPZELKllw9CYURm49F6y1Q2M0vIljAQLAbZeuITpvUfwStaYINgrIWW4B2UARd6A/bAVgU+8fK+mMVrZC1wRVfGhSovWhibr1B4iJIseuEytpWXHfX2UZU3QSwJLeyDBmRTN79YzjivOG9d+6de+/MnXnnAzyQfJw3c+eR7ztnzvnec0kIAYZhGCZeRuoeAMMwDKOHhZphGCZyWKgZhmEih4WaYRgmclioGYZhImdPiJ0ePHhQTE1Nhdg1wzBMKzl79uwlIcQh2e+CCPXU1BTW19dD7JphGKaVENGG6nec+mAYhokcFmqGYZjIYaFmGIaJHBZqhmGYyGGhZhiGiR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": "display_data" } ], "source": [ "centroids = np.array([np.mean(group1, axis=0), np.mean(group2, axis=0), np.mean(group3, axis=0)])\n", "\n", "plt.scatter(group1[:,0], group1[:,1], color='r')\n", "plt.scatter(group2[:,0], group2[:,1], color='g')\n", "plt.scatter(group3[:,0], group3[:,1], color='b')\n", "\n", "plt.scatter(centroids[0,0], centroids[0,1], marker='x', color='r')\n", "plt.scatter(centroids[1,0], centroids[1,1], marker='x', color='g')\n", "plt.scatter(centroids[2,0], centroids[2,1], marker='x', color='b')\n", "\n", "plt.show()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "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.9.7" } }, "nbformat": 4, "nbformat_minor": 4 }