borda¶
- class corankco.algorithms.borda.borda.BordaCount(use_bucket_id=False)¶
Borda is a rank aggregation method defined by Borda in J. C. de Borda, Mémoire sur les élections au scrutin, Histoire de l’académie royale des sciences, Paris, France, 1781, Ch. 1, pp. 657–664. It is one of the most famous voting system, used for example to elect the “Ballon d’or” This rank aggregation method has been slightly adapted to incomplete rankings with ties. Handling ties: score of an element in a ranking can be the rank of the element - 1, or the id bucket. The user can select its preference with the parameter use_bucket_id, boolean, False by default For instance, if ranking = [ {3, 5, 4}, {1, 2} ], if use_bucket_id = False, score(1) = score(2) = 3 whereas if use_bucket_id = True, score(1) = score(2) = 1 Handling non-ranked elements: depend on the Scoring Scheme used (see ScoringScheme class). Two of them are allowed (see method is_scoring_scheme_relevant_when_incomplete_rankings). According to the scoring scheme, elements will be ranked by score considering non-ranked elements as in a last bucket, or elements will be ranked according to their mean score when they are ranked.
- compute_consensus_rankings(dataset: Dataset, scoring_scheme: ScoringScheme, return_at_most_one_ranking=False, bench_mode=False) Consensus ¶
Calculate and return the consensus rankings based on the given dataset and scoring scheme.
- Parameters:
dataset (Dataset) – The dataset of rankings to be aggregated.
scoring_scheme (ScoringScheme) – The scoring scheme to be used for calculating consensus.
return_at_most_one_ranking (bool) – If True, the algorithm should return at most one ranking.
bench_mode (bool) – If True, the algorithm may return additional information for benchmarking purposes.
- Returns:
Consensus rankings. If the algorithm is unable to provide multiple consensuses or return_at_most_one_ranking is True, a single consensus ranking is returned.
- Return type:
- Raises:
ScoringSchemeNotHandledException – When the algorithm cannot compute the consensus because the implementation does not support the given scoring scheme.
- get_full_name() str ¶
Return the full name of the algorithm.
- Returns:
The string ‘BordaCount’.
- 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 one of the following: - induced measure scoring scheme - unifying scoring scheme - induced measure scoring scheme with p=0.5 - unifying scoring scheme with p=0.5 Otherwise, False.
- Return type:
bool