lmcinnes / lmcinnes/umap

Best practices for distance measure of UMAP output

Open
#519 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

Hello,

I am curious for your thoughts on basic clustering of the UMAP results. It would essentially just be taking the a distance matrix of the embeddings and popping out the top 10 closest entities for any particular chosen entity.

I typically follow the 1/4th root rule of thumb when determining what the number of resulting components should be. So most times the results will have 3-10 dimensions.

Since this keeps dimensionality relatively low, does it make sense to use euclidean distance to measure how close each entity is to all other entities? I know that depending on the context (NLP, etc.) cosine similarity is the go-to, but that tends to only be argued with you have super high dimensionality. UMAP boils down a bunch of the information into a more compact package of a few dimensions.

If not euclidean, what would be recommended? I saw your example on NLP that uses hellinger distance to compute the embeddings, but once they are computed, can we default to using euclidean distance to measure similarity of the transformed data?

I know that hdbscan is very useful for clustering, but for this use case, we need an entire matrix of distances for another process downstream.

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

The issue does not name any files, tests, or entry points. First review the UMAP documentation and the linked distance-measure discussion, then establish whether guidance on measuring distances in transformed embeddings is needed and what recommendation would be considered complete.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Documentation
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
15/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.