pickaperm¶
- exception corankco.algorithms.pickaperm.pickaperm.InompleteRankingsIncompatibleWithScoringSchemeException¶
- class corankco.algorithms.pickaperm.pickaperm.PickAPerm¶
Algorithm for rank aggregation initially defined in N.Ailon, M.Charikar, A.Newman. Aggregating inconsistent information : ranking and clustering. Journal of the ACM (JACM) 55.5 (2008), p. 23. This algorithm has been designed as a 2-approximation algorithm of the Kemeny-Young method when rankings are complete and without ties. It selects the input ranking which minimizes the Kemeny score with the input rankings.
Generalization to incomplete rankings (with ties): Within the framework designed by P.Andrieu, S.Cohen-Boulakia, M.Couceiro, A.Denise, A.Pierrot. A Unifying Rank Aggregation Model to Suitably and Efficiently Aggregate Any Kind of Rankings. https://dx.doi.org/10.2139/ssrn.4353494, this algorithm can only be used with one ScoringScheme (see is_scoring_scheme_relevant_when_incomplete_rankings docstring, and ScoringScheme class)
- compute_consensus_rankings(dataset: Dataset, scoring_scheme: ScoringScheme, return_at_most_one_ranking: bool = True, bench_mode: bool = False) Consensus ¶
- Parameters:
dataset (Dataset (class Dataset in package 'datasets')) – A dataset containing the rankings to aggregate
scoring_scheme (ScoringScheme (class ScoringScheme in package 'distances')) – The penalty vectors to consider
return_at_most_one_ranking (bool) – the algorithm should not return more than one ranking
bench_mode (bool) – is bench mode activated. If False, the algorithm may return more information
:return one or more rankings if the underlying algorithm can find several equivalent consensus rankings If the algorithm is not able to provide multiple consensus, or if return_at_most_one_ranking is True then, it should return a list made of the only / the first consensus found. In all scenario, the algorithm returns a list of consensus rankings :raise ScoringSchemeNotHandledException when the algorithm cannot compute the consensus because the implementation of the algorithm does not fit with the scoring scheme
- get_full_name() str ¶
Return the full name of the algorithm.
- Returns:
The string ‘Pick a Perm’.
- Return type:
str
- is_scoring_scheme_relevant_when_incomplete_rankings(scoring_scheme: ScoringScheme) bool ¶
Check if the scoring scheme is relevant when the rankings are incomplete.
- Parameters:
scoring_scheme (ScoringScheme) – The scoring scheme to be checked.
- Returns:
True if the scoring scheme is equivalent to unifying scoring scheme
Otherwise, False. Indeed, the consensus ranking need to be complete in this framework. Selecting this ScoringScheme mean that the user agrees with considering all the missing elements of an input ranking r can be considered as tied in a unifying bucket at the end of r, which makes the input rankings “virtually complete”.