JACCARD_DISTANCE
Description
Computes the Jaccard Distance between two vectors. Jaccard distance is defined as 1 - Jaccard similarity coefficient, used to measure the degree of difference between two sets. For binary vectors, Jaccard distance = 1 - |A∩B| / |A∪B|, where A and B represent the sets of non-zero elements in the two vectors respectively.
Parameter Description
vector1: The first vector, supported typevector\<tinyint>vector2: The second vector, supported typevector\<tinyint>
Return Result
Returns a double value in the range [0, 1]. 0 indicates the two vectors are identical, 1 indicates they are completely different.
Examples
- Compute the Jaccard distance between two
vector\<tinyint>vectors
- Compute the Jaccard distance between longer
tinyintvectors
- Compute the Jaccard distance between identical vectors (result is 0)
