Data Science & ML
Intermediate
Cosine Similarity
Measures similarity between two vectors by the angle between them.
Formula
Variables
A,BVectors
\A\
Example
Identical direction gives 1, orthogonal gives 0
Did You Know?
Cosine similarity ignores magnitude, making it ideal for text embeddings.