Skip to contents

Abstract base class for objects that sample points from a search space.

A SpaceSampler can sample directly from a paradox::ParamSet or thin down an existing candidate pool. Some samplers may additionally make use of a known_pool of already-known points. The intended contract is that pool and known_pool are disjoint, but this is not checked.

If pool is given and n >= nrow(pool), the full pool is returned directly.

Creates a new space sampler.

Sample n points from the search space or thin down a pool.

Arguments

id

(character(1))
Identifier of the sampler.

deterministic

(logical(1))
Whether $sample() is a deterministic function of its arguments, i.e. does not depend on the RNG state. Deterministic samplers return identical batches when called repeatedly with unchanged inputs.

packages

(character())
Optional package names required by the sampler.

param_set

(paradox::ParamSet)
Configuration parameter set.

label

(character(1))
Label for the object.

man

(character(1))
String in the format [pkg]::[topic] pointing to a manual page.

additional_phash_input

(character())
Additional private/public fields used for persistent hashing.

n

(integer(1))
Number of points to sample.

search_space

(paradox::ParamSet)
Search space describing the point columns.

pool

(NULL | data.table)
Optional candidate pool to sample from.

known_pool

(NULL | data.table)
Optional already-known points that may influence the sampler.

Value

data.table.

Fields

deterministic

(logical(1)) Whether $sample() is a deterministic function of its arguments (no RNG dependence), so repeated calls with unchanged inputs return identical batches.

Dictionary

This class can be retrieved from mlr_space_samplers via clx_sps() and clx_spss().