moocore.filter_dominated_within_sets#

moocore.filter_dominated_within_sets(data, /, *, maximise=False, keep_weakly=False)[source]#

Given a dataset with multiple sets (last column gives the set index), filter dominated points within each set.

Executes the filter_dominated() function within each set in a dataset and returns back a dataset. This is roughly equivalent to partitioning ‘data’ according to the last column, filtering dominated solutions within each partition, and joining back the result.

Parameters:
  • data (numpy array) – Numpy array of numerical values and set numbers, containing multiple sets. For example the output of the read_datasets() function

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

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

Returns:

numpy array – A numpy array where each set only contains nondominated points with respect to the set (last column is the set index). Points from one set can still dominated points from another set.

Examples

>>> x = moocore.get_dataset("input1.dat")
>>> pf_per_set = moocore.filter_dominated_within_sets(x)
>>> len(pf_per_set)
42
>>> pf = moocore.filter_dominated(x[:, :-1])
>>> len(pf)
6
>>> pf
array([[0.20816431, 4.62275469],
       [0.22997367, 1.11772205],
       [0.58799475, 0.73891181],
       [1.54506255, 0.38303122],
       [0.17470556, 8.89066343],
       [8.57911868, 0.35169752]])

See also

filter_dominated

to be used with a single dataset.