From 9f3a439dbe0451a864aaea765be2311b07e99842 Mon Sep 17 00:00:00 2001 From: pat-s Date: Mon, 26 Nov 2018 13:38:58 +0100 Subject: [PATCH 1/6] add distinct argument to DiscreteVectorParam --- R/aParam.R | 3 ++- R/makeParamFuns.R | 4 ++-- R/sample.R | 6 +++++- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/R/aParam.R b/R/aParam.R index 6a166fd7..4450dca8 100644 --- a/R/aParam.R +++ b/R/aParam.R @@ -89,7 +89,7 @@ NULL makeParam = function(id, type, learner.param, len = 1L, lower = NULL, upper = NULL, values = NULL, cnames = NULL, allow.inf = FALSE, default, - trafo = NULL, requires = NULL, tunable = TRUE, special.vals = list(), when) { + trafo = NULL, requires = NULL, distinct = FALSE, tunable = TRUE, special.vals = list(), when) { assertString(id) assert( checkCount(len, na.ok = learner.param), @@ -160,6 +160,7 @@ makeParam = function(id, type, learner.param, len = 1L, lower = NULL, upper = NU default = default, trafo = trafo, requires = requires, + distinct = distinct, tunable = tunable, special.vals = special.vals ) diff --git a/R/makeParamFuns.R b/R/makeParamFuns.R index d65c51b0..a3dfcde3 100644 --- a/R/makeParamFuns.R +++ b/R/makeParamFuns.R @@ -67,10 +67,10 @@ makeDiscreteParam = function(id, values, trafo = NULL, default, #' @rdname Param #' @export makeDiscreteVectorParam = function(id, len, values, default, requires = NULL, - tunable = TRUE, special.vals = list()) { + tunable = TRUE, distinct = FALSE, special.vals = list()) { makeParam(id = id, type = "discretevector", learner.param = FALSE, len = len, - values = values, default = default, + values = values, default = default, distinct = distinct, trafo = NULL, requires = requires, tunable = tunable, special.vals = special.vals) } diff --git a/R/sample.R b/R/sample.R index 06e0334d..5f69ff4b 100644 --- a/R/sample.R +++ b/R/sample.R @@ -51,7 +51,11 @@ sampleValue.Param = function(par, discrete.names = FALSE, trafo = FALSE) { } else if (isLogicalTypeString(type)) { x = sample(c(TRUE, FALSE), par$len, replace = TRUE) } else if (isDiscreteTypeString(type, FALSE)) { - x = sample(names(par$values), par$len, replace = TRUE) + if (isTRUE(par$distinct)) { + x = sample(names(par$values), par$len, replace = FALSE) + } else { + x = sample(names(par$values), par$len, replace = TRUE) + } if (!discrete.names) { x = if (type == "discretevector") par$values[x] From 1591af56a86fb9545a39ea84cd44ff219993abab Mon Sep 17 00:00:00 2001 From: pat-s Date: Mon, 26 Nov 2018 13:45:00 +0100 Subject: [PATCH 2/6] add distinct argument to all other VectorParams --- R/makeParamFuns.R | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/R/makeParamFuns.R b/R/makeParamFuns.R index a3dfcde3..2a4e42b5 100644 --- a/R/makeParamFuns.R +++ b/R/makeParamFuns.R @@ -11,11 +11,12 @@ makeNumericParam = function(id, lower = -Inf, upper = Inf, allow.inf = FALSE, #' @rdname Param #' @export makeNumericVectorParam = function(id, len, lower = -Inf, upper = Inf, cnames = NULL, - allow.inf = FALSE, default, trafo = NULL, requires = NULL, + allow.inf = FALSE, default, trafo = NULL, requires = NULL, distinct = FALSE, tunable = TRUE, special.vals = list()) { makeParam(id = id, type = "numericvector", learner.param = FALSE, len = len, lower = lower, upper = upper, cnames = cnames, allow.inf = allow.inf, - default = default, trafo = trafo, requires = requires, tunable = tunable, special.vals = special.vals) + default = default, trafo = trafo, requires = requires, tunable = tunable, + distinct = distinct, special.vals = special.vals) } #' @rdname Param @@ -30,10 +31,11 @@ makeIntegerParam = function(id, lower = -Inf, upper = Inf, default, trafo = NULL #' @rdname Param #' @export makeIntegerVectorParam = function(id, len, lower = -Inf, upper = Inf, cnames = NULL, - default, trafo = NULL, requires = NULL, tunable = TRUE, special.vals = list()) { + default, trafo = NULL, requires = NULL, tunable = TRUE, + distinct = FALSE, special.vals = list()) { makeParam(id = id, type = "integervector", learner.param = FALSE, len = len, lower = lower, upper = upper, cnames = cnames, default = default, trafo = trafo, - requires = requires, tunable = tunable, special.vals = special.vals) + requires = requires, tunable = tunable, distinct = distinct, special.vals = special.vals) } #' @rdname Param @@ -70,8 +72,9 @@ makeDiscreteVectorParam = function(id, len, values, default, requires = NULL, tunable = TRUE, distinct = FALSE, special.vals = list()) { makeParam(id = id, type = "discretevector", learner.param = FALSE, len = len, - values = values, default = default, distinct = distinct, - trafo = NULL, requires = requires, tunable = tunable, special.vals = special.vals) + values = values, default = default, + trafo = NULL, requires = requires, tunable = tunable, + distinct = distinct, special.vals = special.vals) } #' @rdname Param @@ -103,10 +106,11 @@ makeCharacterParam = function(id, default, requires = NULL, special.vals = list( #' @rdname Param #' @export makeCharacterVectorParam = function(id, len, cnames = NULL, default, - requires = NULL, special.vals = list()) { + requires = NULL, distinct = FALSE, special.vals = list()) { makeParam(id = id, type = "charactervector", learner.param = FALSE, len = len, cnames = cnames, default = default, - trafo = NULL, requires = requires, tunable = FALSE, special.vals = special.vals) + trafo = NULL, requires = requires, tunable = FALSE, + distinct = distinct, special.vals = special.vals) } From 908a7f14859e235f836cd7f5ea94ef67e3076bb0 Mon Sep 17 00:00:00 2001 From: pat-s Date: Mon, 26 Nov 2018 13:50:59 +0100 Subject: [PATCH 3/6] add required desc tags --- DESCRIPTION | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 91524f49..82321d43 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -40,4 +40,5 @@ Suggests: LazyData: yes ByteCompile: yes Version: 1.11 -RoxygenNote: 6.0.1 +RoxygenNote: 6.1.1 +Encoding: UTF-8 From d295fb736557640a6c3f4efa984155c01f81f544 Mon Sep 17 00:00:00 2001 From: pat-s Date: Mon, 26 Nov 2018 13:51:25 +0100 Subject: [PATCH 4/6] document --- R/aParam.R | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/R/aParam.R b/R/aParam.R index 4450dca8..057f9313 100644 --- a/R/aParam.R +++ b/R/aParam.R @@ -24,6 +24,7 @@ #' \item{default [any concrete value | \code{expression}]}{See argument of same name.} #' \item{has.default [\code{logical(1)}]}{Extra flag to really be able to check whether the user passed a default, to avoid troubles with \code{NULL} and \code{NA}.} #' \item{tunable [\code{logical(1)}]}{See argument of same name.} +#' \item{distinct [\code{logical(1)}]}{See argument of same name.} #' \item{special.vals [\code{list}]}{See argument of same name.} #' } #' @@ -75,6 +76,9 @@ #' Defining a parameter to be not-tunable allows to mark arguments like, e.g., \dQuote{verbose} or other purely technical stuff. #' Note that this flag is most likely not respected by optimizing procedures unless stated otherwise. #' Default is \code{TRUE} (except for \code{untyped}, \code{function}, \code{character} and \code{characterVector}) which means it is tunable. +#' @param distinct [\code{logical(1)}]\cr +#' Whether sampling with or without replacement should be done for vector params. +#' Default is to sample with replacment (\code{distinct = FALSE}). #' @param special.vals [\code{list()}]\cr #' A list of special values the parameter can except which are outside of the defined range. #' Default is an empty list. From 16282b2a54e53317d35826667b2a9efe66e1a8bb Mon Sep 17 00:00:00 2001 From: pat-s Date: Mon, 26 Nov 2018 13:51:34 +0100 Subject: [PATCH 5/6] man/ --- man/LearnerParam.Rd | 18 +++++++-------- man/OptPath.Rd | 1 + man/Param.Rd | 41 +++++++++++++++++++--------------- man/addOptPathEl.Rd | 1 + man/as.data.frame.OptPathDF.Rd | 6 ++--- man/filterParams.Rd | 4 ++-- man/generateDesign.Rd | 4 ++-- man/getOptPathBestIndex.Rd | 1 + man/getOptPathCol.Rd | 1 + man/getOptPathCols.Rd | 1 + man/getOptPathDOB.Rd | 1 + man/getOptPathEOL.Rd | 1 + man/getOptPathEl.Rd | 1 + man/getOptPathErrorMessages.Rd | 1 + man/getOptPathExecTimes.Rd | 1 + man/getOptPathLength.Rd | 1 + man/getOptPathParetoFront.Rd | 1 + man/getOptPathX.Rd | 1 + man/getOptPathY.Rd | 1 + man/isFeasible.Rd | 5 +++-- man/isRequiresOk.Rd | 3 ++- man/makeParamSet.Rd | 2 -- man/renderOptPathPlot.Rd | 11 ++++----- man/sampleValue.Rd | 2 ++ man/sampleValues.Rd | 2 ++ man/setOptPathElDOB.Rd | 1 + man/setOptPathElEOL.Rd | 1 + 27 files changed, 69 insertions(+), 45 deletions(-) diff --git a/man/LearnerParam.Rd b/man/LearnerParam.Rd index 9dde21a6..ba0a8d22 100644 --- a/man/LearnerParam.Rd +++ b/man/LearnerParam.Rd @@ -14,9 +14,9 @@ \alias{makeFunctionLearnerParam} \title{Create a description object for a parameter of a machine learning algorithm.} \usage{ -makeNumericLearnerParam(id, lower = -Inf, upper = Inf, allow.inf = FALSE, - default, when = "train", requires = NULL, tunable = TRUE, - special.vals = list()) +makeNumericLearnerParam(id, lower = -Inf, upper = Inf, + allow.inf = FALSE, default, when = "train", requires = NULL, + tunable = TRUE, special.vals = list()) makeNumericVectorLearnerParam(id, len = as.integer(NA), lower = -Inf, upper = Inf, allow.inf = FALSE, default, when = "train", @@ -27,8 +27,8 @@ makeIntegerLearnerParam(id, lower = -Inf, upper = Inf, default, special.vals = list()) makeIntegerVectorLearnerParam(id, len = as.integer(NA), lower = -Inf, - upper = Inf, default, when = "train", requires = NULL, tunable = TRUE, - special.vals = list()) + upper = Inf, default, when = "train", requires = NULL, + tunable = TRUE, special.vals = list()) makeDiscreteLearnerParam(id, values, default, when = "train", requires = NULL, tunable = TRUE, special.vals = list()) @@ -89,11 +89,9 @@ Default is \code{NULL} which means no requirements.} \item{tunable}{[\code{logical(1)}]\cr Is this parameter tunable? -Defining a parameter to be not-tunable allows to mark arguments like, e.g., \dQuote{verbose} or -other purely technical stuff, and allows them to be excluded from later automatic optimization -procedures that would try to consider all available parameters. -Default is \code{TRUE} (except for \code{untyped}, \code{function}, \code{character} and -\code{characterVector}) which means it is tunable.} +Defining a parameter to be not-tunable allows to mark arguments like, e.g., \dQuote{verbose} or other purely technical stuff. +Note that this flag is most likely not respected by optimizing procedures unless stated otherwise. +Default is \code{TRUE} (except for \code{untyped}, \code{function}, \code{character} and \code{characterVector}) which means it is tunable.} \item{special.vals}{[\code{list()}]\cr A list of special values the parameter can except which are outside of the defined range. diff --git a/man/OptPath.Rd b/man/OptPath.Rd index e478b795..24181858 100644 --- a/man/OptPath.Rd +++ b/man/OptPath.Rd @@ -87,3 +87,4 @@ Other optpath: \code{\link{addOptPathEl}}, \code{\link{setOptPathElDOB}}, \code{\link{setOptPathElEOL}} } +\concept{optpath} diff --git a/man/Param.Rd b/man/Param.Rd index 3c9498fa..5695d1a3 100644 --- a/man/Param.Rd +++ b/man/Param.Rd @@ -20,28 +20,30 @@ makeNumericParam(id, lower = -Inf, upper = Inf, allow.inf = FALSE, default, trafo = NULL, requires = NULL, tunable = TRUE, special.vals = list()) -makeNumericVectorParam(id, len, lower = -Inf, upper = Inf, cnames = NULL, - allow.inf = FALSE, default, trafo = NULL, requires = NULL, - tunable = TRUE, special.vals = list()) - -makeIntegerParam(id, lower = -Inf, upper = Inf, default, trafo = NULL, - requires = NULL, tunable = TRUE, special.vals = list()) +makeNumericVectorParam(id, len, lower = -Inf, upper = Inf, + cnames = NULL, allow.inf = FALSE, default, trafo = NULL, + requires = NULL, distinct = FALSE, tunable = TRUE, + special.vals = list()) -makeIntegerVectorParam(id, len, lower = -Inf, upper = Inf, cnames = NULL, - default, trafo = NULL, requires = NULL, tunable = TRUE, +makeIntegerParam(id, lower = -Inf, upper = Inf, default, + trafo = NULL, requires = NULL, tunable = TRUE, special.vals = list()) +makeIntegerVectorParam(id, len, lower = -Inf, upper = Inf, + cnames = NULL, default, trafo = NULL, requires = NULL, + tunable = TRUE, distinct = FALSE, special.vals = list()) + makeLogicalParam(id, default, requires = NULL, tunable = TRUE, special.vals = list()) -makeLogicalVectorParam(id, len, cnames = NULL, default, requires = NULL, - tunable = TRUE, special.vals = list()) +makeLogicalVectorParam(id, len, cnames = NULL, default, + requires = NULL, tunable = TRUE, special.vals = list()) makeDiscreteParam(id, values, trafo = NULL, default, requires = NULL, tunable = TRUE, special.vals = list()) makeDiscreteVectorParam(id, len, values, default, requires = NULL, - tunable = TRUE, special.vals = list()) + tunable = TRUE, distinct = FALSE, special.vals = list()) makeFunctionParam(id, default = default, requires = NULL, special.vals = list()) @@ -51,8 +53,8 @@ makeUntypedParam(id, default, requires = NULL, tunable = TRUE, makeCharacterParam(id, default, requires = NULL, special.vals = list()) -makeCharacterVectorParam(id, len, cnames = NULL, default, requires = NULL, - special.vals = list()) +makeCharacterVectorParam(id, len, cnames = NULL, default, + requires = NULL, distinct = FALSE, special.vals = list()) } \arguments{ \item{id}{[\code{character(1)}]\cr @@ -95,11 +97,9 @@ Default is \code{NULL} which means no requirements.} \item{tunable}{[\code{logical(1)}]\cr Is this parameter tunable? -Defining a parameter to be not-tunable allows to mark arguments like, e.g., \dQuote{verbose} or -other purely technical stuff, and allows them to be excluded from later automatic optimization -procedures that would try to consider all available parameters. -Default is \code{TRUE} (except for \code{untyped}, \code{function}, \code{character} and -\code{characterVector}) which means it is tunable.} +Defining a parameter to be not-tunable allows to mark arguments like, e.g., \dQuote{verbose} or other purely technical stuff. +Note that this flag is most likely not respected by optimizing procedures unless stated otherwise. +Default is \code{TRUE} (except for \code{untyped}, \code{function}, \code{character} and \code{characterVector}) which means it is tunable.} \item{special.vals}{[\code{list()}]\cr A list of special values the parameter can except which are outside of the defined range. @@ -113,6 +113,10 @@ Component names for vector params (except discrete). Every function in this package that creates vector values for such a param, will name that vector with \code{cnames}.} +\item{distinct}{[\code{logical(1)}]\cr +Whether sampling with or without replacement should be done for vector params. +Default is to sample with replacment (\code{distinct = FALSE}).} + \item{values}{[\code{vector} | \code{list} | \code{expression}]\cr Possible discrete values. Instead of using a vector of atomic values, you are also allowed to pass a list of quite \dQuote{complex} R objects, @@ -147,6 +151,7 @@ The S3 class is a list which stores these elements: \item{default [any concrete value | \code{expression}]}{See argument of same name.} \item{has.default [\code{logical(1)}]}{Extra flag to really be able to check whether the user passed a default, to avoid troubles with \code{NULL} and \code{NA}.} \item{tunable [\code{logical(1)}]}{See argument of same name.} + \item{distinct [\code{logical(1)}]}{See argument of same name.} \item{special.vals [\code{list}]}{See argument of same name.} } } diff --git a/man/addOptPathEl.Rd b/man/addOptPathEl.Rd index 54a18604..3bd208bf 100644 --- a/man/addOptPathEl.Rd +++ b/man/addOptPathEl.Rd @@ -85,3 +85,4 @@ Other optpath: \code{\link{OptPath}}, \code{\link{setOptPathElDOB}}, \code{\link{setOptPathElEOL}} } +\concept{optpath} diff --git a/man/as.data.frame.OptPathDF.Rd b/man/as.data.frame.OptPathDF.Rd index 7044d812..1593ef63 100644 --- a/man/as.data.frame.OptPathDF.Rd +++ b/man/as.data.frame.OptPathDF.Rd @@ -4,9 +4,9 @@ \alias{as.data.frame.OptPathDF} \title{Convert optimization path to data.frame.} \usage{ -\method{as.data.frame}{OptPathDF}(x, row.names = NULL, optional = FALSE, - include.x = TRUE, include.y = TRUE, include.rest = TRUE, - dob = x$env$dob, eol = x$env$eol, ...) +\method{as.data.frame}{OptPathDF}(x, row.names = NULL, + optional = FALSE, include.x = TRUE, include.y = TRUE, + include.rest = TRUE, dob = x$env$dob, eol = x$env$eol, ...) } \arguments{ \item{x}{[\code{\link{OptPath}}]\cr diff --git a/man/filterParams.Rd b/man/filterParams.Rd index 6667b90c..5b4a94ce 100644 --- a/man/filterParams.Rd +++ b/man/filterParams.Rd @@ -6,8 +6,8 @@ \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) +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) diff --git a/man/generateDesign.Rd b/man/generateDesign.Rd index cf00e866..3b10f547 100644 --- a/man/generateDesign.Rd +++ b/man/generateDesign.Rd @@ -4,8 +4,8 @@ \alias{generateDesign} \title{Generates a statistical design for a parameter set.} \usage{ -generateDesign(n = 10L, par.set, fun, fun.args = list(), trafo = FALSE, - augment = 20L) +generateDesign(n = 10L, par.set, fun, fun.args = list(), + trafo = FALSE, augment = 20L) } \arguments{ \item{n}{[\code{integer(1)}]\cr diff --git a/man/getOptPathBestIndex.Rd b/man/getOptPathBestIndex.Rd index 726e8b58..fb433627 100644 --- a/man/getOptPathBestIndex.Rd +++ b/man/getOptPathBestIndex.Rd @@ -64,3 +64,4 @@ Other optpath: \code{\link{OptPath}}, \code{\link{setOptPathElDOB}}, \code{\link{setOptPathElEOL}} } +\concept{optpath} diff --git a/man/getOptPathCol.Rd b/man/getOptPathCol.Rd index ecf8f9fa..a03f925c 100644 --- a/man/getOptPathCol.Rd +++ b/man/getOptPathCol.Rd @@ -44,3 +44,4 @@ Other optpath: \code{\link{OptPath}}, \code{\link{setOptPathElDOB}}, \code{\link{setOptPathElEOL}} } +\concept{optpath} diff --git a/man/getOptPathCols.Rd b/man/getOptPathCols.Rd index f1bf419b..44955a8b 100644 --- a/man/getOptPathCols.Rd +++ b/man/getOptPathCols.Rd @@ -47,3 +47,4 @@ Other optpath: \code{\link{OptPath}}, \code{\link{setOptPathElDOB}}, \code{\link{setOptPathElEOL}} } +\concept{optpath} diff --git a/man/getOptPathDOB.Rd b/man/getOptPathDOB.Rd index fd0b3758..abea6303 100644 --- a/man/getOptPathDOB.Rd +++ b/man/getOptPathDOB.Rd @@ -41,3 +41,4 @@ Other optpath: \code{\link{OptPath}}, \code{\link{setOptPathElDOB}}, \code{\link{setOptPathElEOL}} } +\concept{optpath} diff --git a/man/getOptPathEOL.Rd b/man/getOptPathEOL.Rd index 425247d6..1c5d61e1 100644 --- a/man/getOptPathEOL.Rd +++ b/man/getOptPathEOL.Rd @@ -41,3 +41,4 @@ Other optpath: \code{\link{OptPath}}, \code{\link{setOptPathElDOB}}, \code{\link{setOptPathElEOL}} } +\concept{optpath} diff --git a/man/getOptPathEl.Rd b/man/getOptPathEl.Rd index b527c856..ee4f37fe 100644 --- a/man/getOptPathEl.Rd +++ b/man/getOptPathEl.Rd @@ -39,3 +39,4 @@ Other optpath: \code{\link{OptPath}}, \code{\link{setOptPathElDOB}}, \code{\link{setOptPathElEOL}} } +\concept{optpath} diff --git a/man/getOptPathErrorMessages.Rd b/man/getOptPathErrorMessages.Rd index 005b6496..b080c506 100644 --- a/man/getOptPathErrorMessages.Rd +++ b/man/getOptPathErrorMessages.Rd @@ -40,3 +40,4 @@ Other optpath: \code{\link{OptPath}}, \code{\link{setOptPathElDOB}}, \code{\link{setOptPathElEOL}} } +\concept{optpath} diff --git a/man/getOptPathExecTimes.Rd b/man/getOptPathExecTimes.Rd index 0e5d8d4f..0c0cebc3 100644 --- a/man/getOptPathExecTimes.Rd +++ b/man/getOptPathExecTimes.Rd @@ -40,3 +40,4 @@ Other optpath: \code{\link{OptPath}}, \code{\link{setOptPathElDOB}}, \code{\link{setOptPathElEOL}} } +\concept{optpath} diff --git a/man/getOptPathLength.Rd b/man/getOptPathLength.Rd index 850e098d..368fa485 100644 --- a/man/getOptPathLength.Rd +++ b/man/getOptPathLength.Rd @@ -31,3 +31,4 @@ Other optpath: \code{\link{OptPath}}, \code{\link{setOptPathElDOB}}, \code{\link{setOptPathElEOL}} } +\concept{optpath} diff --git a/man/getOptPathParetoFront.Rd b/man/getOptPathParetoFront.Rd index bd04df3a..f711b512 100644 --- a/man/getOptPathParetoFront.Rd +++ b/man/getOptPathParetoFront.Rd @@ -61,3 +61,4 @@ Other optpath: \code{\link{OptPath}}, \code{\link{setOptPathElDOB}}, \code{\link{setOptPathElEOL}} } +\concept{optpath} diff --git a/man/getOptPathX.Rd b/man/getOptPathX.Rd index 40a31be4..c1c24805 100644 --- a/man/getOptPathX.Rd +++ b/man/getOptPathX.Rd @@ -40,3 +40,4 @@ Other optpath: \code{\link{OptPath}}, \code{\link{getOptPathY}}, \code{\link{setOptPathElDOB}}, \code{\link{setOptPathElEOL}} } +\concept{optpath} diff --git a/man/getOptPathY.Rd b/man/getOptPathY.Rd index 006b9c46..493c32bf 100644 --- a/man/getOptPathY.Rd +++ b/man/getOptPathY.Rd @@ -48,3 +48,4 @@ Other optpath: \code{\link{OptPath}}, \code{\link{getOptPathX}}, \code{\link{setOptPathElDOB}}, \code{\link{setOptPathElEOL}} } +\concept{optpath} diff --git a/man/isFeasible.Rd b/man/isFeasible.Rd index dc9d288a..5141ec45 100644 --- a/man/isFeasible.Rd +++ b/man/isFeasible.Rd @@ -11,8 +11,9 @@ isFeasible(par, x, use.defaults = FALSE, filter = FALSE) Parameter or parameter set.} \item{x}{[any] \cr -Single value to check. -For a parameter set this must be a list. +Single value to check against the \code{Param} or \code{ParamSet}. +For a \code{ParamSet} \code{x} must be a list. +\code{x} has to contain the untransformed values. If the list is named, it is possible to only pass a subset of parameters defined in the \code{\link{ParamSet}} \code{par}. In that case, only conditions regarding the passed parameters are checked. diff --git a/man/isRequiresOk.Rd b/man/isRequiresOk.Rd index 6201a2c3..f41cacb4 100644 --- a/man/isRequiresOk.Rd +++ b/man/isRequiresOk.Rd @@ -4,7 +4,8 @@ \alias{isRequiresOk} \title{Check if parameter requirements are met.} \usage{ -isRequiresOk(par.set, par.vals, ids = names(par.vals), use.defaults = TRUE) +isRequiresOk(par.set, par.vals, ids = names(par.vals), + use.defaults = TRUE) } \arguments{ \item{par.set}{[\code{\link{ParamSet}}]\cr diff --git a/man/makeParamSet.Rd b/man/makeParamSet.Rd index 8acb1da4..86ab5ae8 100644 --- a/man/makeParamSet.Rd +++ b/man/makeParamSet.Rd @@ -66,8 +66,6 @@ The constructed S3 class is simply a list that contains the element \code{pars}. If \code{keys} are provided it will automatically be checked whether all expressions within the provided parameters only contain arguments that are a subset of keys. - -\code{makeNumericParamSet}: Convenience function for numerics. } \examples{ makeParamSet( diff --git a/man/renderOptPathPlot.Rd b/man/renderOptPathPlot.Rd index 862e3548..c344511c 100644 --- a/man/renderOptPathPlot.Rd +++ b/man/renderOptPathPlot.Rd @@ -4,11 +4,12 @@ \alias{renderOptPathPlot} \title{Function for plotting optimization paths.} \usage{ -renderOptPathPlot(op, iter, x.over.time, y.over.time, contour.name = NULL, - xlim = list(), ylim = list(), alpha = TRUE, log = NULL, - colours = c("red", "blue", "green", "orange"), size.points = 3, - size.lines = 1.5, impute.scale = 1, impute.value = "missing", - scale = "std", ggplot.theme = ggplot2::theme(legend.position = "top"), +renderOptPathPlot(op, iter, x.over.time, y.over.time, + contour.name = NULL, xlim = list(), ylim = list(), alpha = TRUE, + log = NULL, colours = c("red", "blue", "green", "orange"), + size.points = 3, size.lines = 1.5, impute.scale = 1, + impute.value = "missing", scale = "std", + ggplot.theme = ggplot2::theme(legend.position = "top"), marked = NULL, subset.obs, subset.vars, subset.targets, short.x.names, short.y.names, short.rest.names) } diff --git a/man/sampleValue.Rd b/man/sampleValue.Rd index 7467d548..35c63dd5 100644 --- a/man/sampleValue.Rd +++ b/man/sampleValue.Rd @@ -23,6 +23,8 @@ The return type is determined by the type of the parameter. For a set a named li of such values in the correct order is returned. } \description{ +Sample a random value from a parameter or a parameter set uniformly. + Dependent parameters whose requirements are not satisfied are represented by a scalar NA in the output. } \examples{ diff --git a/man/sampleValues.Rd b/man/sampleValues.Rd index 707990f3..9aad73d7 100644 --- a/man/sampleValues.Rd +++ b/man/sampleValues.Rd @@ -25,6 +25,8 @@ Default is \code{FALSE}.} [\code{list}]. For consistency always a list is returned. } \description{ +Sample n random values from a parameter or a parameter set uniformly. + Dependent parameters whose requirements are not satisfied are represented by a scalar NA in the output. } \examples{ diff --git a/man/setOptPathElDOB.Rd b/man/setOptPathElDOB.Rd index d20c9a0f..6142c0ad 100644 --- a/man/setOptPathElDOB.Rd +++ b/man/setOptPathElDOB.Rd @@ -36,3 +36,4 @@ Other optpath: \code{\link{OptPath}}, \code{\link{getOptPathX}}, \code{\link{getOptPathY}}, \code{\link{setOptPathElEOL}} } +\concept{optpath} diff --git a/man/setOptPathElEOL.Rd b/man/setOptPathElEOL.Rd index 3a49a979..d72f42a9 100644 --- a/man/setOptPathElEOL.Rd +++ b/man/setOptPathElEOL.Rd @@ -36,3 +36,4 @@ Other optpath: \code{\link{OptPath}}, \code{\link{getOptPathX}}, \code{\link{getOptPathY}}, \code{\link{setOptPathElDOB}} } +\concept{optpath} From a31341d721018a3359b6df897c89af91e42295c3 Mon Sep 17 00:00:00 2001 From: pat-s Date: Wed, 28 Nov 2018 20:23:26 +0100 Subject: [PATCH 6/6] add trafo arg to makeLogicalVectorParam --- R/makeParamFuns.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/R/makeParamFuns.R b/R/makeParamFuns.R index 2a4e42b5..a2a1ab3f 100644 --- a/R/makeParamFuns.R +++ b/R/makeParamFuns.R @@ -50,11 +50,11 @@ makeLogicalParam = function(id, default, requires = NULL, tunable = TRUE, specia #' @rdname Param #' @export makeLogicalVectorParam = function(id, len, cnames = NULL, default, - requires = NULL, tunable = TRUE, special.vals = list()) { + requires = NULL, tunable = TRUE, trafo = NULL, special.vals = list()) { values = list("TRUE" = TRUE, "FALSE" = FALSE) makeParam(id = id, type = "logicalvector", learner.param = FALSE, len = len, values = values, cnames = cnames, default = default, - trafo = NULL, requires = requires, tunable = tunable, special.vals = special.vals) + trafo = trafo, requires = requires, tunable = tunable, special.vals = special.vals) } #' @rdname Param