fatf.utils.distances
.hamming_distance¶
-
fatf.utils.distances.
hamming_distance
(x: Union[numpy.ndarray, numpy.void], y: Union[numpy.ndarray, numpy.void], **kwargs) → Union[int, float][source]¶ Computes the Hamming distance between 1-dimensional non-numerical arrays.
Each of the input arrays can be either a 1D numpy array or a row of a structured numpy array, i.e. numpy’s void.
- Parameters
- xUnion[numpy.ndarray, numpy.void]
The first numpy array (has to be 1-dimensional and non-numerical).
- yUnion[numpy.ndarray, numpy.void]
The second numpy array (has to be 1-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
- distanceUnion[integer, float]
Hamming distance between the two numpy arrays.
- Raises
- IncorrectShapeError
Either of the input arrays is not 1-dimensional or they are of a different length.
- ValueError
Either of the input arrays is not purely textual.