R: Optimizer

Optimizer {bbotk} | R Documentation

## Optimizer

### Description

Abstract `Optimizer` class that implements the base functionality each `Optimizer` subclass must provide. A `Optimizer` object describes the optimization strategy. A `Optimizer` object must write its result to the `$assign_result()` method of the OptimInstance at the end in order to store the best point and its estimated performance vector.

### Progress Bars

`$optimize()` supports progress bars via the package progressr combined with a Terminator. Simply wrap the function in `progressr::with_progress()` to enable them. We recommend to use package progress as backend; enable with `progressr::handlers("progress")`.

### Public fields

`id`

  (`character(1)`)
  Identifier of the object. Used in tables, plot and text output.

### Active bindings

`param_set`

  paradox::ParamSet
  Set of control parameters.

`label`

  (`character(1)`)
  Label for this object. Can be used in tables, plot and text output instead of the ID.

`man`

  (`character(1)`)
  String in the format `[pkg]::[topic]` pointing to a manual page for this object. The referenced help package can be opened via method `$help()`.

`param_classes`

  (`character()`)
  Supported parameter classes that the optimizer can optimize. Subclasses of paradox::Param.

`properties`

  (`character()`)
  Set of properties of the optimizer. Must be a subset of `bbotk_reflections$optimizer_properties`.

`packages`

  (`character()`)
  Set of required packages. A warning is signaled by the constructor if at least one of the packages is not installed, but loaded (not attached) later on-demand via `requireNamespace()`.

### Methods

#### Public methods

- `Optimizer$new()`

- `Optimizer$format()`

- `Optimizer$print()`

- `Optimizer$help()`

- `Optimizer$optimize()`

- `Optimizer$clone()`

#### Method `new()`

Creates a new instance of this R6 class.

##### Usage

    Optimizer$new(
      id = "optimizer",
      param_set,
      param_classes,
      properties,
      packages = character(),
      label = NA_character_,
      man = NA_character_
    )

##### Arguments

`id`

  (`character(1)`)
  Identifier for the new instance.

`param_set`

  (paradox::ParamSet)
  Set of control parameters.

`param_classes`

  (`character()`)
  Supported parameter classes that the optimizer can optimize. Subclasses of paradox::Param.

`properties`

  (`character()`)
  Set of properties of the optimizer. Must be a subset of `bbotk_reflections$optimizer_properties`.

`packages`

  (`character()`)
  Set of required packages. A warning is signaled by the constructor if at least one of the packages is not installed, but loaded (not attached) later on-demand via `requireNamespace()`.

`label`

  (`character(1)`)
  Label for this object. Can be used in tables, plot and text output instead of the ID.

`man`

  (`character(1)`)
  String in the format `[pkg]::[topic]` pointing to a manual page for this object. The referenced help package can be opened via method `$help()`.

#### Method `format()`

Helper for print outputs.

##### Usage

    Optimizer$format()

#### Method `print()`

Print method.

##### Usage

    Optimizer$print()

##### Returns

(`character()`).

#### Method `help()`

Opens the corresponding help page referenced by field `$man`.

##### Usage

    Optimizer$help()

#### Method `optimize()`

Performs the optimization and writes optimization result into OptimInstance. The optimization result is returned but the complete optimization path is stored in Archive of OptimInstance.

##### Usage

    Optimizer$optimize(inst)

##### Arguments

`inst`

  (OptimInstance).

##### Returns

data.table::data.table.

#### Method `clone()`

The objects of this class are cloneable with this method.

##### Usage

    Optimizer$clone(deep = FALSE)

##### Arguments

`deep`

  Whether to make a deep clone.

[Package bbotk version 0.5.3 Index]