Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
05-05-2022 08:56 AM
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()
All the sessions of the conference are now available online