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.

Find node similarity for all possible pairs

How do I get all possible combination of pairs nodeSimilarity? In my graph I have 4893 persons and I am computing nodeSimilarity using a weighted graph. All possible, distinct pairs, from my list should yield about 11968278 pairs of nodes + a score for each if I set the cutoff to 0, here is my code:

query = """CALL gds.nodeSimilarity.stream('my_weighted_jaccard_graph', 
                {relationshipWeightProperty: 'weight', similarityCutoff:0, topK: 4893})
            YIELD node1, node2, similarity
            WITH node1, node2, similarity WHERE node1 < node2
            RETURN gds.util.asNode(node1).provider_id AS provider_id1, 
                gds.util.asNode(node2).provider_id AS provider_id2, similarity"""

resultset = session.run(query)
df = pd.DataFrame(data=resultset, columns =['p1','p2', 'sim_score'])
df.head()
0 REPLIES 0