Reference material for VECTOR_COSINE_DISTANCE function
1 - cos(θ)
, where cos(θ)
is the cosine similarity between the vectors. VECTOR_COSINE_DISTANCE
returns a value in the range [0, 2]
. A vector cosine distance of 0
means that the vectors are identical in direction. A distance of 1
means that they are orthogonal and have no correlation. A distance of 2
means that they point in opposite directions.
Alias: cosine_distance
(aligned with pgvector for compatibility)
Parameter | Description | Supported input types |
---|---|---|
<array> | The first array used in the distance calculation. | Any array of numeric data types. |
<array> | The second array used in the distance calculation. | Any array of numeric data types. |
array
arguments must have the same number of elements.
DOUBLE
distance (DOUBLE PRECISION) |
---|
0.01613008990009257 |