Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge master and fix issues raised in pull request
- Loading branch information
Showing
69 changed files
with
1,575 additions
and
1,594 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,5 +30,6 @@ Suggests: | |
roxygen2 | ||
RoxygenNote: 6.1.1 | ||
VignetteBuilder: knitr | ||
Encoding: UTF-8 | ||
Remotes: | ||
mlr-org/mlr3misc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,18 @@ | ||
# Generated by roxygen2: do not edit by hand | ||
|
||
S3method("[",OptPath) | ||
S3method(as.data.frame,OptPath) | ||
export(OptPath) | ||
export(ParamCategorical) | ||
export(ParamFlag) | ||
export(ParamDbl) | ||
export(ParamFct) | ||
export(ParamInt) | ||
export(ParamReal) | ||
export(ParamLgl) | ||
export(ParamSet) | ||
export(ParamUntyped) | ||
export(design_to_list) | ||
export(repeatParam) | ||
export(generate_design_grid) | ||
export(generate_design_lhs) | ||
export(trafo_on_repeated_param) | ||
import(checkmate) | ||
import(data.table) | ||
import(mlr3misc) | ||
importFrom(R6,R6Class) | ||
importFrom(utils,head) | ||
importFrom(utils,tail) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
|
||
|
||
Dependency = R6Class("Dependency", | ||
public = list( | ||
|
||
# member variables | ||
child = NULL, # the subordinate param | ||
parent = NULL, # the (categ) parent param, that the child depends on | ||
|
||
# constructor | ||
initialize = function(child, parent, expr) { | ||
assert_r6(child, "Parameter") | ||
assert_r6(parent, "ParamFct") | ||
self$child = child | ||
self$parent = parent | ||
} | ||
) | ||
) | ||
|
||
DependencyNode = R6Class("DependencyNode", | ||
public = list( | ||
# member variables | ||
param = NULL, | ||
children = NULL, | ||
parents = NULL, | ||
|
||
# constructor | ||
initialize = function(param) { | ||
self$param = param | ||
} | ||
) | ||
) | ||
|
||
|
||
|
||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
#' @title Float Parameter Object | ||
#' @format \code{\link{R6Class}} object | ||
#' | ||
#' @description | ||
#' A \code{\link[R6]{R6Class}} to represent numeric, real valued parameters. | ||
#' | ||
#' @section Member Variables: | ||
#' \describe{ | ||
#' \item{lower}{[\code{numeric(1)}, \code{default = -Inf}] \cr | ||
#' Upper bound for feasible values.} | ||
#' \item{upper}{[\code{integer(1)}, \code{default = Inf}] \cr | ||
#' Lower bound for feasible values.} | ||
#' \item{allow_inf}{[\code{logical(1)}, \code{default = TRUE}] \cr | ||
#' Are values \code{-Inf} and \code{Inf} feasible?} | ||
#' } | ||
#' @export | ||
ParamDbl = R6Class("ParamDbl", inherit = Parameter, | ||
public = list( | ||
initialize = function(id, lower = -Inf, upper = Inf, special_vals = NULL, default = NULL, tags = NULL) { | ||
super$initialize( | ||
id = id, | ||
storage_type = "double", | ||
lower = lower, | ||
upper = upper, | ||
values = NULL, | ||
special_vals = special_vals, | ||
checker = function(x) checkNumber(x, lower = self$lower, upper = self$upper), | ||
default = default, | ||
tags = tags | ||
) | ||
assert_true(lower <= upper) | ||
}, | ||
|
||
denorm_vector = function(x) { | ||
assert_true(self$has_finite_bounds) | ||
self$lower + x * self$span | ||
}, | ||
|
||
value_to_string = function(x, num.format = "%.3g", ...) { | ||
sprintf(num.format, x) | ||
} | ||
), | ||
active = list( | ||
range = function() c(self$lower, self$upper), | ||
has_finite_bounds = function() all(is.finite(self$range)), | ||
center = function() { | ||
assert_true(self$has_finite_bounds) | ||
(self$lower + self$upper) / 2 | ||
}, | ||
span = function() self$upper - self$lower | ||
), | ||
|
||
private = list( | ||
get_range_string = function() sprintf("[%g, %g]", self$lower, self$upper), | ||
get_type_string = function() "d" | ||
) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#' @title Categorical Parameter Object | ||
#' @format \code{\link{R6Class}} object | ||
#' | ||
#' @description | ||
#' A \code{\link[R6]{R6Class}} to represent categorical parameters. | ||
#' | ||
#' @section Member Variables: | ||
#' \describe{ | ||
#' \item{values}{[\code{character}] \cr | ||
#' All categorical values.} | ||
#' } | ||
#' | ||
#' @export | ||
ParamFct = R6Class( | ||
"ParamFct", | ||
inherit = Parameter, | ||
public = list( | ||
initialize = function(id, values, default = NULL, special_vals = NULL, tags = NULL) { | ||
super$initialize( | ||
id = id, | ||
storage_type = "character", | ||
lower = NA_real_, | ||
upper = NA_real_, | ||
values = values, | ||
special_vals = special_vals, | ||
checker = function(x) check_choice(x, choices = self$values), | ||
default = default, | ||
tags = tags | ||
) | ||
}, | ||
|
||
# public methods | ||
denorm_vector = function(x) { | ||
res = cut(x, breaks = seq(0, 1, length.out = self$nlevels+1), include.lowest = TRUE) | ||
levels(res) = self$values | ||
as.character(res) | ||
}, | ||
|
||
value_to_string = function(x, ...) { | ||
x | ||
} | ||
), | ||
active = list( | ||
nlevels = function() length(self$values) | ||
), | ||
private = list( | ||
get_range_string = function() sprintf("{%s}", paste0(self$values, collapse = ",")), | ||
get_type_string = function() "f" | ||
) | ||
) |
Oops, something went wrong.