Learn R Programming

irace (version 4.1)

parameters: Create a parameter space to be tuned.

Description

  • param_cat() creates a categorical parameter.

  • param_ord() creates an ordinal parameter.

  • param_real() creates a real-valued parameter.

  • param_int() creates an integer parameter.

Usage

parametersNew(..., forbidden = NULL, debugLevel = 0L)

param_cat(name = name, values, label = "", condition = TRUE)

param_ord(name, values, label = "", condition = TRUE)

param_real( name, lower, upper, label = "", condition = TRUE, transf = "", digits = 15L )

param_int(name, lower, upper, label = "", condition = TRUE, transf = "")

Value

ParameterSpace

Arguments

...

one or more parameters created by param_int(), param_real(), param_ord(), or param_cat().

forbidden

expression()|character(1)
String or list of expressions that define forbidden parameter configurations.

debugLevel

integer(1)
Larger values produce more verbose output.

name

character(1)
Parameter name (must be alphanumeric).

values

character()
Domain as a vector of strings.

label

character(1)
Label associated to the parameter. Often used to encode a command-line switch that activates the parameter.

condition

expression(1)|character(1)
Expression that defines when the parameter is active according to the value of other parameters.

lower, upper

Lower and upper limits of the valid domain.

transf

character(1)
If "log", then the parameter is sampled in a logarithmic scale.

digits

integer(1)
The number of decimal places to be considered for real-valued parameters.

Examples

Run this code
digits <- 4L
parametersNew(
   param_cat(name = "algorithm", values = c("as", "mmas", "eas", "ras", "acs"), label = "--"),
   param_ord(name = "localsearch", values = c("0", "1", "2", "3"), label = "--localsearch "),
   param_real(name = "alpha", lower = 0.0, upper=5.0, label = "--alpha ", digits = digits),
   param_real(name = "beta", lower = 0.0, upper = 10.0, label = "--beta ", digits = digits),
   param_real(name = "rho", lower = 0.01, upper = 1.00, label = "--rho ", digits = digits),
   param_int(name = "ants", lower = 5, upper = 100, transf = "log", label = "--ants "),
   param_real(name = "q0", label = "--q0 ", lower=0.0, upper=1.0,
              condition = expression(algorithm == "acs")),
   param_int(name = "rasrank", label = "--rasranks ", lower=1, upper=quote(min(ants, 10)),
             condition = 'algorithm == "ras"'),
   param_int(name = "elitistants", label = "--elitistants ", lower=1, upper=expression(ants),
             condition = 'algorithm == "eas"'),
   param_int(name = "nnls", label = "--nnls ", lower = 5, upper = 50,
             condition = expression(localsearch %in% c(1,2,3))),
   param_cat(name = "dlb",  label = "--dlb ", values = c(0,1),
             condition = "localsearch %in% c(1,2,3)"),
   forbidden = "(alpha == 0) & (beta == 0)")

Run the code above in your browser using DataLab