Inner Distances — Map of Objects

Skip to main content
`Ctrl`+`K`

# Inner Distances

chebyshev(vector_1, vector_2) → float

  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

  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

  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

  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

  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

  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

  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

  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

  Return: Swap distance between two votes

swap_distance_between_potes(pote_1: list, pote_2: list) → int

  Return: Swap distance between two potes

vote_to_pote(vote: list) → list

  Return: Positional vote

wl1(vector_1: ndarray, vector_2: ndarray) → float

  Return: L1 distance