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
andY
.Both
X
andY
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
andY
.
- Raises
- IncorrectShapeError
Either
X
orY
is not 2-dimensional orX
andY
do not have the same number of columns.- ValueError
Either of the input arrays is not purely textual.