electre

This module implements the Electre algorithms.

Implementation and naming conventions are taken from [Vin98a].

class Electre1(performance_table, criteria_weights, concordance_threshold, veto_thresholds)

Bases: IElectre1[AdjacencyValueMatrix[DiscreteQuantitativeScale]], Selector

This class implements the Electre I algorithm.

Parameters
  • performance_table (PerformanceTable[QuantitativeScale]) –

  • criteria_weights (Dict[Any, float]) –

  • concordance_threshold (float) –

  • veto_thresholds (Dict[Any, float]) –

concordance()

Compute the concordance matrix.

Returns

concordance matrix

Return type

AdjacencyValueMatrix[QuantitativeScale]

construct()

Construct the outranking matrix using Electre I method.

Returns

the outranking matrix of the performance table

Return type

AdjacencyValueMatrix[DiscreteQuantitativeScale]

discordance()

Compute the discordance matrix.

Returns

discordance matrix

Return type

PartialValueMatrix[QuantitativeScale]

exploit(outranking_structure, cycle_reduction=False, transitivity=False, **kwargs)

Choose best alternative candidates from outranking matrix.

It uses OutrankingMatrix.kernel() to find the best candidates.

Parameters
  • outranking_structure (AdjacencyValueMatrix[DiscreteQuantitativeScale]) –

  • cycle_reduction (bool) – if True, apply AdjacencyMatrix.cycle_reduction_matrix to outranking matrix

  • transitivity (bool) – if True, apply AdjacencyMatrix.transitive_closure to outranking matrix

Returns

best alternative candidates

Return type

List

Warning

if outranking_matrix kernel does not exist, it returns all alternatives

outranking(concordance_matrix, discordance_matrix)

Compute the outranking matrix using Electre I method.

Parameters
Returns

the outranking matrix

Return type

AdjacencyValueMatrix[DiscreteQuantitativeScale]

select(cycle_reduction=False, transitivity=False, **kwargs)

Compute the outranking matrix using Electre I method.

Parameters
  • cycle_reduction (bool) – if True, apply AdjacencyMatrix.cycle_reduction_matrix to outranking matrix

  • transitivity (bool) – if True, apply AdjacencyMatrix.transitive_closure to outranking matrix

Returns

best alternative candidates

Return type

List

Warning

if outranking_matrix kernel does not exist, it returns all alternatives

class Electre2(performance_table, criteria_weights, weak_concordance_threshold, strong_concordance_threshold, weak_veto_thresholds, strong_veto_thresholds)

Bases: IElectre1[Tuple[AdjacencyValueMatrix[DiscreteQuantitativeScale], AdjacencyValueMatrix[DiscreteQuantitativeScale]]], Ranker

This class implements the Electre II algorithm.

Parameters
  • performance_table (PerformanceTable[QuantitativeScale]) –

  • criteria_weights (Dict[Any, float]) –

  • weak_concordance_threshold (float) –

  • strong_concordance_threshold (float) –

  • weak_veto_thresholds (Dict[Any, float]) –

  • strong_veto_thresholds (Dict[Any, float]) –

concordance()

Compute the concordance matrix.

Returns

concordance matrix

Return type

AdjacencyValueMatrix[QuantitativeScale]

construct()

Compute strong and weak dominance outranking matrices.

Returns

strong outranking matrix, weak outranking matrix

Return type

Tuple[AdjacencyValueMatrix[DiscreteQuantitativeScale], AdjacencyValueMatrix[DiscreteQuantitativeScale]]

discordance()

Compute the discordance matrix.

Returns

discordance matrix

Return type

PartialValueMatrix[QuantitativeScale]

classmethod distillation(strong_outranking_matrix, weak_outranking_matrix, ascending=False)

Compute distillation using outranking matrices.

Parameters
Returns

resulting ranking as an outranking matrix

Return type

AdjacencyValueMatrix[DiscreteQuantitativeScale]

exploit(outranking_structure, **kwargs)

Compute distillations and merge results.

Parameters

outranking_structure (Tuple[AdjacencyValueMatrix[DiscreteQuantitativeScale], AdjacencyValueMatrix[DiscreteQuantitativeScale]]) – strong and weak outranking matrices

Returns

result outranking matrix

Return type

AdjacencyValueMatrix[DiscreteQuantitativeScale]

outranking(concordance_matrix, discordance_matrix, strong=True)

Calculate the outranking matrix according to given thresholds.

Parameters
Returns

outranking matrix

Return type

AdjacencyValueMatrix[DiscreteQuantitativeScale]

rank(**kwargs)

Compute final outranking matrix for Electre II.

Parameters

performance_table

Returns

result outranking matrix

Return type

AdjacencyValueMatrix[DiscreteQuantitativeScale]

class Electre3(performance_table, criteria_weights, indifference_thresholds, preference_thresholds, veto_thresholds, alpha=0.3, beta=-0.15)

Bases: IElectre3, Ranker

This class implements the Electre III algorithm.

