Uniform Manifold Approximation and Projection (UMAP)


In [1]:
import umap
from sklearn.datasets import load_digits

digits = load_digits()

embedding = umap.UMAP().fit_transform(digits.data)

In [2]:
embedding


Out[2]:
array([[-23.84930037,   2.11736591],
       [  7.20383181,   4.44376464],
       [  2.62990282,   3.91649253],
       ..., 
       [  4.88861219,   4.03476925],
       [  2.86355395,  -2.9615966 ],
       [  4.03419351,   3.64564778]])

In [3]:
embedding.shape


Out[3]:
(1797, 2)

In [4]:
digits = load_digits()

embedding = umap.UMAP(n_neighbors=5,
                      min_dist=0.3,
                      metric='correlation').fit_transform(digits.data)

In [5]:
embedding.shape


Out[5]:
(1797, 2)