Last active
April 11, 2020 18:36
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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