Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

getOptPathBestIndex

Get index of the best element from optimization path.


Description

Get index of the best element from optimization path.

Usage

getOptPathBestIndex(
  op,
  y.name = op$y.names[1],
  dob = op$env$dob,
  eol = op$env$eol,
  ties = "last"
)

Arguments

op

OptPath
Optimization path.

y.name

(character(1))
Name of target value to decide which element is best. Default is y.names[1].

dob

integer
Vector of date-of-birth values to further subset the result. Only elements with a date-of-birth included in dob are selected. Default is all.

eol

integer
Vector of end-of-life values to further subset the result. Only elements with an end-of-life included in eol are selected. Default is all.

ties

(character(1))
How should ties be broken when more than one optimal element is found? “all”: return all indices, “first”: return first optimal element in path, “last”: return last optimal element in path, “random”: return random optimal element in path. Default is “last”.

Value

integer Index or indices into path. See ties.

See Also

Examples

ps = makeParamSet(makeNumericParam("x"))
op = makeOptPathDF(par.set = ps, y.names = "y", minimize = TRUE)
addOptPathEl(op, x = list(x = 1), y = 5)
addOptPathEl(op, x = list(x = 2), y = 3)
addOptPathEl(op, x = list(x = 3), y = 9)
addOptPathEl(op, x = list(x = 4), y = 3)
as.data.frame(op)
getOptPathBestIndex(op)
getOptPathBestIndex(op, ties = "first")

ParamHelpers

Helpers for Parameters in Black-Box Optimization, Tuning and Machine Learning

v1.14
BSD_2_clause + file LICENSE
Authors
Bernd Bischl [aut] (<https://orcid.org/0000-0001-6002-6980>), Michel Lang [aut] (<https://orcid.org/0000-0001-9754-0393>), Jakob Richter [cre, aut] (<https://orcid.org/0000-0003-4481-5554>), Jakob Bossek [aut], Daniel Horn [aut], Karin Schork [ctb], Pascal Kerschke [aut]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.