rune-node2vec
Graph node embeddings via biased random walks and skip-gram.
What it does
rune-node2vec implements the Node2Vec algorithm (Grover & Leskovec, 2016) to learn
continuous vector representations for every node in an undirected graph. The two
hyperparameters p and q bias the random walk between local-neighbourhood (BFS) and
global-exploration (DFS) strategies, making the embeddings useful for link prediction,
node classification, and community detection.
Installation
[]
= "0.1"
Usage
use Node2Vec;
// Two triangles with no edges between them.
let edges = vec!;
let result = new
.embedding_dim
.num_walks
.walk_length
.n_epochs
.random_seed
.fit;
assert_eq!;
assert_eq!;
CLI
# basic use — one edge `u v` per line
# stdin, custom parameters
|
# all options
Output
Each line is one node's embedding — tab-separated floats, one line per node in ascending index order. A summary is written to stderr.
0.012345 -0.034567 0.056789 ...
-0.023456 0.045678 -0.012345 ...
# 6 nodes → 128-dim embeddings
License
MIT