Wraps another ParamSet and shadows out a subset of its Domains.
The original ParamSet can still be accessed through the $origin field;
otherwise, the ParamSetShadow behaves like a ParamSet where the shadowed
Domains are not present.
paradox::ParamSet -> ParamSetShadow
params(named list())
Table of rows identifying the contained Domains
params_unid(named list of Param)
List of Param that are members of the wrapped ParamSet with the
shadowed Params removed. This is a field mostly for internal usage that has the
$ids set to invalid values but avoids cloning overhead.
Deprecated by the upcoming paradox package update and will be removed in the future.
deps(data.table)
Table of dependencies, as in ParamSet. The dependencies that are related to shadowed
parameters are not exposed. This data.table should be seen as read-only and not
modified in-place; instead, the $origin's $deps should be modified.
values(named list)
List of values, as in ParamSet, with the shadowed values removed.
set_id(data.table)
Id of the wrapped ParamSet. Changing this value will also change the wrapped ParamSet's $set_id accordingly.
origin(ParamSet)
ParamSet being wrapped. This object can be modified by reference to influence the ParamSetShadow object itself.
Inherited methods
paradox::ParamSet$aggr_internal_tuned_values()paradox::ParamSet$assert()paradox::ParamSet$assert_dt()paradox::ParamSet$check()paradox::ParamSet$check_dependencies()paradox::ParamSet$check_dt()paradox::ParamSet$convert_internal_search_space()paradox::ParamSet$disable_internal_tuning()paradox::ParamSet$flatten()paradox::ParamSet$format()paradox::ParamSet$get_domain()paradox::ParamSet$get_values()paradox::ParamSet$ids()paradox::ParamSet$print()paradox::ParamSet$qunif()paradox::ParamSet$search_space()paradox::ParamSet$set_values()paradox::ParamSet$subset()paradox::ParamSet$subspaces()paradox::ParamSet$test()paradox::ParamSet$test_constraint_dt()paradox::ParamSet$test_dt()paradox::ParamSet$trafo()
new()Initialize the ParamSetShadow object.
ParamSetShadow$new(set, shadowed)set(ParamSet)
ParamSet to wrap.
shadowed(character)
Ids of Domains to shadow from sets, must be a subset of set$ids().
test_constraint()Checks underlying ParamSet's constraint.
It uses the underlying $values for shadowed values.
ParamSetShadow$test_constraint(x, ...)x(named list) values to test
...Further arguments passed to ParamSet's $test_constraint() function.
logical(1).
add_dep()Adds a dependency to the unterlying ParamSet.
ParamSetShadow$add_dep(id, on, cond, allow_dangling_dependencies = FALSE, ...)id(character(1))
on(character(1))
cond(Condition)
allow_dangling_dependencies(logical(1)): Whether to allow dependencies on parameters that are not present.
...Further arguments passed to ParamSet's $add_dep() function.
invisible(self).
clone()The objects of this class are cloneable with this method.
ParamSetShadow$clone(deep = FALSE)deepWhether to make a deep clone.
p1 = ps(x = p_dbl(0, 1), y = p_lgl())
p1$values = list(x = 0.5, y = TRUE)
print(p1)
p2 = ParamSetShadow$new(p1, "x")
print(p2$values)
p2$values$y = FALSE
print(p2)
print(p2$origin$values)
Run the code above in your browser using DataLab