{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "\n# Discovering clusters using HDBSCAN\n\nTo make use of HDBSCAN as the clustering algorithm used to discover clusters,\nyou must specify it as the cluster argument. If you wish to specify HDBSCAN\nparameters you will need the dictionary form which includes both the model\nand the params. Since HDBSCAN does not require the number of clusters,\nn_clusters does not need to be set.\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "# Code source: Andrew Heusser and Leland McInnes\n# License: MIT\n\n# import\nimport hypertools as hyp\nimport pandas as pd\n\n# load example data\ngeo = hyp.load('mushrooms')\n\n# plot\ngeo.plot(cluster={'model':'HDBSCAN',\n 'params': {'min_samples':5,\n 'min_cluster_size':30}})" ] } ], "metadata": { "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.12.4" } }, "nbformat": 4, "nbformat_minor": 0 }