graphwave icon indicating copy to clipboard operation
graphwave copied to clipboard

calculate similarity between nodes

Open mousewu opened this issue 6 years ago • 3 comments

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)

mousewu avatar Oct 23 '18 12:10 mousewu

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.

Fungker avatar Oct 27 '18 11:10 Fungker

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.

mousewu avatar Oct 31 '18 08:10 mousewu

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.

donnate avatar Oct 31 '18 15:10 donnate