total_whv_rect#
- moocore.total_whv_rect(x, /, rectangles, *, ref, maximise=False, ideal=None, scalefactor=0.1)[source]#
- Compute total weighted hypervolume given a set of rectangles. - Calculates the hypervolume weighted by a set of rectangles (with zero weight outside the rectangles). The function - total_whv_rect()calculates the total weighted hypervolume as- hypervolume()- + scalefactor * abs(prod(ref - ideal)) *- whv_rect(). The details of the computation are given by Diaz and López-Ibáñez[1].- Warning - The current implementation only supports 2 objectives. - Parameters:
- x ( - ArrayLike) – Numpy array of numerical values, where each row gives the coordinates of a point. If the array is created from the- read_datasets()function, remove the last column.
- rectangles ( - ArrayLike) – Weighted rectangles that will bias the computation of the hypervolume. Maybe generated by- eafdiff()with- rectangles=Trueor by- choose_eafdiff().
- ref ( - ArrayLike) – Reference point as a 1D vector. Must be same length as a single row in- x.
- maximise ( - boolor- or listof- bool) – 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 values 0 or 1 for each objective.
- ideal ( - ArrayLike|- None, default:- None) – Ideal point as a vector of numerical values. If- None, it is calculated as minimum (or maximum if maximising that objective) of each objective in the input data.
- scalefactor ( - float, default:- 0.1) – Real value within \((0,1]\) that scales the overall weight of the differences. This is parameter psi (\(\psi\)) in Diaz and López-Ibáñez[1].
 
- Returns:
- float– A single numerical value, the weighted hypervolume.
 - See also - References - Examples - >>> rectangles = np.array( ... [ ... [1.0, 3.0, 2.0, np.inf, 1], ... [2.0, 3.5, 2.5, np.inf, 2], ... [2.0, 3.0, 3.0, 3.5, 3], ... ] ... ) >>> whv_rect([[2, 2]], rectangles, ref=6) 4.0 >>> whv_rect([[2, 1]], rectangles, ref=6) 4.0 >>> whv_rect([[1, 2]], rectangles, ref=6) 7.0 >>> total_whv_rect([[2, 2]], rectangles, ref=6, ideal=1) 26.0 >>> total_whv_rect([[2, 1]], rectangles, ref=6, ideal=1) 30.0 >>> total_whv_rect([[1, 2]], rectangles, ref=6, ideal=1) 37.5