cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Not getting correct similarity score

Hey all, I read about how similarity is calculated bw two nodes and it was pretty simple. However, I was getting an incorrect value of similarity for a pair of nodes(only for one specific node pair, in this case nodes 'AE2001' and 'AE0001'). A part of my graph is shown below :

3X_e_a_ea3d6b2d6cece9a0e0c7a06098815e660296c535.png

The memory projection with the name 'graph' is shown below:

call gds.graph.create('graph','*',['reports','reported_on','condition'])

The query used to get the similarity:

CALL gds.nodeSimilarity.stream('graph') YIELD node1, node2, similarity
WITH gds.util.asNode(node1) AS n1, gds.util.asNode(node2) AS n2, similarity 
WHERE n1:Adverse_Event AND n2:Adverse_Event AND id(n1) > id(n2) 
WITH n1, n2, similarity order by similarity desc  limit 3
RETURN n1,n2,similarity

The result of the query:

As we can see, the similarity of 'AE2001' and "AE0001' is .5 according to the similarity algo, and it should be .8 according to me. (4/5)
Can someone pls explain why I get 0.5?
PS: Similarity value of other pairs are perfectly fine.

0 REPLIES 0