Parameters
  • performance_table (PerformanceTable[QuantitativeScale]) –

  • criteria_weights (Dict[Any, float]) –

  • indifference_thresholds (Dict[Any, float]) –

  • preference_thresholds (Dict[Any, float]) –

  • veto_thresholds (Dict[Any, float]) –

  • alpha (float) – preset up values of distillation coefficients

  • beta (float) – preset up values of distillation coefficients

concordance(performance_table=None)

Compute the concordance matrix.

Parameters

performance_table (Optional[PerformanceTable[QuantitativeScale]]) – use performance_table attribute if not provided

Returns

concordance matrix

Return type

AdjacencyValueMatrix[QuantitativeScale]

construct()

Construct outranking structure which is the credibility matrix.

Returns

credibility matrix

Return type

AdjacencyValueMatrix[QuantitativeScale]

credibility(performance_table=None)

Compute the credibility matrix.

Parameters

performance_table (Optional[PerformanceTable[QuantitativeScale]]) – use performance_table attribute if not provided

Returns

credibility matrix

Return type

AdjacencyValueMatrix[QuantitativeScale]

discordance(performance_table=None)

Compute the discordance matrix.

Parameters

performance_table (Optional[PerformanceTable[QuantitativeScale]]) – use performance_table attribute if not provided

Returns

discordance matrix

Return type

PartialValueMatrix[QuantitativeScale]

distillation(credibility_matrix, ascending=False)

Compute distillation.

Parameters
Returns

ranking of categories

Return type

AdjacencyValueMatrix[DiscreteQuantitativeScale]

exploit(outranking_structure, **kwargs)

Compute the complete Electre III exploitation phase.

Parameters

outranking_structure (AdjacencyValueMatrix[QuantitativeScale]) – credibility matrix

Returns

final outranking matrix

Return type

AdjacencyValueMatrix[DiscreteQuantitativeScale]

qualification(credibility_mat)

Compute the qualification for each pair of alternatives a and b.

Parameters

credibility_mat (AdjacencyValueMatrix[QuantitativeScale]) –

Returns

qualifications

Return type

Series

rank(**kwargs)

Compute the complete Electre III algorithm

Returns

final outranking matrix

Return type

AdjacencyValueMatrix[DiscreteQuantitativeScale]

class ElectreTri(performance_table, criteria_weights, profiles, indifference_thresholds, preference_thresholds, veto_thresholds, lambda_, categories=None)

Bases: IElectre3, Assignator, Ranker

This class implements the Electre-Tri B algorithm.

Parameters
  • performance_table (PerformanceTable[QuantitativeScale]) –

  • criteria_weights (Dict[Any, float]) –

  • profiles (PerformanceTable[QuantitativeScale]) – profiles in ascending dominance order

  • indifference_thresholds (Dict[Any, float]) –

  • preference_thresholds (Dict[Any, float]) –

  • veto_thresholds (Dict[Any, float]) –

  • lambda – cut level

  • categories (Optional[List]) – categories in ascending ranking order

  • lambda_ (float) –

Raises
  • ValueError

    • if length of categories is not length of profiles + 1

    • if the profiles are not in ascending dominance order

  • IndexError – if profiles and alternatives share some labels

Attr category_profiles

category profiles formed using categories and profiles

Attr categories

ordered categories defined as a qualitative scale

Note

Implementation and naming conventions are taken from [Vin98b].

assign(pessimistic=False, **kwargs)

Assign alternatives to categories.

Parameters

pessimistic (bool) –

Returns

alternative assignments

Return type

CommensurableValues[QualitativeScale]

Note

the category profiles defining the categories are the ones from category_profiles

concordance(performance_table=None)

Compute the concordance matrix.

Parameters

performance_table (Optional[PerformanceTable[QuantitativeScale]]) – use performance_table attribute if not provided

Returns

concordance matrix

Return type

AdjacencyValueMatrix[QuantitativeScale]

construct()

Construct alternatives and profiles credibility matrix.

Returned credibility matrix concatenates performance_table and profiles (in that order).

Returns

Return type

AdjacencyValueMatrix[QuantitativeScale]

credibility(performance_table=None)

Compute the credibility matrix.

Parameters

performance_table (Optional[PerformanceTable[QuantitativeScale]]) – use performance_table attribute if not provided

Returns

credibility matrix

Return type

AdjacencyValueMatrix[QuantitativeScale]

discordance(performance_table=None)

Compute the discordance matrix.

Parameters

performance_table (Optional[PerformanceTable[QuantitativeScale]]) – use performance_table attribute if not provided

Returns

discordance matrix

Return type

PartialValueMatrix[QuantitativeScale]

exploit(outranking_structure, pessimistic=False, **kwargs)

Compute the exploitation procedure (either optimistically or pessimistically).

Parameters
Returns

alternative assignments

Return type

CommensurableValues[QualitativeScale]

Note

the category profiles defining the categories are the ones from category_profiles

rank(pessimistic=False, **kwargs)

Rank alternatives by their assigned ordered category.

Parameters

pessimistic (bool) –

Returns

alternative assignments

Return type

CommensurableValues[QualitativeScale]

Note

the category profiles defining the categories are the ones from category_profiles

See also

assign()