fatf.utils.distances
.binary_point_distance¶
-
fatf.utils.distances.
binary_point_distance
(y: Union[numpy.ndarray, numpy.void], X: numpy.ndarray, **kwargs) → numpy.ndarray[source]¶ Calculates the binary distance between
y
and every row ofX
.y
has to be a 1-dimensional numpy array or a row of a structured numpy array (i.e. numpy’s void) andX
has to be a 2-dimensional numpy array. The length ofy
has to be the same as the width ofX
.Either of the input arrays is not of a base dtype. (See
fatf.utils.array.validation.is_base_array
function description for the explanation of a base dtype.)- Parameters
- yUnion[numpy.ndarray, numpy.void]
A numpy array (has to be 1-dimensional) used to calculate the distances from.
- Xnumpy.ndarray
A numpy array (has to be 2-dimensional) to which rows the distances are calculated.
- **kwargsboolean
Keyword arguments that are passed to the
fatf.utils.distances.binary_distance
function responsible for calculating the binary distance.
- Returns
- distancesnumpy.ndarray
An array of binary distances between
y
and every row ofX
.
- Raises
- IncorrectShapeError
Either
y
is not 1-dimensional orX
is not 2-dimensional or the length ofy
is not equal to the number of columns inX
.