lmcinnes / lmcinnes/umap

subset_points not working for interactive plots

Open
#361 1 comment 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

Hi!

First of all, thank you so much for this amazing library.

I have noticed a little issue while plotting a subset of points with interactive plots.
In the function interactive of umap/plot.py [LINE 1268]
instead of:

points = umap_object.embedding_
    if subset_points:
        points = points[subset_points]

I think it would be better to just use:

as you do in the points function:

if subset_points is not None:
        if len(subset_points) != points.shape[0]:
            raise ValueError(
                "Size of subset points ({}) does not match number of input points ({})".format(
                    len(subset_points), points.shape[0]
                )
            )

        data = data[subset_points]
        if hover_data is not None:
            hover_data = hover_data[subset_points]

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 in umap/plot.py at interactive around line 1268 and compare its subset_points handling with the points function. Check how the subset is applied to points, data, and hover_data, including the existing input-size validation. Done when interactive plots handle subset_points consistently without mismatched input errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data-visualization
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.