What is Cosine Similarity?

Cosine Similarity measures similarity using the cosine of the angle generated between two vectors in p-dimensional space. For two vectors x1 and x2, the similarity measure is found by the ratio of the dot product of two vectors over the product of the magnitude of the vectors. A common application of Cosine Similarity is in measuring document similarity in natural language processing.