Inner Distances#
- chebyshev(vector_1, vector_2) float [source]#
Computes the Chebyshev distance.
- Parameters:
vector_1 – First vector.
vector_2 – Second vector.
- Returns:
Chebyshev distance.
- Return type:
float
- discrete(vector_1, vector_2) int [source]#
Computes the discrete distance.
- Parameters:
vector_1 – First vector.
vector_2 – Second vector.
- Returns:
Discrete distance.
- Return type:
int
- emd(vector_1, vector_2) float [source]#
Computes the EMD distance.
- Parameters:
vector_1 – First vector.
vector_2 – Second vector.
- Returns:
EMD distance.
- Return type:
float
- hamming(set_1: set, set_2: set) int [source]#
Computes the Hamming distance.
- Parameters:
vector_1 – First vector.
vector_2 – Second vector.
- Returns:
Hamming distance.
- Return type:
int
- hellinger(vector_1, vector_2) float [source]#
Computes the Hellinger distance.
- Parameters:
vector_1 – First vector.
vector_2 – Second vector.
- Returns:
Hellinger distance.
- Return type:
float
- l1(vector_1: ndarray, vector_2: ndarray) float [source]#
Computes the L1 distance.
- Parameters:
vector_1 – First vector.
vector_2 – Second vector.
- Returns:
L1 distance.
- Return type:
float
- l2(vector_1: ndarray, vector_2: ndarray) float [source]#
Computes the L2 distance.
- Parameters:
vector_1 – First vector.
vector_2 – Second vector.
- Returns:
L2 distance.
- Return type:
float
- single_l1(value_1, value_2) float [source]#
Computes the L1 distance between two values.
- Parameters:
value_1 – First value.
value_2 – Second values.
- Returns:
L1 distance.
- Return type:
float
- swap_distance(vote_1: list, vote_2: list, matching=None) int [source]#
Return: Swap distance between two votes