cupyx.scipy.spatial.distance.russellrao#
- cupyx.scipy.spatial.distance.russellrao(u, v)[source]#
Compute the Russell-Rao distance between two 1-D arrays.
The Russell-Rao distance is defined as the proportion of elements in both u and v that are in the exact same position:
\[d(u, v) = \frac{1}{n} \sum_{k=0}^n u_i = v_i\]where \(x = y\) is one if \(x\) is different from \(y\) and zero otherwise.
- Parameters:
u (array_like) – Input array of size (N,)
v (array_like) – Input array of size (N,)
- Returns:
The Hamming distance between vectors u and v.
- Return type:
hamming (double)