Open mkhoshdeli opened 4 years ago
Hi Mina,
I am sorry for the late reply! But for posterity, yeah this implementation is for unweighted graphs. It is easy to adapt DeepWalk to weighted graphs though -- as you said, you can sample the next node based on the weights of edges.
The most efficient way to achieve this is via alias sampling. See section 3.2.3 of the node2vec paper as an example: https://cs.stanford.edu/~jure/pubs/node2vec-kdd16.pdf
Best, Haochen
Hello @GTmac ,
I would like to work on this. Any help would be appreciated.
I am confused by what @mkhoshdeli and you are referring by weight. In my understanding:
p-return parameter
and q-in_out parameter
) and ignore edge weight given by user in graph.Looking at the examples I see users can give edgelist, .mat, or .adjlist. Not sure if there is a way for user to pass weighted graph i.e weight for each edge.
PS: Also I was planning to use pytest for testing. Any thoughts on this?
Thank you for the great code. I have a question about the way you generate the random walks. It seems that the weights of the edges do not have any effect (i.e., the nodes are selected based on a random uniform distribution). However, shouldn't random walk take into account the weights of edges when selecting the nodes?
Best, Mina