is_nondominated#
- moocore.is_nondominated(data, maximise=False, keep_weakly=False)[source]#
Identify dominated points according to Pareto optimality.
Given \(n\) points of dimension \(m\), the current implementation uses the well-known \(O(n \log n)\) dimension-sweep algorithm [1] for \(m \leq 3\) and the naive \(O(m n^2)\) algorithm for \(m \geq 4\).
- 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 theread_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
) – IfFalse
, returnFalse
for any duplicates of nondominated points. Which of the duplicates is identified as nondominated is unspecified due to the sorting not being stable in this version.
- Returns:
ndarray
– Returns a boolean array of the same length as the number of rows of data, whereTrue
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.
References
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]])