Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Discussion options

if encode_weight and kind == "nodes":

You must be logged in to vote

Replies: 1 comment

Comment options

Some scenarios for a hypothetical edge_merge policy, trying to reuse standard relational algebra / sql concepts:

edge_merge policies:

  • concat: fully new edges, preserving existing unaltered. add tag umap <-- default
  • replace: fully drop old if any, and only put in umap neighbor edges
  • inner: only label existing edges, and remove unmatched ones. When multiedges, drop excess.
  • left: preserve existing edges, and enrich when there's a match. When multiedges, update just 1.
  • upsert: update existing edges, and preserve umatched. Add new as needed. When multiedges, update just 1.
  • skip: Preserve initial edges; only enrich nodes w/ the embedding

append new edges:

(g
  .nodes(genes_df, 'id')
  .edges(known_pathways_df, 'src', 'dst')
   .umap(edge_merge='concat', type_tag='umap', col_prefix='umap_')
   .scale(1.0) # should be responsive
).plot()

reuse edges by sticking with either just updating existing (what happens in multiedges, just pick first?) , and optionally adding missing

(g
  .nodes(entities_df, 'id')
  .edges(known_correlations_df, 'src', 'dst')
  .umap(scale=1.0, edge_merge='inner' | 'upsert', type_tag='umap', out_cols={'weight': 'score'}) 

use UMAP for 'clustering on some node columns' but preserve existing edges, or at most augmenting them

(g
  .nodes(entities_df, 'id')
  .edges(some_relns_df, 'src', 'dst')
  .umap(use_cols=['feat1', 'feat2'], use_edges=True, scale=1.0, edge_merge='skip' | 'inner')
)

use UMAP for community detection, without repositioning

(g
  .nodes(entities_df, 'id')
  .edges(some_relns_df, 'src', 'dst')
  .umap(use_edges=True, scale=1.0, edge_merge='skip', position=False)
  .dbscan(use_cols=['x', 'y'], out_cols={'label': 'community', 'weight': 'community_distance'})
)
You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
💡
Ideas
Labels
None yet
2 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.