epsilon_additive#

moocore.epsilon_additive(data, /, ref, *, maximise=False)[source]#

Additive epsilon metric.

The current implementation uses the naive algorithm that requires \(O(n \cdot |A| \cdot |R|)\), where \(n\) 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:
  • data (ArrayLike) – Numpy array of numerical values, where each row gives the coordinates of a point in objective space. If the array is created from the read_datasets() function, remove the last (set) column

  • ref (ArrayLike) – Reference point set as a numpy array or list. Must have same number of columns as a single point in the dataset

  • 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

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