element

class corankco.element.Element(value: int | str)

A class to represent an element of a ranking.

Parameters:

value (Union[int, str]) – the value of the element, either an integer or a string

property type: Type

returns the type of the instance :return: type of the instance :rtype: Type

property value: int | str

returns the value of the instance :return: value of the instance :rtype: Union[int, str]

class corankco.element.PairwiseElementComparison(x: Element, y: Element, x_before_y: float, x_after_y: float, x_tied_y: float)

Class to encapsulate the cost of the different relative orders for two elements in a consensus ranking within a Kemeny prism

property x: Element

Property to get the x element :return: x

property x_after_y: float

Property to get the cost to place x after y in a consensus in a Kemeny prism :return: cost to place x after y in a consensus in a Kemeny prism

property x_before_y: float

Property to get the cost to place x before y in a consensus in a Kemeny prism :return: cost to place x before y in the consensus in a Kemeny prism

property x_tied_y: float

Property to get the cost to tie x and y in a consensus in a Kemeny prism :return: cost to tie x and y in a consensus in a Kemeny prism

property y: Element

Property to get the y element :return: y