SamplesGenerator

class aixd.sampler.sampler.SamplesGenerator(strategies: List[Strategy], objective: Operator | None = None, condition: Boolean | None = None, callbacks_class: SamplingCallback | None = None)[source]

Bases: object

Samples values according to certain strategies and by, optionally, optimising objectives and respecting conditions. The strategies define how samples for each of the features are generated, the objectives inform the underlying engines (like Bayesian Optimization) and the conditions define which samples to keep and which to discard.

Parameters:
  • strategies (List[Strategy]) – List of strategies to be used for sampling.

  • objective (Operator, optional, default=None) – Objective to be optimised. The sampler is trained using the objective values of the samples, in order to optimize future sampling campaigns,

  • condition (Boolean, optional, default=None) – Condition that the samples should satisfy. This does not affect the sampling process, but only the samples that satisfy the condition are returned.

  • callbacks_class (SamplingCallback, optional, default=None) – In case we want to run some function on the samples obtained in the sampling process. This is intended for advanced usage.

Methods

fit

Initialises strategies and engines that sample according to some prior distribution.

generate

Generates n samples in iterations number of iterations and in batches of pool_size per iteration.

reset_states

Resetting the states of the strategies