Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle multiple neighbor sets #10

Merged
merged 6 commits into from Jan 6, 2022
Merged

Conversation

venkatesh-sivaraman
Copy link
Contributor

Adds backend support for dealing with both high-dimensional and low-dimensional neighbors at different points in the visualization. For example, when visualizing the differences between multiple 2D projections of the same data, we may want the sidebar to display high-dimensional neighbors, but for the comparison functions (color stripes, suggested selections) to operate on the low-dimensional neighbors.

In this implementation, we define two additional classes, Neighbors and NeighborSet, which contain and handle serialization of nearest neighbors. We also add two methods on Embedding/EmbeddingSet, get_ancestor_neighbors() and get_recent_neighbors(). Ancestor neighbors are the neighbors that are farthest back in the parent tree of an embedding, i.e. the neighbors from the highest-dimensional embedding. Recent neighbors are the closest neighbor set in the parent tree of an embedding, i.e. the neighbors that should be compared.

Which neighbors are used as the ancestor and recent neighbors can be controlled by deciding where to call compute_neighbors(), which associates a Neighbors object with a particular embedding. To make a certain level the target of comparison, simply clear the parent embeddings' neighbors by calling clear_upstream_neighbors().

@lgtm-com
Copy link

lgtm-com bot commented Jan 5, 2022

This pull request introduces 3 alerts when merging 05852e7 into 71e2239 - view on LGTM.com

new alerts:

  • 1 for Except block handles 'BaseException'
  • 1 for Unused import
  • 1 for 'import *' may pollute namespace

@venkatesh-sivaraman venkatesh-sivaraman merged commit d0bf117 into main Jan 6, 2022
@venkatesh-sivaraman venkatesh-sivaraman deleted the neighbor-set-config branch January 20, 2022 21:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant