Discovering clustersΒΆ

The n_clusters kwarg can be used to discover clusters in your dataset. It relies on scikit-learn’s implementation of k-mean clustering to fin clusters, and then labels the points accordingly. You must set the number of clusters yourself.

../_images/sphx_glr_plot_clusters_001.png
# Code source: Andrew Heusser
# License: MIT

# import
import hypertools as hyp
import pandas as pd

# load example data
data = hyp.tools.load('mushrooms')

# plot
hyp.plot(data, '.', n_clusters=10)

Total running time of the script: ( 0 minutes 1.748 seconds)

Generated by Sphinx-Gallery