epsilon_additive#
- moocore.epsilon_additive(points, /, ref, *, maximise=False)[source]#
Additive epsilon metric.
The current implementation uses the naive algorithm that requires \(O(m \cdot |A| \cdot |R|)\), where \(m\) is the number of objectives (dimension of vectors), \(A\) is the input set and \(R\) is the reference set.
See also
For details of the calculation, see Epsilon metric.
- 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.ref (
ArrayLike) – Reference set as a matrix of numerical values. Must have the same number of columns aspoints.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.
- Returns:
float– A single numerical value.
Examples
>>> import numpy as np >>> dat = np.array([[3.5, 5.5], [3.6, 4.1], [4.1, 3.2], [5.5, 1.5]]) >>> ref = np.array([[1, 6], [2, 5], [3, 4], [4, 3], [5, 2], [6, 1]]) >>> moocore.epsilon_additive(dat, ref=ref) 2.5 >>> moocore.epsilon_mult(dat, ref=ref) 3.5 >>> float(np.exp(moocore.epsilon_additive(np.log(dat), ref=np.log(ref)))) 3.5