LINE is one of graph embedding methods which preserves both the local and global graph structures. It samples edges from graph to measure first-order proximity and caculates second-order proximity between nodes using their neighbors.
- generate traning pairs.
- encode embedding and caculate their similartiy through two LookupEncoders which store two groups of embedding (node embedding and context embedding in the paper)
-
Prepare data
cd ../../data/ python arxiv.py
-
Train
python train.py
to train and save embeddings using node2vec.
-
Evaluate
cd ../../eval/ python link_prediction_eval.py
Dataset | AUC |
---|---|
arxiv | ~0.86 (first order) |
arxiv | ~0.72 (second order) batchsize=32 |