lmcinnes / lmcinnes/umap

connectivity plot values not comparable with UMAP transform output

Open
#1,071 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
8.3k
Forks
871
Avg merge
1d 13h
Merged PRs (30d)
5

Description

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!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the reproducible example using umap.plot.connectivity(mapper, edge_bundling='hammer') and mapper.transform(X). Compare the coordinates used by the connectivity plot with projected_X, then trace the transformation applied by connectivity. Done means the plotted axis aligns with the transform output or the required coordinate conversion is clearly exposed and tested.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data-visualization, machine-learning
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.