performance — Performance Measurement

Measures for the evaluation of algorithm performance.

class evoalgos.performance.QualityIndicator

Abstract base class for quality indicators.

__str__()

Return the indicator’s name.

assess(population)

Assess a set of individuals.

This is an abstract method.

Parameters:population (sequence of Individual) – The individuals to assess.
assess_non_dom_front(front)

Assess a non-dominated front.

This is an abstract method.

Parameters:front (iterable) – An iterable of points or individuals with the special property that no one is dominated by any other regarding Pareto-dominance.
class evoalgos.performance.PeakRatio(reference_set, required_dist=0.0, dist_matrix_function=None)

The fraction of optima approximated to a certain precision.

__init__(reference_set, required_dist=0.0, dist_matrix_function=None)

Constructor.

Parameters:
  • reference_set (sequence of Individual) – The known optima of an artificial optimization problem.
  • required_dist (float, optional) – An optimum is considered to be approximated if a solution has a distance smaller than this value.
  • dist_matrix_function (callable, optional) – Defines which distance function to use. Default is Euclidean.
covered_optima(population)

Return how many optima are approximated.

Parameters:population (sequence of Individual) – The approximation set.
Returns:num_opt_in_population – The number of approximated optima.
Return type:int
class evoalgos.performance.PeakDistance(reference_set, dist_matrix_function=None)

Mean distance between optima and their nearest neighbor.

__init__(reference_set, dist_matrix_function=None)

Constructor.

Parameters:
  • reference_set (sequence of Individual) – The known optima of an artificial optimization problem.
  • dist_matrix_function (callable, optional) – Defines which distance function to use. Default is Euclidean.
class evoalgos.performance.PeakInaccuracy(reference_set, dist_matrix_function=None)

Mean deviation in objectives between optima and their nearest neighbor.

__init__(reference_set, dist_matrix_function=None)

Constructor.

Parameters:
  • reference_set (sequence of Individual) – The known optima of an artificial optimization problem.
  • dist_matrix_function (callable, optional) – Defines which distance function to use. Default is Euclidean.
class evoalgos.performance.AveragedHausdorffDistance(reference_set, p=1.0, dist_matrix_function=None)

Averaged Hausdorff distance (AHD).

As defined in the paper [Schuetze2012].

References

[Schuetze2012]Schütze, O.; Esquivel, X.; Lara, A.; Coello Coello, Carlos A. (2012). Using the Averaged Hausdorff Distance as a Performance Measure in Evolutionary Multiobjective Optimization. IEEE Transactions on Evolutionary Computation, Vol.16, No.4, pp. 504-522. https://dx.doi.org/10.1109/TEVC.2011.2161872
__init__(reference_set, p=1.0, dist_matrix_function=None)

Constructor.

Parameters:
  • reference_set (sequence of Individual) – The known optima of an artificial optimization problem.
  • p (float, optional) – The exponent in the AHD definition (not for the distance).
  • dist_matrix_function (callable, optional) – Defines which distance function to use. Default is Euclidean.
class evoalgos.performance.HyperVolumeIndicator(reference_point)

Abstract base class for hypervolume indicators.

Measures the dominated hypervolume with regard to a reference point. Such indicators are Pareto-compliant.

Warning

The time for calculating the hypervolume is exponential in the number of objectives.

assess(population)

Assess a set of individuals.

This method identifies the non-dominated front of the population and then assesses it with assess_non_dom_front().

Parameters:population (sequence of Individual) – The individuals to assess.
Returns:indicator_value – A scalar evaluating this population.
Return type:float
calc_contributions(population, others=None, all_non_dominated=False, prefer_boundary_points=False)

Calculate the exclusive contribution of each individual.

This code internally calls the methods assess() or assess_non_dom_front().

Parameters:
  • population (sequence of Individual) – The individuals to assess.
  • others (sequence of Individual, optional) – Other individuals that may decrease the exclusive hypervolume contribution of individuals in the assessed population, but which are not assessed themselves.
  • all_non_dominated (bool, optional) – A flag indicating if population is an antichain.
  • prefer_boundary_points (bool, optional) – Only exists for compatibility with calc_contributions_2d(). Must be false.
Returns:

hv_contributions – A dict with the exclusive hypervolume contribution for each individual.

Return type:

dict

calc_contributions_2d(population, others=None, all_non_dominated=False, prefer_boundary_points=False)

Calculate contributions in the special case of 2 objectives.

This code does not call the methods assess() or assess_non_dom_front(). Only call directly if you are absolutely sure you have two objectives.

Parameters:
  • population (sequence of Individual) – The individuals to assess.
  • others (sequence of Individual, optional) – Other individuals that may decrease the exclusive hypervolume contribution of the assessed population, but which are not assessed themselves.
  • all_non_dominated (bool, optional) – A flag indicating if population is an antichain.
  • prefer_boundary_points (bool, optional) – If true, the two boundary points are assigned an infinite contribution.
Returns:

hv_contributions – A dict with the exclusive hypervolume contribution for each individual.

Return type:

dict

class evoalgos.performance.FonsecaHyperVolume(reference_point)

A hypervolume indicator implementation.

The code is based on variant 3, version 1.2 of the C implementation of the algorithm in [Fonseca2006]. A translation of the points was added so that the reference point is the origin, to obtain a slight speed improvement.

References

[Fonseca2006](1, 2) C. M. Fonseca, L. Paquete, M. Lopez-Ibanez. An improved dimension-sweep algorithm for the hypervolume indicator. In IEEE Congress on Evolutionary Computation, pages 1157-1163, Vancouver, Canada, July 2006.
__init__(reference_point)

Constructor.

Parameters:reference_point (iterable) – The reference point needed for the hypervolume computation.
assess_non_dom_front(front)

Return the hypervolume dominated by a non-dominated front.

Prior to the HV computation, front and reference point are translated so that the reference point is [0, ..., 0].

Parameters:front (iterable) – An iterable of points or individuals with the special property that no one is dominated by any other regarding Pareto-dominance.
Returns:hypervolume – The hypervolume dominated by these points.
Return type:float
hv_recursive(dim_index, length, bounds)

Recursive call to hypervolume calculation.

This method should not be called directly. In contrast to [Fonseca2006], the code assumes that the reference point is [0, ..., 0]. This allows the avoidance of a few operations.

preprocess(front)

Set up the list data structure needed for calculation.

static sort_by_dim(nodes, i)

Sort the list of nodes by the i-th value of the contained points.

class evoalgos.performance.MultiList(num_lists)

A special data structure needed by FonsecaHyperVolume.

It consists of several doubly linked lists that share common nodes. So, every node has multiple predecessors and successors, one in every list.

__init__(num_lists)

Constructor.

Builds num_lists doubly linked lists.

__len__()

Return the number of lists that are included in this MultiList.

__str__()

Return a string representation of this data structure.

append(node, index)

Append a node to the end of the list at the given index.

extend(nodes, index)

Extend the list at the given index with the nodes.

get_length(i)

Return the length of the i-th list.

reinsert(node, index, bounds)

Reinsert a node back into its previous position.

Inserts node at the position it had in all lists in [0, index[ before it was removed. This method assumes that the next and previous nodes of the node that is reinserted are in the list.

remove(node, index, bounds)

Remove and return node from all lists in [0, index[.