pymcdm.distances

pymcdm.distances.draWS(x, y)

Calculate drastic WS distance between the ranking vectors [1]. Rankings should be presented as indices, i.e. for the ranking A2 > A1 > A3 the ranking vector should be [2, 1, 3].

Parameters:
  • x (ndarray | list | tuple) – First vector of ranks.

  • y (ndarray | list | tuple) – Second vector of ranks.

Returns:

Drastic distance between two rankings vectors.

Return type:

float

References

pymcdm.distances.frobenius(r1, r2)

Calculate Frobenius distance between two ranking vectors [2]. Rankings should be presented as indices, i.e. for the given objects [A1, A2, A3] and ordering A2 > A1 > A3, the ranking vector should be [2, 1, 3].

Parameters:
  • r1 (ndarray | list | tuple) – First ranking vector in indices format.

  • r2 (ndarray | list | tuple) – Second ranking vector in indices format.

Returns:

Frobenius distance between two ranking vectors.

Return type:

float

References

pymcdm.distances.kemeny(r1, r2)

Calculate Kemeny distance between two ranking vectors [3]. Rankings should be presented as indices, i.e. for the given objects [A1, A2, A3] and ordering A2 > A1 > A3, the ranking vector should be [2, 1, 3].

Parameters:
  • r1 (ndarray | list | tuple) – First ranking vector in indices format.

  • r2 (ndarray | list | tuple) – Second ranking vector in indices format.

Returns:

Kemeny distance between two ranking vectors.

Return type:

float

References