largest_eafdiff#
- moocore.largest_eafdiff(x, /, ref, *, maximise=False, intervals=5, ideal=None)[source]#
Identify largest EAF differences.
Given a list of datasets, return the indexes of the pair with the largest EAF differences according to the method proposed by Diaz and López-Ibáñez[1].
Warning
The current implementation only supports 2 objectives.
- Parameters:
x (
list
) – A list of matrices with at least 3 columns (last column indicates the set).ref (
ArrayLike
) – Reference point as a 1D vector. Must be same length as a single point in the input data.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 objectiveintervals (
int
, default:5
) – The absolute range of the differences \([0, 1]\) is partitioned into the number of intervals provided.ideal (
ArrayLike
|None
, default:None
) – Ideal point as a vector of numerical values. IfNone
, it is calculated as minimum (or maximum if maximising that objective) of each objective in the input data.
- Returns:
pair (
tuple[int,int]
) – Pair of indexes into the list that give the largest EAF difference.value (
float
) – Value of the largest difference.
References
Examples
>>> import pandas as pd >>> df = pd.read_csv(moocore.get_dataset_path("tpls50x20_1_MWT.csv")) >>> df algorithm Makespan WeightedTardiness run 0 1to2 4280.0 10231.0 1.0 1 1to2 4238.0 10999.0 1.0 2 1to2 4137.0 11737.0 1.0 3 1to2 4024.0 14871.0 1.0 4 1to2 4014.0 17825.0 1.0 ... ... ... ... ... 1506 double 4048.0 14755.0 15.0 1507 double 3923.0 25507.0 15.0 1508 double 3890.0 29567.0 15.0 1509 double 3862.0 31148.0 15.0 1510 double 4413.0 9894.0 15.0 [1511 rows x 4 columns] >>> nadir = df.iloc[:, 1:3].max().to_numpy() >>> # Split by column 'algorithm' >>> x = [ ... g.drop("algorithm", axis=1) for i, g in df.groupby("algorithm", sort=False) ... ] >>> moocore.largest_eafdiff(x, ref=nadir) ((2, 5), 777017.0)