| InputTrafoUnitcube | R Documentation |
Input transformation that performs for each numeric and integer feature min-max scaling to [\0, 1\] based on the boundaries of the search space.
[\0, 1]: R:%5C%5C0,%201%5C
mlr3mbo::InputTrafo -> InputTrafoUnitcube
packages(character())
Set of required packages.
A warning is signaled if at least one of the packages is not installed, but loaded (not attached) later on-demand via requireNamespace().
new()Creates a new instance of this R6 class.
InputTrafoUnitcube$new()
update()Learn the transformation based on observed data and update parameters in $state.
InputTrafoUnitcube$update(xdt)
xdt(data.table::data.table())
Data. One row per observation with at least columns $cols_x.
transform()Perform the transformation.
InputTrafoUnitcube$transform(xdt)
xdt(data.table::data.table())
Data. One row per observation with at least columns $cols_x.
data.table::data.table() with the transformation applied to the columns $cols_x (if applicable) or a subset thereof.
clone()The objects of this class are cloneable with this method.
InputTrafoUnitcube$clone(deep = FALSE)
deepWhether to make a deep clone.
Other Input Transformation:
InputTrafo,
mlr_input_trafos
if (requireNamespace("mlr3learners") &
requireNamespace("DiceKriging") &
requireNamespace("rgenoud")) {
library(bbotk)
library(paradox)
library(mlr3learners)
fun = function(xs) {
list(y = xs$x ^ 2)
}
domain = ps(x = p_dbl(lower = -10, upper = 10))
codomain = ps(y = p_dbl(tags = "minimize"))
objective = ObjectiveRFun$new(fun = fun, domain = domain, codomain = codomain)
instance = OptimInstanceBatchSingleCrit$new(
objective = objective,
terminator = trm("evals", n_evals = 5))
xdt = generate_design_random(instance$search_space, n = 4)$data
instance$eval_batch(xdt)
learner = default_gp()
input_trafo = it("unitcube")
surrogate = srlrn(learner, input_trafo = input_trafo, archive = instance$archive)
surrogate$update()
surrogate$input_trafo$state
surrogate$predict(data.table(x = c(-1, 0, 1)))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.