Skip to content
ML Academy

Introduced on day 38

Cosine similarity

The dot product of two vectors divided by the product of their lengths; the cosine of the angle between them, in [-1, 1].

In detail

It ignores length and equals the dot product for unit vectors. It is a ranking signal specific to the model: the same value can mean a strong match in one embedding space and an unrelated pair in another, so thresholds are set per model from labelled pair distributions. Use the similarity function the model was trained for.