1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94
|
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/filterParams.R
\name{filterParams}
\alias{filterParams}
\alias{filterParamsNumeric}
\alias{filterParamsDiscrete}
\title{Get parameter subset of only certain parameters.}
\usage{
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
)
}
\arguments{
\item{par.set}{\link{ParamSet}\cr
Parameter set.}
\item{ids}{(\code{NULL} | \code{character})\cr
Vector with id strings containing the parameters to select. Has to be a
subset of the parameter names within the parameter set.
Per default (\code{ids = NULL}) no filtering based on names is done.}
\item{type}{(\code{NULL} | \code{character})\cr
Vector of allowed types, subset of: \dQuote{numeric}, \dQuote{integer},
\dQuote{numericvector}, \dQuote{integervector}, \dQuote{discrete},
\dQuote{discretevector}, \dQuote{logical}, \dQuote{logicalvector},
\dQuote{character}, \dQuote{charactervector}, \dQuote{function},
\dQuote{untyped}.
Setting \code{type = NULL}, which is the default, allows the consideration of all types.}
\item{tunable}{(\code{logical})\cr
Vector of allowed values for the property \code{tunable}. Accepted arguments are
\code{TRUE}, \code{FALSE} or \code{c(TRUE, FALSE)}. The default is \code{c(TRUE, FALSE)}, i.e.
none of the parameters will be filtered out.}
\item{check.requires}{(\code{logical(1)})\cr
Toggle whether it should be checked that all requirements in the
(ParamSet()) are still valid after filtering or not. This check is done
after filtering and will throw an error if those Params are filtered which
other Params need for their requirements. Default is \code{FALSE}.}
\item{include.int}{(\code{logical(1)})\cr
Are integers also considered to be numeric?
Default is \code{TRUE}.}
\item{include.logical}{(\code{logical(1)})\cr
Are logicals also considered to be discrete?
Default is \code{TRUE}.}
}
\value{
\code{\link[=ParamSet]{ParamSet()}}.
}
\description{
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).
}
\examples{
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"))
}
|