@@ -547,27 +547,7 @@ def pareto_rank(data, /, *, maximise=False):
547
547
4, 9, 4, 3, 11, 2, 3, 13, 2, 3, 10, 5, 3, 6, 3],
548
548
dtype=int32)
549
549
550
-
551
- We can now sort the points according to their Pareto rank:
552
-
553
- >>> x[ranks.argsort(), :] # doctest: +ELLIPSIS
554
- array([[0.20816431, 4.62275469],
555
- [1.54506255, 0.38303122],
556
- [0.22997367, 1.11772205],
557
- [0.17470556, 8.89066343],
558
- [0.58799475, 0.73891181],
559
- [8.57911868, 0.35169752],
560
- [0.2901393 , 8.32259412],
561
- [6.78498493, 0.56380796],
562
- ...
563
- [9.73057875, 6.15847562],
564
- [8.17231096, 9.76977853],
565
- [9.69531949, 7.22212523],
566
- [9.30608102, 7.69433246],
567
- [8.75833731, 8.98886885]])
568
-
569
-
570
- Or split the original set into a list of nondominated sets ordered by Pareto rank:
550
+ We can now split the original set into a list of nondominated sets ordered by Pareto rank:
571
551
572
552
>>> paretos = [x.compress((g == ranks), axis=0) for g in np.unique(ranks)]
573
553
>>> len(paretos)
@@ -912,7 +892,7 @@ def vorobT(data, /, reference):
912
892
diff = prev_hyp - tmp
913
893
prev_hyp = tmp
914
894
915
- return dict (threshold = c , VE = eaf_res , avg_hyp = avg_hyp )
895
+ return dict (threshold = c , VE = eaf_res , avg_hyp = float ( avg_hyp ) )
916
896
917
897
918
898
def vorobDev (x , / , reference , * , VE = None ) -> float :
@@ -976,16 +956,13 @@ def vorobDev(x, /, reference, *, VE=None) -> float:
976
956
).mean ()
977
957
VD = (
978
958
np .fromiter (
979
- (
980
- hypervolume (np .row_stack ((g , VE )), ref = reference )
981
- for g in x_split
982
- ),
959
+ (hypervolume (np .vstack ((g , VE )), ref = reference ) for g in x_split ),
983
960
dtype = float ,
984
961
count = len (x_split ),
985
962
).mean ()
986
963
* 2.0
987
964
)
988
- return VD - H1 - H2
965
+ return float ( VD - H1 - H2 )
989
966
990
967
991
968
def eafdiff (x , y , / , * , intervals = None , maximise = False , rectangles = False ):
@@ -1093,7 +1070,7 @@ def eafdiff(x, y, /, *, intervals=None, maximise=False, rectangles=False):
1093
1070
cumsizes = np .concatenate ((cumsizes_x , cumsizes_x [- 1 ] + cumsizes_y ))
1094
1071
nsets = len (cumsizes )
1095
1072
1096
- data = np .row_stack ((x [:, :- 1 ], y [:, :- 1 ]))
1073
+ data = np .vstack ((x [:, :- 1 ], y [:, :- 1 ]))
1097
1074
if maximise .any ():
1098
1075
data [:, maximise ] = - data [:, maximise ]
1099
1076
0 commit comments