| filterParams {ParamHelpers} | R Documentation |
Parameter order is not changed. It is possible to filter via multiple arguments, e.g., first filter based on id, then the type and lastly tunable. The order in which the filters are executed is always fixed (id > type > tunable).
filterParams( par.set, ids = NULL, type = NULL, tunable = c(TRUE, FALSE), check.requires = FALSE ) filterParamsNumeric( par.set, ids = NULL, tunable = c(TRUE, FALSE), include.int = TRUE ) filterParamsDiscrete( par.set, ids = NULL, tunable = c(TRUE, FALSE), include.logical = TRUE )
par.set |
ParamSet |
ids |
( |
type |
( |
tunable |
( |
check.requires |
( |
include.int |
( |
include.logical |
( |
ps = makeParamSet(
makeNumericParam("u", lower = 1),
makeIntegerParam("v", lower = 1, upper = 2),
makeDiscreteParam("w", values = 1:2),
makeLogicalParam("x"),
makeCharacterParam("s"),
makeNumericParam("y", tunable = FALSE)
)
# filter for numeric and integer parameters
filterParams(ps, type = c("integer", "numeric"))
# filter for tunable, numeric parameters
filterParams(ps, type = "numeric", tunable = TRUE)
# filter for all numeric parameters among "u", "v" and "x"
filterParams(ps, type = "numeric", ids = c("u", "v", "x"))