aditya-grover / node2vec

http://snap.stanford.edu/node2vec/
MIT License
2.6k stars 912 forks source link

why p=1 and q=1 performs much worse than deepwalk #60

Open zhjzh1016 opened 5 years ago

zhjzh1016 commented 5 years ago

Hello, I apply node2vec method in a citation network generated myself. I want to compare the deepwalk and node2vec. In my opinion, the node2vec is better than deepwalk, but I have tried lots of p, q, the performance is not as good as deepwalk. When I set p and q to 1, the performance is much worse than deepwalk, but in fact, in this case it equals to deepwalk. The result shows below, both p and q equal 1, and other parameters are the same. I dont know why, could you please give me some advice, Thank you. start deepwalk starting computing RPrecision 1 in top 2 is 0.500000 2 in top 4 is 0.500000 4 in top 6 is 0.666667 5 in top 8 is 0.625000 5 in top 10 is 0.500000 6 in top 20 is 0.300000 11 in top 30 is 0.366667 17 in top 40 is 0.425000 21 in top 50 is 0.420000 37 in top 100 is 0.370000 182 in top 1000 is 0.182000 end deepwalk start node2vec starting computing RPrecision 1 in top 2 is 0.500000 1 in top 4 is 0.250000 1 in top 6 is 0.166667 1 in top 8 is 0.125000 1 in top 10 is 0.100000 1 in top 20 is 0.050000 1 in top 30 is 0.033333 2 in top 40 is 0.050000 5 in top 50 is 0.100000 22 in top 100 is 0.220000 139 in top 1000 is 0.139000 end node2vec

DozenCoder commented 5 years ago

Maybe because Deepwalk use Skip-gram and hierarchical softmax models:https://github.com/phanein/deepwalk/blob/master/deepwalk/__main__.py#L75, Node2vec use Skip-gram and negative sampling models:https://github.com/aditya-grover/node2vec/blob/master/src/main.py#L87.

ouxiaoxiao commented 2 years ago

This question has puzzled me for a long time. The papers in the academic circle are difficult for me to reproduce