lmcinnes / lmcinnes/umap

ZeroDivisionError: division by zero - seuclidean metric

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

Hi,
i have stumbled upon this problem several times. After calculating umap with seuclidean metric the error pops up: ZeroDivisionError: division by zero the last traceback is to line: line 387, in nearest_neighbors knn_indices, knn_dists = nn_descent(. I have run multiple umaps with this metric, , with aproximately 5000 data points and with numbers of features ranging from 5 up to the 262 144, and sometimes umap would return results but sometimes don't. I can not figure out what the problem is. Can someone explain to me what causes such a 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 at the nearest_neighbors entry point and the nn_descent call named in the traceback. Reproduce the failure with the seuclidean metric across the reported feature counts and compare runs that succeed with runs that raise ZeroDivisionError. Done means identifying the input or metric condition that causes the division by zero and documenting or addressing it with a regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.