A collection of multiple ParamSet
objects.
The collection is basically a light-weight wrapper / container around references to multiple sets.
In order to ensure unique param names, every param in the collection is referred to with
"<set_id>.<param_id>", where <set_id>
is the name of the entry a given ParamSet
in the named list given during construction.
Parameters from ParamSet
with empty (i.e. ""
) set_id
are referenced
directly. Multiple ParamSet
s with set_id
""
can be combined, but their parameter names
may not overlap to avoid name clashes.
When you either ask for 'values' or set them, the operation is delegated to the individual,
contained ParamSet
references. The collection itself does not maintain a values
state.
This also implies that if you directly change values
in one of the referenced sets,
this change is reflected in the collection.
Dependencies: It is possible to currently handle dependencies
regarding parameters inside of the same set - in this case simply add the dependency to the set, best before adding the set to the collection
across sets, where a param from one set depends on the state
of a param from another set - in this case add call add_dep
on the collection.
If you call deps
on the collection, you are returned a complete table of dependencies, from sets and across sets.
paradox::ParamSet
-> ParamSetCollection
deps
(data.table::data.table()
)
Table has cols id
(character(1)
) and on
(character(1)
) and cond
(Condition).
Lists all (direct) dependency parents of a param, through parameter IDs.
Internally created by a call to add_dep
.
Settable, if you want to remove dependencies or perform other changes.
extra_trafo
(function(x, param_set)
)
Transformation function. Settable.
User has to pass a function(x)
, of the form
(named list()
, ParamSet) -> named list()
.
The function is responsible to transform a feasible configuration into another encoding,
before potentially evaluating the configuration with the target algorithm.
For the output, not many things have to hold.
It needs to have unique names, and the target algorithm has to accept the configuration.
For convenience, the self-paramset is also passed in, if you need some info from it (e.g. tags).
Is NULL by default, and you can set it to NULL to switch the transformation off.
constraint
(function(x)
)
Constraint function. Settable.
This function must evaluate a named list()
of values and determine whether it satisfies
constraints, returning a scalar logical(1)
value.
sets
(named list()
)
Read-only list
of of ParamSet
s contained in this ParamSetCollection
.
This field provides direct references to the ParamSet
objects.
Inherited methods
paradox::ParamSet$add_dep()
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$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()
paradox::ParamSet$test_constraint_dt()
paradox::ParamSet$test_dt()
paradox::ParamSet$trafo()
new()
Creates a new instance of this R6 class.
ParamSetCollection$new(sets, tag_sets = FALSE, tag_params = FALSE)
sets
(named list()
of ParamSet)
ParamSet objects are not cloned.
Names are used as "set_id" for the naming scheme of delegated parameters.
tag_sets
(logical(1)
)
Whether to add tags of the form "set_<set_id>"
to each parameter originating from a given ParamSet
given with name <set_id>
.
tag_params
(logical(1)
)
Whether to add tags of the form "param_<param_id>"
to each parameter with original ID <param_id>
.
add()
Adds a ParamSet
to this collection.
ParamSetCollection$add(p, n = "", tag_sets = FALSE, tag_params = FALSE)
p
(ParamSet).
n
(character(1)
)
Name to use. Default ""
.
tag_sets
(logical(1)
)
Whether to add tags of the form "set_<n>"
to the newly added parameters.
tag_params
(logical(1)
)
Whether to add tags of the form "param_<param_id>"
to each parameter with original ID <param_id>
.
disable_internal_tuning()
Set the parameter values so that internal tuning for the selected parameters is disabled.
ParamSetCollection$disable_internal_tuning(ids)
ids
(character()
)
The ids of the parameters for which to disable internal tuning.
Self
convert_internal_search_space()
Convert all parameters from the search space to parameter values using the transformation given by
in_tune_fn
.
ParamSetCollection$convert_internal_search_space(search_space)
search_space
(ParamSet
)
The internal search space.
(named list()
)
flatten()
Create a ParamSet
from this ParamSetCollection
.
ParamSetCollection$flatten()
clone()
The objects of this class are cloneable with this method.
ParamSetCollection$clone(deep = FALSE)
deep
Whether to make a deep clone.