statable Statistics for study and research

Cosine similarity

A similarity measure for two vectors of numbers: the cosine of the angle between them. It lies between -1 and 1, for non-negative values between 0 and 1, and ignores the length of the vectors.

Example: The vectors (1, 2) and (2, 1) have the dot product 4 and the lengths √5 and √5: cosine = 4/5 = 0.8.

Caution: Cosine similarity is not the correlation. It does not centre the values around the mean.

Related

Open in Statable