lmcinnes / lmcinnes/umap

self.unique - different on GitHub and pipy file

Open
#417 3 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

Hi!

I'm no expert on neither UMAP nor Python, but I have been using the UMAP extension on-and-off for the last 3 months. Previously I've had no error using it, but now a value error is appearing where I do not believe it should.

Using the "precomputed" metric, the following value error appears:
ValueError: unique is poorly defined on a precomputed metric

Looking at the code in umap_.py file on GitHub (https://github.com/lmcinnes/umap/blob/master/umap/umap_.py) row 1500 is states:

elif self.metric == "precomputed":
if self.unique:
raise ValueError("unique is poorly defined on a precomputed metric")

but in the pipy file (downloaded using pip install umap-learn, found https://pypi.org/project/umap-learn/) states:

elif self.metric == "precomputed":
if self.unique is False:
raise ValueError("unique is poorly defined on a precomputed metric")

The second statement seems contradictory to me. Since it says that unique is poorly defined for a precomputed metric it should logically be if self.unique like in the first case.

Is this an error?

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 by comparing the precomputed-metric branch in umap_.py on GitHub with the installed umap-learn package described in the issue. Check which released source and version contain each condition, then verify the intended behavior for self.unique; done means the discrepancy and correct condition are documented or resolved in the published package.

Written by the indexing model from the issue text.

Assessment

Tech stack
machine-learning, python
Domain
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.