snap-stanford / graphwave

170 stars 53 forks source link

calculate similarity between nodes #12

Open mousewu opened 6 years ago

mousewu commented 6 years ago

I am trying to calculate similarity coefficients between nodes based on node embedding vectors obtained from graphwave algorithm. However, the calculated distance between node embedding vectors is very small, e.g. between 0 and 0.01. Hence, the similarity is quite close to 1 for all node pairs. Do you have any suggestion on how to solve this problem? I use the following codes to calculate the distance and similarity:

distance = sc.spatial.distance.euclidean(chi[0,:],chi[1,:]) similarity = 1.0/(1.0+distance)

Fungker commented 6 years ago

hello, i got same quension with you, i want to use these vectors to calculate distance but the pwrformance is not good as Node2vec,we can disscuss this together.

mousewu commented 5 years ago

hello, i got same quension with you, i want to use these vectors to calculate distance but the pwrformance is not good as Node2vec,we can disscuss this together.

Ok, but Node2vec is more computational complex for large graph.

donnate commented 5 years ago

Hi,

If the similarity is too small, then you might want to try another more discriminative distance(such as e^{-S_{ij}/s^2}, and choose an appropriate bandwidth). You might have to play around with the scales to try to get higher contrast between roles. I don't have that much experience with Node2Vec, so I wouldnt be able to give you any advice on that unfortunately.