any_dominated#
- moocore.any_dominated(points, /, *, maximise=False, keep_weakly=False)[source]#
Test whether the input points contains any (weakly-)dominated point.
This function is equivalent to
np.logical_not(moocore.is_nondominated(x)).any(), but significantly faster.See also
For details about the calculation, see
is_nondominated().- Parameters:
points (
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|Sequence[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, returnTrueif any point is duplicated.
- Returns:
bool– ReturnsTrueif the input array contains at least one point that is weakly-dominated by another point in the array. Withkeep_weakly=True, the point must be dominated not just a duplicate.
Examples
>>> S = np.array([[1, 1], [1, 0], [0, 1], [1, 0]]) >>> moocore.is_nondominated(S) array([False, True, True, False]) >>> moocore.any_dominated(S) True >>> moocore.any_dominated(moocore.filter_dominated(S)) False >>> S = np.array([[0, 1], [1, 0], [1, 0]]) >>> moocore.is_nondominated(S, keep_weakly=True) array([ True, True, True]) >>> moocore.any_dominated(S, keep_weakly=True) False