scoringscheme

exception corankco.scoringscheme.ForbiddenAssociationPenaltiesScoringScheme(message='The first value of the first List must be 0. The second value of the first List must be > 0The fourth value of the first List must be <= the fifth value of the second ListThe first and second values of the second List must be equal. The fourth and the fifth values of the second List must be equalThe third value of the second List must be > 0For instance, [[0., 1., 1., 0., 0., 0.], [1., 1., 0., 1., 1., 0.]]')
exception corankco.scoringscheme.InvalidScoringScheme(message='Scoring scheme must be 2 Lists. Each list must be a list of 6 real >= 0 values. For instance, [[0., 1., 1., 0., 0., 0.], [1., 1., 0., 1., 1., 0.]]')
exception corankco.scoringscheme.NonRealPositiveValuesScoringScheme(message='Each list must be a list of 6 real >= 0 values. For instance, [[0., 1., 1., 0., 0., 0.], [1., 1., 0., 1., 1., 0.]]')
class corankco.scoringscheme.ScoringScheme(penalties: List[List[float]])

The ScoringScheme class represents a scoring scheme for comparing rankings.

Parameters:

penalties – A list of 2 penalty vectors i.e. rwo lists of size 6.

Let B be the first penalty vector and T be the second one, c be a consensus ranking (complete) and r be a ranking. - B: costs to pay for each elements x,y such that x < y in the consensus, more precisely:

  • B[0] if x < y in r

  • B[1] if x > y in r

  • B[2] if x is tied with y in r

  • B[3] if x is ranked and y is not

  • B[4] if y is ranked and x is not

  • B[5] if x and y are non-ranked

  • T: costs to pay for each elements x,y such that x is tied with y in the consensus, more precisely: - T[0] if x < y in r - T[1] if x > y in r - T[2] if x is tied with y in r - T[3] if x is ranked and y is not - T[4] if y is ranked and x is not - T[5] if x and y are non-ranked

Raises:

InvalidScoringScheme – If penalties is not of a correct format

:raises NonRealPositiveValuesScoringScheme if one penalty is not a real value>= 0 :raises ForbiddenAssociationPenaltiesScoringScheme if one of the following is not respected: - first value of first list must be 0 - second value of the first List must be > 0” - fourth value of the first List must be <= the fifth value of the second List” - third value of second list must be > 0 - first and second values of the second List must be equal - fourth and fifth values of the second List must be equal

property b1: float

Returns the cost to have x < y in the consensus for each input ranking such that x is before y

Returns:

The first element of the first penalty vector B.

Return type:

float

property b2: float

Returns the cost to have x < y in the consensus for each input ranking such that y is before x

Returns:

The second element of the first penalty vector B.

Return type:

float

property b3: float

Returns the cost to have x < y in the consensus for each input ranking such that x is tied with y

Returns:

The third element of the first penalty vector B.

Return type:

float

property b4: float

Returns the cost to have x < y in the consensus for each input ranking such that x is ranked whereas y is not. :return: The fourth element of the first penalty vector B. :rtype: float

property b5: float

Returns the cost to have x < y in the consensus for each input ranking such that y is ranked whereas x is not. :return: The fifth element of the first penalty vector B. :rtype: float

property b6: float

Returns the cost to have x < y in the consensus for each input ranking such that x and y are both non-ranked. :return: The sixth element of the first penalty vector B. :rtype: float

property b_vector: List[float]

Returns the List of 6 floats that corresponds to vector B according to Andrieu et al., IJAR 2022 :return: vector B of the Scoring Scheme as a List of 6 floats. :rtype: List[float]

description() str

Returns a string that gives details on the ScoringScheme :return: a string that gives details on the ScoringScheme :rtype: str

static get_extended_measure_scoring_scheme()

Get the ScoringScheme defined in [] :return: The ScoringScheme

static get_induced_measure_scoring_scheme_p(p: float)

Get the ScoringScheme that imitates the unification process, that is the non-ranked elements can be virtually considered as tied at the last position or the ranking :param p: the cost to create / break ties :return: The ScoringScheme [[0., 1., p, 0., 1., p], [p, p, 0., p, p, 0.]]

get_nickname() str

Get a nickname of the scoring scheme.

Returns:

A string representing a nickname of the scoring scheme.

static get_pseudodistance_scoring_scheme() ScoringScheme

Get the pseudo-distance defined in: Brancotte, Bryan & Rance, Bastien & Denise, Alain & Cohen-Boulakia, Sarah. (2014). ConQuR-Bio: Consensus Ranking with Query Reformulation for Biological Data. 10.1007/978-3-319-08590-6_13. .

Returns:

The ScoringScheme [[0., 1., 1., 0., 1., 0.], [1., 1., 0., 1., 1., 0.]]

static get_pseudodistance_scoring_scheme_p(p: float)

Get the pseudo-distance defined in: Brancotte, Bryan & Rance, Bastien & Denise, Alain & Cohen-Boulakia, Sarah. (2014). ConQuR-Bio: Consensus Ranking with Query Reformulation for Biological Data. 10.1007/978-3-319-08590-6_13 with reap parameter p = cost of creating / breaking ties :param p: the cost to create / break ties :return: The ScoringScheme [[0., 1., 1., 0., 1., 0.], [1., 1., 0., 1., 1., 0.]]

static get_unifying_scoring_scheme()

Get the ScoringScheme that imitates the unification process, that is the non-ranked elements can be virtually considered as tied at the last position or the ranking :return: The ScoringScheme [[0., 1., 1., 0., 1., 1.], [1., 1., 0., 1., 1., 0.]]

static get_unifying_scoring_scheme_p(p: float)

Get the ScoringScheme that imitates the unification process, that is the non-ranked elements can be virtually considered as tied at the last position or the ranking :param p: the cost to create / break ties :return: The ScoringScheme [[0., 1., p, 0., 1., p], [p, p, 0., p, p, 0.]]

is_equivalent_to(other) bool

Check if the current scoring scheme is equivalent to the given scoring scheme.

Parameters:

other – A ScoringScheme object.

Returns:

True if the scoring schemes are equivalent, False otherwise.

is_equivalent_to_on_complete_rankings_only(other) bool

Check if the current scoring scheme is equivalent to the given scoring scheme on complete rankings

Parameters:

other – A ScoringScheme object.

Returns:

True if the scoring schemes are equivalent, False otherwise.

property penalty_vectors: List[List[float]]

Returns the List of two penalty vectors (each one is a List of 6 floats) of the ScoringScheme :return: List of two penalty vectors (each one is a List of 6 floats) of the ScoringScheme. For instance, [[0., 1., 0.5, 0., 1., 0.], [0.5, 0.5, 0., 0.5, 0.5, 0.]] :rtype: List[List[float]]

property t1_and_t2: float

Returns the cost to have x tied with y in the consensus for each input ranking such that x < y or y < x :return: The first/second element of the first penalty vector T. :rtype: float

property t3: float

Returns the cost to have x tied with y in the consensus for each input ranking such that x is tied with y :return: The third element of the first penalty vector T. :rtype: float

property t4_and_t5: float

Returns the cost to have x tied with y in the consensus for each input ranking such that x XOR y is ranked :return: The fourth/fifth element of the first penalty vector T. :rtype: float

property t6: float

Returns the cost to have x tied with y in the consensus for each input ranking such that x and y are non-ranked :return: The sixth element of the first penalty vector T. :rtype: float

property t_vector: List[float]

Returns the List of 6 floats that corresponds to vector T according to Andrieu et al., IJAR 2022 :return: penalty vector T of the Scoring Scheme as a List of 6 floats. :rtype: List[float]