COSINE_DISTANCE
Description
cosine_distance, or cosine distance, is a method for measuring the directional difference between two vectors. It is obtained by subtracting the cosine similarity from 1 and is used to reflect the degree of difference in direction between vectors. Cosine similarity itself is determined by calculating the cosine of the angle between two vectors, with values ranging from -1 to 1.
Parameter Description
- vector1: The first vector, supported types are array<decimal>, array<double>, array<float>
- vector2: The second vector, supported types are array<decimal>, array<double>, array<float>
Return Result
Returns a result of type double
Example
- Calculate the distance between two vectors of type array<decimal>
- Calculate the distance between two vectors of type array<double>
- Calculate the distance between two vectors of type array<float>