This repository provides a reference implementation of linkvec This repository contains following files:
./emb/embedding.emb
: Contains the embedding for the given graph./graph/fb-food-pages.edgelist
: Contains the edgelist for facebook food page dataset./src/main.py
: Contains driver program for embedding generation./src/linkprediciton.py
: Contains driver program for link predicition problem./src/algorithm.py
: Contains methods for edge embedding../src/linkvectorizer.py
: Contains implementation of link vectorizer object.
To run linkvec on random network, execute the following command from the project home directory:
python src/main.py --input graph/fb-food-pages.edgelist --output emb/random.emb
You can check out the other options available to use with linkvec using:
python src/main.py --help
The supported input format is an edgelist:
node1_id_int node2_id_int <weight_float, optional>
The graph is assumed to be undirected and unweighted by default. These options can be changed by setting the appropriate flags.
The intermediatery output file has n+1 lines for a graph with n vertices. The first line has the following format:
num_of_nodes dim_of_representation
The next n lines are as follows:
node_id dim1 dim2 ... dimd
the final edge embedding would be <dim1 ,dim2, ... dimd>
To predict links one can use src/linkprediction.py
The given implementation is for computing the accuracy. Rest of the metrics can be computed accordingly.
@article{TRIPATHI2021,
title = {Network embedding based link prediction in dynamic networks},
journal = {Future Generation Computer Systems},
year = {2021},
issn = {0167-739X},
doi = {https://doi.org/10.1016/j.future.2021.09.024},
url = {https://www.sciencedirect.com/science/article/pii/S0167739X21003708},
author = {Shashi Prakash Tripathi and Rahul Kumar Yadav and Abhay Kumar Rai},
keywords = {Network embedding, Link prediction, Similarity measures, Network features, Feature learning, Biased random walk, Dynamic networks},
}