moocore.igd_plus#
- moocore.igd_plus(data, /, ref, *, maximise=False)[source]#
Modified IGD (IGD+).
IGD+ is a Pareto-compliant version of
igd()
proposed by Ishibuchi et al.1.See also
For details of the calculation, see Inverted Generational Distance (IGD and IGD+) and Averaged Hausdorff Distance.
- Parameters:
data (
ArrayLike
) – 2D matrix of numerical values, where each row gives the coordinates of a point in objective space. If the array is created from theread_datasets()
function, remove the last (set) column.ref (
ArrayLike
) – Reference point (1D vector). Must have same length as the number of column indata
.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
>>> 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.igd(dat, ref=ref) 1.0627908666722465 >>> moocore.igd_plus(dat, ref=ref) 0.9855036468106652 >>> moocore.avg_hausdorff_dist(dat, ref) 1.0627908666722465
Example 4 by Ishibuchi et al.1 shows a case where IGD gives the wrong answer. In this case A is better than B in terms of Pareto optimality.
>>> ref = np.array([10, 0, 6, 1, 2, 2, 1, 6, 0, 10]).reshape(-1, 2) >>> A = np.array([4, 2, 3, 3, 2, 4]).reshape(-1, 2) >>> B = np.array([8, 2, 4, 4, 2, 8]).reshape(-1, 2) >>> print( ... f"IGD(A)={moocore.igd(A, ref)} > IGD(B)={moocore.igd(B, ref)}\n" ... + f"and AvgHausdorff(A)={moocore.avg_hausdorff_dist(A, ref)} > " ... + f"AvgHausdorff(B)={moocore.avg_hausdorff_dist(B, ref)},\n" ... + f"which both contradict Pareto optimality. By contrast,\n" ... + f"IGD+(A)={moocore.igd_plus(A, ref)} < IGD+(B)={moocore.igd_plus(B, ref)}," ... + " which is correct." ... ) IGD(A)=3.707092031609239 > IGD(B)=2.59148346584763 and AvgHausdorff(A)=3.707092031609239 > AvgHausdorff(B)=2.59148346584763, which both contradict Pareto optimality. By contrast, IGD+(A)=1.482842712474619 < IGD+(B)=2.260112615949154, which is correct.