Skip to contents

OptimizerAsyncDesignPoints class that implements optimization w.r.t. fixed design points. We simply search over a set of points fully specified by the ser.

Dictionary

This Optimizer can be instantiated via the dictionary mlr_optimizers or with the associated sugar function opt():

mlr_optimizers$get("async_design_points")
opt("async_design_points")

Parameters

design

data.table::data.table
Design points to try in search, one per row.

Super classes

Optimizer -> OptimizerAsync -> OptimizerAsyncDesignPoints

Methods

Inherited methods


OptimizerAsyncDesignPoints$new()

Creates a new instance of this R6 class.


OptimizerAsyncDesignPoints$optimize()

Starts the asynchronous optimization.

Usage

OptimizerAsyncDesignPoints$optimize(inst)

Arguments

inst

(OptimInstance).


OptimizerAsyncDesignPoints$clone()

The objects of this class are cloneable with this method.

Usage

OptimizerAsyncDesignPoints$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

# example only runs if a Redis server is available
if (mlr3misc::require_namespaces(c("rush", "redux", "mirai"), quietly = TRUE) &&
  redux::redis_available()) {
# define the objective function
fun = function(xs) {
  list(y = - (xs[[1]] - 2)^2 - (xs[[2]] + 3)^2 + 10)
}

# set domain
domain = ps(
  x1 = p_dbl(-10, 10),
  x2 = p_dbl(-5, 5)
)

# set codomain
codomain = ps(
  y = p_dbl(tags = "maximize")
)

# create objective
objective = ObjectiveRFun$new(
  fun = fun,
  domain = domain,
  codomain = codomain,
  properties = "deterministic"
)

# start workers
rush::rush_plan(worker_type = "mirai")
mirai::daemons(1)

# initialize instance
instance = oi_async(
  objective = objective,
  terminator = trm("evals", n_evals = 20)
)

# load optimizer
design = data.table::data.table(x1 = c(0, 1), x2 = c(0, 1))
optimizer = opt("async_design_points", design = design)

# trigger optimization
optimizer$optimize(instance)

# all evaluated configurations
instance$archive

# best performing configuration
instance$archive$best()

# covert to data.table
as.data.table(instance$archive)
}
#>       state    x1    x2     y        timestamp_xs
#>      <char> <num> <num> <num>              <POSc>
#> 1: finished     0     0    -3 2026-07-14 15:10:17
#> 2: finished     1     1    -7 2026-07-14 15:10:17
#>                             worker_id        timestamp_ys
#>                                <char>              <POSc>
#> 1: terrorstricken_prairiedog_fba90bef 2026-07-14 15:10:18
#> 2: terrorstricken_prairiedog_fba90bef 2026-07-14 15:10:18
#>                                    keys x_domain_x1 x_domain_x2
#>                                  <char>       <num>       <num>
#> 1: bdec40c7-f465-4276-9fb2-96eef271d0df           0           0
#> 2: d5c69cd5-7bd7-4e10-8230-7c9e786320f8           1           1