Hamza Waseem Naser

A tiny vector example: similarity depends on what you represent

Consider two fictional vectors, A = (1, 2) and B = (2, 4). B has twice A’s magnitude, but they point in the same direction. Their cosine similarity is 1.

Now compare A with C = (2, 1). The dot product is 4, both lengths are √5, so cosine similarity is 4/5 = 0.8.

The formula is dot(A, B) / (length(A) × length(B)). A direction-based measure can therefore treat different magnitudes as identical. Whether that is useful depends on what the coordinates mean and which distinctions the task needs to preserve.

Before using a similarity result, ask: what was represented, what was omitted, and what decision is this number supposed to support? The formula alone cannot answer those questions.

This is a mathematical illustration, not an explanation of Traitra’s implementation or evidence about anyone’s personality or relationships.

Source for the formula: scikit-learn’s cosine_similarity documentation: https://scikit-learn.org/stable/modules/generated/sklearn.metrics.pairwise.cosine_similarity.html

What would magnitude represent in an example where ignoring it would lose something important?