{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Demo: Iris\n", "\n", "This notebook explores how UMAP behaves when combined with the $k$-nearest\n", "minimum spanning tree ($k$-MST) and noisy minimum spanning tree union ($n$-MST)\n", "on the Iris dataset. The dataset consists of two clusters that only connect when\n", "considering the $26$-nearest neighbors. Our goal is to find a graph with a\n", "single connected component that describes how these clusters are oriented, while\n", "maintaining their local structure." ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "%load_ext autoreload\n", "%autoreload 2" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "from umap import UMAP\n", "from sklearn.datasets import load_iris\n", "\n", "from multi_mst import KMST, KMSTDescent, NoisyMST\n", "from lib.drawing import draw_umap" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "X, y = load_iris(return_X_y=True)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## UMAP layouts\n", "\n", "Cannot cross larger gaps without introducing many local edges." ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAMIAAABoCAYAAACjZi+5AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/TGe4hAAAACXBIWXMAAA9hAAAPYQGoP6dpAAANzUlEQVR4nO3de1hVdb7H8fdabDaXjQgECAgIgpcAQUQRU1JSNKysmbLRGi1tJqdTps10TtZTTTPnaTrTnJppZszszJRNZWaZTmoex0te8xagclEz5Rb32xZhA/uy1vnD59Tj05xu/rZg5/v6D1jr+/2yHz7PurKWZpqmiRD/z+l9PYAQ/YEEQQgkCEIAEgQhAAmCEIAEQQhAgiAEIEEQApAgCAFIEIQAJAhCAF4KgtH5KobR6Y3SQniF8iAYrpPQ+Qz2mkcxzV7V5YXwCuVBqDjxN1atHYhN3wrd76kuL4RXaCpvwza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yPQmCEMjBshCABEEIQIIgBCBBEAKQIAgBSBCEACQIQgASBCEACYIQgARBCECCIAQgQRACgP8BqO8hluV+MBIAAAAASUVORK5CYII=", "text/plain": [ "
" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAMIAAAB3CAYAAABR5p/3AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/TGe4hAAAACXBIWXMAAA9hAAAPYQGoP6dpAAAUXElEQVR4nO3deVRUZ5rH8W8tUEVVsVaxCIhsCkIIuBSILG6ocezYETVquk+6k2jnmGRM0ic5OeZMnExyzEnPJGmTaGtMolEndhRaInZs9xUQJLIIiKgEBGQTULAoiqKomj/sMMeZtG0SoBDez7/cqvvcAz/e59773vdKbDabDUEY4aT2LkAQhgIRBEFABEEQABEEQQBEEAQBEEEQBEAEQRAAEQRBAEQQBAEQQRAEQARBEAARBEEARBCEISzOaSZTFXOpvVw/4PsSQRCGlJx9+UxSJjFNsgAnkwtKs5qnwlazec32Ad2vREzDFoYKm83G09GrqS1pwIQRIwZ66EGHD7e5ybe2kwO2bzEiCEOG8XYX10rqMGHESaKmmeuo0WDgFnVU4uHhMWD7FkEQhoSKigq27diK9zIlORzEaLtNLz1UUoYrHoxmLMabJj7//PMB2b8IgmBXlZWVbNq0iXXr1rFz5060Wi2GTgNWbHgzml4sSCRSerEQyyxWrFhBR0dHv9ch7/dvFIT7cO3aNf72t79x7tw5SktLiYmJ4cyZMzg6OgKwcNV8vt50gJvc4JqtAn9CkUlkhNgewtXVlf4+tRVBEAZVXV0dBw4cIC8vj9LSUiIjI8nKyuoLAMCtW7f4znqRtnHVcBmauY4zHrjY3FDiRCDhxElmcfxWJmpXdb/UJa4aCYOivr6+LwAXLlwgPDycTz75BKVSedc2a9euxWg00tLSQk9PD81XWhl1fSy99GLDhgQJABYsBE33YceJz/qlPjEiCAOqubmZ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+Gd17VcunRpoEoShH9oQFojo9HI+PHj8fGS0djcy7YPvVk0X4NLaCVPpDqz9DFn5i6tI+eyCv/k84QulzN+rANqlYN434BgFwMyIvj5+aGf4MD14mAmPOTI3Blq/vjJTXy85Hz2gTcalYQbbVYsbW0sGlVM5mEDbT0vkPzLawNRjiD8U/0+IgQEBPDrRTbefNWXllYLrzzvjlQCrzzvwaSHlYyNr6amztK3fV0DvPzyi3iNebG/SxGE+9ZvI4Ktt5kP3vLhxo06TmR14aKRUX7FzJJHnXFzlfLnve1o1BK6uu6cm69evZqenh6+yriJ39g1/VWGIPwk/XbV6HDaGCZGyZk8pwZnjZRdm3y4WmVmlJccV1cZIYEOvPZ2C+ET3mXlypXi8qgwpPRLa1SU8yKxMXLUKilzpjnxx7c9sVoluGikdJls/MsT1/lk46t8sOltJBJZf+xSEPpVvwShs6MC9RgpLW0WNGoZTkoZaZntLH7UhbUfBPLdter+2I0gDJh+6U8CfL6jx2LDSyenu9vKmElVGHgZiftnrPsvMXFOGPr6ZUTwC/+UlpYO6qr/lcAAR2qvt/fH1wrCoOnXKRa23gaQOCORavrrKwVhUAy5Bb4EwR7ENUxBQARBEAARBEEARBAEARBBEARABEEQABEEQQBEEAQBEEEQBEAEQRAAEQRBAEQQBAGA/wGI0z0psOYx/QAAAABJRU5ErkJggg==", "text/plain": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "for k in [5, 40]:\n", " p = UMAP(n_neighbors=k, repulsion_strength=0.1, min_dist=0.2).fit(X)\n", " draw_umap(p, color=y, name=\"iris\", alg=f\"umap_{k}\", size=1.2, alpha=1)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## $k$-MST layouts\n", "\n", "Crosses all gaps $k$ times resulting in fairly uniform connectivity." ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAMIAAACnCAYAAABD2IPYAAAAOXRFWHRTb2Z0d2FyZQBNYXRwb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ixIknxhsHmBMwxZtbV99AQNS5L+B3IRFPloVTzLt6JuEzg7hl9j14TZyAra0t4eHhhM0pQ4FEQkLC+a6i7MRdI+G0Hkl+msOdlUyKiUTtr6S9oI/azBa2DH56vqsmOxEE4Yx2b8jlhWvXsDr9fvy8/ak90Mi862ac72rJTgRB+EnaYa1R1ya4EIggCALirpEgACIIggCIIAgCIIIgCIAIgiAAIgiCAIggCAIggiAIgAiCIAAiCIIAiCAIAiCCIAiACIIgACIIggDA/wFEJwHP98lTLgAAAABJRU5ErkJggg==", "text/plain": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "for k in [4]:\n", " p = KMST(num_neighbors=k).fit(X).umap(repulsion_strength=0.1, min_dist=0.2)\n", " draw_umap(p, color=y, name=\"iris\", alg=f\"kmst_{k}\", size=1.2, alpha=1)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The approximate version based on nearest neighbor descent can be faster on\n", "(high-dimensional) datasets that do not behave nicely with KDTrees." ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAMIAAABgCAYAAABPNa3UAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/TGe4hAAAACXBIWXMAAA9hAAAPYQGoP6dpAAAYV0lEQVR4nO3deVxU973/8dcMM+yy7wKKgIAEFVAQBUFQQYxbokZNookx1ia99iaxTdO0N02a259ZbZNHNGmS5sY0aWrMNWIUN1xQVBYBUUT2fXXYYQaG4czvDxquRrNVYFC/zz+HM+d8zjDvc77f7/meMzK9Xq9HEO5yckMXIAijgQiCICCCIAiACIIgACIIggCIIAgCIIIgCIAIgiAAIgiCAIggCAIggnAdvb4fva7E0GUIBiCCcK3eo0hXE5H6aw1diTDCRBCuZRLLxUJHOqo3GboSYYSJIFxDJlOCkQeqq42GLkUYYSII32Jq6cuVkj5DlyGMMBG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Pp6eylLKWOoJkB+Mwah52tHT1tfdRW1g5ZDaKzLIwqvZpeJL3E/gP7KSsro6mombxdJST8LhJzS3M2PfEz8vPzMTc3p6CggMTExCHZrgiCMGrV1dVx7MAJju88Q6dRC62pWta+cx/RCyL56q/7CZ5/Dx7unoz3HnfL2xJNI2HUcnNz46ENa5gcHkjr6T42vP4Qlo5mpHx9nH1bj5G2O5ONfluoLam/5W2JM4Iw6mm6eyjKKaGksZA5c+ZQV1fH/7zyGQ3ljSy8P5GVm5didIs/mSuCINw2JEkiJSUFW0s7PvrjZyj7TfjzoT8NybpFEITbzgsPbKUgvZhdFR8O2TpFEITbTkdzJ93talwnOA/ZOkUQBAExaiQIgAiCIAAiCIIAiCAIAiCCIAiACIIgACIIggCIIAgCIIIgCIAIgiAAIgiCAMD/B3Q468DdJESIAAAAAElFTkSuQmCC", "text/plain": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "for k in [4]:\n", " p = KMSTDescent(num_neighbors=k).fit(X).umap(repulsion_strength=0.1, min_dist=0.2)\n", " draw_umap(p, color=y, name=\"iris\", alg=f\"kmst_descent_{k}\", size=1.2, alpha=1)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## $n$-MST Layouts\n", "\n", "Tend not to cross large gaps multiple times unless the noise fraction is high\n", "enough." ] }, { "cell_type": "code", "execution_count": 14, "metadata": {}, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAMIAAABtCAYAAADzq74KAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/TGe4hAAAACXBIWXMAAA9hAAAPYQGoP6dpAAAQX0lEQVR4nO3de1zUdb7H8dePyzDDTQG5iCggAg2KF0BZEQUErCytvKxrW1b6qM5uN7dtKzvadi/3nE5pPcyz1bqd3GOdstK8pKTkDQUVEhBERGAYyQs3uQy34Tfnjza30lJzYBj4PP+cmd93Pj/gPd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IAEQQhAgiAEIEEQApAgCAFIEIQAJAhCABIEIQD4fzxGWGhnvhByAAAAAElFTkSuQmCC", "text/plain": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "for k in [10]:\n", " p = NoisyMST(num_trees=k, noise_fraction=0.6).fit(X).umap(repulsion_strength=0.1, min_dist=0.2)\n", " draw_umap(p, color=y, name=\"iris\", alg=f\"nmst_{k}\", size=1.2, alpha=1)" ] } ], "metadata": { "kernelspec": { "display_name": "work", "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.10.15" } }, "nbformat": 4, "nbformat_minor": 4 }