node2vec
node2vec copied to clipboard
Graph with weight
Hi,
How can I use this work to embed the graph with weight (such as the distance between tow nodes), could you please give some suggestions? Thanks in advance.
@Sean0719 If you use python version, just with --weighted
.
Such as python node2vec/src/main.py --input xx.edgelist --output xx.embeddings --dimensions 100 --walk-length 100 --num-walks 50 --window-size 30 --p 0.25 --q 4 --iter 5 --weighted
and your edgelist file should like:
780 725 1
266 351 2
285 132 1
328 748 7
275 487 1
259 938 2
.....
Okay, thank you very much.
Hi, One more question, for the weighted node, the weight is used to compute the probability between two node? Thank you very much.
Hi, One more question, for the weighted node, the weight is used to compute the probability between two node? Thank you very much.
By reading the source code:https://github.com/aditya-grover/node2vec/blob/master/src/node2vec.py#L66, https://github.com/aditya-grover/node2vec/blob/master/src/node2vec.py#L85 , the weight should be used to compute the probability between two node.
@Sean0719 If you use python version, just with
--weighted
. Such aspython node2vec/src/main.py --input xx.edgelist --output xx.embeddings --dimensions 100 --walk-length 100 --num-walks 50 --window-size 30 --p 0.25 --q 4 --iter 5 --weighted
and your edgelist file should like:780 725 1 266 351 2 285 132 1 328 748 7 275 487 1 259 938 2 .....
Hello I am trying to run node2 vec how can I use this weight