Skip to content

Instantly share code, notes, and snippets.

@leriomaggio
Last active April 11, 2020 18:36
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save leriomaggio/7d13bd06d370f1801cfa8ce296253394 to your computer and use it in GitHub Desktop.
Gist code to reproduce UMAP Issue #400 - https://github.com/lmcinnes/umap/issues/400
import umap
import numpy as np
import scipy as sp
print('umap: ', umap.__version__)
print('Numpy: ', np.__version__)
print('Scipy: ', sp.__version__)
# umap: 0.4.0
# Numpy: 1.17.5
# Scipy: 1.2.1
from sklearn.datasets import load_digits
X, _ = load_digits(return_X_y=True)
trans = umap.UMAP(n_neighbors=10, random_state=42,
metric="euclidean", output_metric="euclidean",
init="spectral").fit(X)
inverse_trans = trans.inverse_transform(trans.embedding_[:10, :])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment