Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

calculate similarity between nodes #12

Open
mousewu opened this issue Oct 23, 2018 · 3 comments
Open

calculate similarity between nodes #12

mousewu opened this issue Oct 23, 2018 · 3 comments

Comments

@mousewu
Copy link

mousewu commented Oct 23, 2018

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
Copy link

Fungker commented Oct 27, 2018

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
Copy link
Author

mousewu commented Oct 31, 2018

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
Copy link
Contributor

donnate commented Oct 31, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants