Skip to contents

This function computes the EAF given a set of 2D or 3D points and a vector set that indicates to which set each point belongs.

Usage

eaf(x, sets, percentiles = NULL, maximise = FALSE, groups = NULL)

Arguments

x

matrix()|data.frame()
Matrix or data frame of numerical values, where each row gives the coordinates of a point. If sets is missing, the last column of x gives the sets.

sets

integer()
A vector that indicates the set of each point in x. If missing, the last column of x is used instead.

percentiles

numeric()
Vector indicating which percentiles are computed. NULL computes all.

maximise

logical()
Whether the objectives must be maximised instead of minimised. Either a single logical value that applies to all objectives or a vector of logical values, with one value per objective.

groups

factor()
Indicates that the EAF must be computed separately for data belonging to different groups.

Value

data.frame()
A data frame containing the exact representation of EAF. The last column gives the percentile that corresponds to each point. If groups is not NULL, then an additional column indicates to which group the point belongs.

Note

There are several examples of data sets in system.file(package="moocore","extdata"). The current implementation only supports two and three dimensional points.

References

Grunert01moocore

FonGueLopPaq2011emomoocore

See also

Author

Manuel López-Ibáñez

Examples

extdata_path <- system.file(package="moocore", "extdata")

x <- read_datasets(file.path(extdata_path, "example1_dat"))
# Compute full EAF (sets is the last column)
str(eaf(x))
#>  num [1:215, 1:3] 5128176 5134240 5142568 5144532 5155408 ...

# Compute only best, median and worst
str(eaf(x[,1:2], sets = x[,3], percentiles = c(0, 50, 100)))
#>  num [1:50, 1:3] 5128176 5134240 5142568 5144532 5155408 ...

x <- read_datasets(file.path(extdata_path, "spherical-250-10-3d.txt"))
y <- read_datasets(file.path(extdata_path, "uniform-250-10-3d.txt"))
x <- rbind(data.frame(x, groups = "spherical"),
           data.frame(y, groups = "uniform"))
# Compute only median separately for each group
z <- eaf(x[,1:3], sets = x[,4], groups = x[,5], percentiles = 50)
str(z)
#> 'data.frame':	12650 obs. of  5 variables:
#>  $ X1    : num  0.865 0.787 0.682 0.739 0.865 ...
#>  $ X2    : num  0.966 0.966 0.997 0.966 0.926 ...
#>  $ X3    : num  0.00264 0.00421 0.00483 0.00449 0.00421 ...
#>  $ X4    : num  50 50 50 50 50 50 50 50 50 50 ...
#>  $ groups: chr  "spherical" "spherical" "spherical" "spherical" ...