| r2_exact | R Documentation |
Computes the exact R2 indicator with respect to a given ideal/utopian reference point assuming minimization of all objectives.
r2_exact(x, reference, maximise = FALSE)
x |
|
reference |
|
maximise |
|
The unary R2 indicator is a quality indicator for a set A \subset
\mathbb{R}^m w.r.t. an ideal or utopian reference point
\vec{r} \in \mathbb{R}^m. It was originally proposed by
\citetHanJas1998 and is defined as the expected Tchebycheff utility under a
uniform distribution of weight vectors (w.l.o.g. assuming minimization):
R2(A) := \int_{w \in W} \min_{a \in A} \left\{ \max_{i=1,\dots,m} w_i
(a_i - r_i) \right\} \, dw,
where W denotes the uniform distribution across weights:
W = \{w \in \mathbb{R}^m \mid w_i \geq 0, \sum_{i=1}^m w_i = 1\}.
The R2 indicator is to be minimized and has an optimal value of 0 when
\vec{r} \in A.
The exact R2 indicator is strongly Pareto-compliant, i.e., compatible with Pareto-optimality:
\forall A, B \subset \mathbb{R}^m: A \prec B \Rightarrow R2(A) <
R2(B).
Given an ideal or utopian reference point, which is available in most scenarios, all non-dominated solutions always contribute to the value of the exact R2 indicator. However, it is scale-dependent and care should be taken such that all objectives contribute approximately equally to the indicator, e.g., by normalizing the Pareto front to the unit hypercube.
The current implementation exclusively supports bi-objective solution sets
and runs in O(n \log n) following \citetSchKer2025r2v2.
numeric(1) A single numerical value.
dat <- matrix(c(5, 5, 4, 6, 2, 7, 7, 4), ncol = 2, byrow = TRUE)
r2_exact(dat, reference = c(0, 0))
# This function assumes minimisation by default. We can easily specify maximisation:
r2_exact(dat, reference = c(10, 10), maximise = TRUE)
# Merge all the sets of a dataset by removing the set number column:
extdata_path <- system.file(package="moocore","extdata")
dat <- read_datasets(file.path(extdata_path, "example1_dat"))[, 1:2]
nrow(dat)
# Dominated points are ignored, so this:
r2_exact(dat, reference = 0)
# gives the same exact R2 value as this:
dat <- filter_dominated(dat)
nrow(dat)
r2_exact(dat, reference = 0)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.