lmcinnes / umap

Uniform Manifold Approximation and Projection
BSD 3-Clause "New" or "Revised" License
7.39k stars 803 forks source link

connectivity plot values not comparable with UMAP transform output #1071

Open etiennedemontalivet opened 11 months ago

etiennedemontalivet commented 11 months ago

I would like to add extra information on top of the connectivity plot, but it seems that the connectivity plot values do not correspond to the UMAP transform ?

Here is a reproducible example:

import umap
import umap.plot
from sklearn.datasets import make_classification

X, _ = make_classification()
random_texts = [str(i) for i in range(X.shape[0])]

mapper = umap.UMAP().fit(X)
projected_X = mapper.transform(X)
ax = umap.plot.connectivity(mapper, edge_bundling='hammer')
for x, y, s in zip(projected_X[:,0], projected_X[:,1], random_texts):
    ax.text(x, y, s)
    break # added this for debug

image

Expected behavior: The connectivity plot should return an axis which is comparable with the UMAP transform

Or is there any easy way to get the transformation that is applied ? Thanks!