Cosine similarity measures how similarly two vectors point by taking the cosine of the angle between them. It compares direction rather than simply the numerical size of feature values, making it useful for comparing node representations in a similarity network. section 8.0
Interpret the score and its role in nearest-neighbor analysis:
- A score of 1 means identical direction; the measure ranges from -1 to 1. section 8.0
- Compare pairs of user vectors and create relationships when their similarity passes a chosen threshold. section 8.0
- Use cosine similarity without normalizing features first, but treat normalization differently when using metrics such as Euclidean distance. section 8.2.1
- Recognize that inferred similarity links need not match links in the original network. section 8.0
User segmentation with a nearest-neighbor graph
Represent users with features such as tweet count, retweet ratio, time to retweet, degree measures, graphlets, and centralities. Neo4j Graph Data Science can use pairwise cosine similarity through gds.knn to create SIMILAR relationships, storing the score while topK and similarityCutoff control network density. A denser graph produces larger communities; a sparser graph produces more granular segments. section 8.2 section 8.2.2
View the angle-based geometry used to interpret cosine similarity. section 8.0













