Processing math: 100%
SciPy

This is documentation for an old release of SciPy (version 0.17.0). Read this page in the documentation of the latest stable release (version 1.15.1).

scipy.spatial.distance.dice

scipy.spatial.distance.dice(u, v)[source]

Computes the Dice dissimilarity between two boolean 1-D arrays.

The Dice dissimilarity between u and v, is

cTF+cFT2cTT+cFT+cTF

where cij is the number of occurrences of u[k]=i and v[k]=j for k<n.

Parameters:

u : (N,) ndarray, bool

Input 1-D array.

v : (N,) ndarray, bool

Input 1-D array.

Returns:

dice : double

The Dice dissimilarity between 1-D arrays u and v.