Hypervolume#
- class moocore.Hypervolume(ref, maximise=False)[source]#
Object-oriented interface for the hypervolume indicator.
See also
For details about parameters, return value and examples, see
hypervolume()
.- Parameters:
ref (
ArrayLike
) – Reference point as a 1D vector. Must be same length as a single point in thedata
.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 booleans, with one value per objective. Also accepts a 1D numpy array with value 0/1 for each objective
Examples
Default is minimization, we can easily assume 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
- __call__(data)[source]#
Compute hypervolume indicator.
- Parameters:
data (
ArrayLike
) – Numpy array of numerical values, where each row gives the coordinates of a point. If the array is created from theread_datasets()
function, remove the last column.- Returns:
float
– A single numerical value, the hypervolume indicator