Visualizing the digits dataset using UMAP

Open in Colab  run this example as a notebook — or grab the .ipynb (also linked at the bottom of the page)

This example loads in some data from the scikit-learn digits dataset and plots it using UMAP, with one color per digit class and a legend mapping colors to digits.

plot UMAP
/home/docs/checkouts/readthedocs.org/user_builds/hypertools/checkouts/latest/hypertools/plot/backend.py:1353: UserWarning: Failed to switch to any interactive backend (TkAgg, QtAgg, Qt5Agg, Qt4Agg, GTK4Agg, GTK3Agg, WXAgg). Falling back to 'Agg'.
  warnings.warn(BACKEND_WARNING)

# Code source: Andrew Heusser and Leland McInnes
# License: MIT

from sklearn import datasets
import hypertools as hyp

digits = datasets.load_digits(n_class=6)
data = digits.data
hue = digits.target.astype('str')

hyp.plot(data, '.', reduce='UMAP', hue=hue, ndims=2, legend=True)

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

Gallery generated by Sphinx-Gallery