corankco.partitioning package

Submodules

corankco.partitioning.ordered_partition module

Module about partitioning. This module is associated to partitioning methods, especially the ones defined in P. Andrieu, B. Brancotte, L. Bulteau, S. Cohen-Boulakia, A. Denise, A. Pierrot, S. Vialette, Efficient, robust and effective rank aggregation for massive biological datasets, Future Generation Computer Systems, 2021, pp 406–421. More precisely, this module defines an ordered partition, and gives two static methods to compute the two ordered partitions of the above article.

class corankco.partitioning.ordered_partition.OrderedPartition(partition: List[Set[Element]])

Bases: object

Class that implements usefull methods for an ordered partition. Note that in Kemeny rank aggregation, elements can be divided in sets of elements to consider independently

consistent_with(consensus: Consensus) bool

Compare the OrderedPartition object with a Consensus object :param consensus: the Consensus to compare with :return: True iif the Ordered partition and the consensus have the same number of elements, and for each i < j, for all x in subgroup i and y in subgroup j of the OrderedPartition, x is before y in the consensus. Note that if the Consensus object contains several consensus rankings, only the first one is considered

property elements: Set[Element]

Property to get a set of all the elements appearing in a group of the OrderedPartition :return: a set of all the elements appearing in a group of the OrderedPartition

get_group_index(index: int) Set[Element]

Get the i-th group of the OrderedPartition, that is the i-th Set of Elements of the partition :param index: the index of the part of the partition to get :return: the i-th group of the OrderedPartition, that is the i-th Set of Elements of the partition

in_same_group(element1: Element, element2: Element) bool

Return True iif the two elements in parameter are in the same group of the OrderedPartition object :param element1: :param element2: :return: True iif the two elements in parameter are in the same group of the OrderedPartition object

property nb_elements: int
Returns:

The number of total elements that is the sum of the number elements of each Set of the OrderedPartition

static parcons_partition(dataset: Dataset, scoring_scheme: ScoringScheme) OrderedPartition
Parameters:
  • dataset (Dataset (class Dataset in package 'datasets')) – A dataset containing the rankings to aggregate

  • scoring_scheme (ScoringScheme) – The ScoringScheme to consider (see ScoringScheme class)

:return a list of sets of elements such that there exists an exact consensus ranking which is consistent with the obtained partitioning

static parfront_partition(dataset: Dataset, scoring_scheme: ScoringScheme) OrderedPartition
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 a list of sets of elements such that any exact consensus respects this partitioning

property partition: List[Set[Element]]
Returns:

The partition, that is the List of List of Element

which_index_is(element: Element) int

Method to get, given an Element, the int ID of its group :param element: The target element :return: the index i such that element is in the ith group of the partition. -1 if element is in no group

Module contents

Module about Ordered Partitions, especially the ones defined in P. Andrieu, B. Brancotte, L. Bulteau, S. Cohen-Boulakia, A. Denise, A. Pierrot, S. Vialette, Efficient, robust and effective rank aggregation for massive biological datasets. Future Generation Computer Systems, 2021, pp 406–421.