Kosinietäisyys
Kosinietäisyys, also known as cosine similarity, is a measure of similarity between two non-zero vectors of an inner product space. It is defined as the cosine of the angle between the two vectors. The formula for cosine similarity is:
similarity = cos(θ) = (A ⋅ B) / (||A|| ||B||)
where A and B are two vectors, A ⋅ B is their dot product, and ||A|| and ||B||
The value of cosine similarity ranges from -1 to 1. A similarity score of 1 means the
In practice, cosine similarity is often used in natural language processing (NLP) and information retrieval. Documents