Hypervolume#
- class moocore.Hypervolume(ref, maximise=False)[source]#
Object-oriented interface for the hypervolume indicator.
See also
For examples, see
hypervolume().- Parameters:
ref (
ArrayLike) – Reference point as a 1D vector. Must be either a single value, which will be used for all coordinates, or the same length as a single point inpoints.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.
Examples
This function assumes that objectives must be minimized by default. We can easily specify maximization:
>>> hv_ind = moocore.Hypervolume(ref=0, maximise=True) >>> hv_ind([[5, 5], [4, 6], [2, 7], [7, 4]]) 39.0 >>> hv_ind([[5, 5], [4, 6], [7, 4]]) 37.0
See also
RelativeHypervolumeCompute hypervolume relative to a reference set.
- __call__(points)[source]#
Compute hypervolume indicator.
- 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.- Returns:
float– A single numerical value, the hypervolume indicator.