moocore.is_nondominated#

moocore.is_nondominated(data, maximise=False, keep_weakly=False)[source]#

Identify dominated points according to Pareto optimality.

For two dimensions, the algorithm has complexity \(O(n \log n)\).

Parameters:
  • data (ArrayLike) – Array of numerical values, where each row gives the coordinates of a point in objective space. If the array is created by the read_datasets() function, remove the last column.

  • maximise (bool | list[bool], default: False) – Whether the objectives must be maximised instead of minimised. Either a single boolean value that applies to all objectives or a list of boolean values, with one value per objective. Also accepts a 1D numpy array with value 0/1 for each objective.

  • keep_weakly (bool, default: False) – If False, return False for any duplicates of nondominated points.

Returns:

ndarray – Returns a boolean array of the same length as the number of rows of data, where True means that the point is not dominated by any other point.

See also

filter_dominated

to filter out dominated points.

pareto_rank

to rank points according to Pareto dominance.

Examples

>>> S = np.array([[1, 1], [0, 1], [1, 0], [1, 0]])
>>> moocore.is_nondominated(S)
array([False,  True,  True, False])
>>> moocore.filter_dominated(S)
array([[0, 1],
       [1, 0]])
>>> moocore.is_nondominated(S, keep_weakly=True)
array([False,  True,  True,  True])
>>> moocore.filter_dominated(S, keep_weakly=True)
array([[0, 1],
       [1, 0],
       [1, 0]])