Skip to contents

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 ParamSets 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.

Super class

paradox::ParamSet -> ParamSetCollection

Active bindings

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.

values

(named list())
Currently set / fixed parameter values. Settable, and feasibility of values will be checked when you set them. You do not have to set values for all parameters, but only for a subset. When you set values, all previously set values will be unset / removed.

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 ParamSets contained in this ParamSetCollection. This field provides direct references to the ParamSet objects.

Methods

Inherited methods


Method new()

Creates a new instance of this R6 class.

Usage

ParamSetCollection$new(sets, tag_sets = FALSE, tag_params = FALSE)

Arguments

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>.


Method add()

Adds a ParamSet to this collection.

Usage

ParamSetCollection$add(p, n = "", tag_sets = FALSE, tag_params = FALSE)

Arguments

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>.


Method clone()

The objects of this class are cloneable with this method.

Usage

ParamSetCollection$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.