exactalgorithmcplex¶
- class corankco.algorithms.exact.exactalgorithmcplex.ExactAlgorithmCplex(optimize=True)¶
A class to perform exact optimization on the rank aggregation problem using CPLEX linear programming. More information can be found in 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 Note: This implementation uses CPLEX, which is proprietary software. Users must download and install CPLEX separately from the IBM website. While CPLEX is not open source, there is a free version available for academic use. More information can be found at: https://www.ibm.com/products/ilog-cplex-optimization-studio
- Variables:
_PRECISION_THRESHOLD – float representing the precision threshold used for floating point comparison
- compute_consensus_rankings(dataset: Dataset, scoring_scheme: ScoringScheme, return_at_most_one_ranking=True, bench_mode=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 ‘Exact algorithm ILP Cplex’.
- 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 as ExactAlgorithmCplex can handle any ScoringScheme
- Return type:
bool