fatf.utils.distances.hamming_array_distance

fatf.utils.distances.hamming_array_distance(X: numpy.ndarray, Y: numpy.ndarray, **kwargs) → numpy.ndarray[source]

Calculates the Hamming distance matrix between rows in X and Y.

Both X and Y have to be 2-dimensional numerical numpy arrays of the same width.

Parameters
Xnumpy.ndarray

A numpy array – has to be 2-dimensional and non-numerical.

Ynumpy.ndarray

A numpy array – has to be 2-dimensional and non-numerical.

**kwargsboolean

Keyword arguments that are passed to the fatf.utils.distances.hamming_distance_base function responsible for calculating the Hamming distance.

Returns
distance_matrixnumpy.ndarray

An matrix of Hamming distances between rows in X and Y.

Raises
IncorrectShapeError

Either X or Y is not 2-dimensional or X and Y do not have the same number of columns.

ValueError

Either of the input arrays is not purely textual.