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.

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,
  postfix_names = 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>.

postfix_names

(logical(1))
Whether to use the names inside sets as postfixes, rather than prefixes.


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 subset()

Create a new ParamSet restricted to the passed IDs.

Usage

ParamSetCollection$subset(
  ids,
  allow_dangling_dependencies = FALSE,
  keep_constraint = TRUE
)

Arguments

ids

(character()).

allow_dangling_dependencies

(logical(1))
Whether to allow subsets that cut across parameter dependencies. Dependencies that point to dropped parameters are kept (but will be "dangling", i.e. their "on" will not be present).

keep_constraint

(logical(1))
Whether to keep the $constraint function.

Returns

ParamSet.


Method disable_internal_tuning()

Set the parameter values so that internal tuning for the selected parameters is disabled.

Usage

ParamSetCollection$disable_internal_tuning(ids)

Arguments

ids

(character())
The ids of the parameters for which to disable internal tuning.

Returns

Self


Method convert_internal_search_space()

Convert all parameters from the search space to parameter values using the transformation given by in_tune_fn.

Usage

ParamSetCollection$convert_internal_search_space(search_space)

Arguments

search_space

(ParamSet)
The internal search space.

Returns

(named list())


Method flatten()

Create a ParamSet from this ParamSetCollection.

Usage

ParamSetCollection$flatten()


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.