Graph Data Science

node similarity

An algorithm that scores how alike two nodes are by comparing the neighbours they share.

Example

Ava and Ben both bought the Mug, and one other product each.

cypher
CALL gds.nodeSimilarity.stream('purchases')
YIELD node1, node2, similarity
RETURN gds.util.asNode(node1).name AS a,
       gds.util.asNode(node2).name AS b,
       similarity

They share one product out of the three between them, so the score is 0.33. Sharing all three would score 1, and sharing none would leave the pair out of the results.

Lessons that use this term

The lesson and course links below open in a new tab.

No published lesson uses this term yet.

All glossary terms