RankingDistance

class rsdiv.evaluation.RankingDistance[source]

Bases: object

Distance between ordered lists.

classmethod set_measure(source_list: List, target_list: List, truncate_at: int) float[source]

Calculate the common elements for two ordered lists.

Parameters
  • source_list (List) – First ordered list.

  • target_list (List) – Second ordered list.

  • truncate_at (int) – Until which position the numbers would be considered.

Returns

Ratio for the number of common elements.

Return type

float

classmethod naive_set_based_measure(source_list: List, target_list: List, truncate_at: int) float[source]

Calculate the average common elements for two ordered lists.

Parameters
  • source_list (List) – First ordered list.

  • target_list (List) – Second ordered list.

  • truncate_at (int) – Until which position the numbers would be considered.

Returns

The average number of common elements.

Return type

float

classmethod rank_biased_overlap(source_list: List, target_list: List, decay: float) float[source]

Rank Biased Overlap (RBO) based on geometric series.

Parameters
  • source_list (List) – First ordered list.

  • target_list (List) – Second ordered list.

  • decay (float) – The values in geometric series decreases with the increasing depth.

Returns

The average overlap for comparing ranked lists.

Return type

float