cupyx.scipy.spatial.distance.canberra#

cupyx.scipy.spatial.distance.canberra(u, v)[source]#

Compute the Canberra distance between two 1-D arrays.

The Canberra distance is defined as

\[d(u, v) = \sum_{i} \frac{| u_i - v_i |}{|u_i| + |v_i|}\]
Parameters:
  • u (array_like) – Input array of size (N,)

  • v (array_like) – Input array of size (N,)

Returns:

The Canberra distance between vectors u and v.

Return type:

canberra (double)