KernelSyntheticSimulation

class coba.environments.KernelSyntheticSimulation

A synthetic simulation whose reward function is created from kernel basis functions.

Kernel functions are created using random exemplar points generated at initialization and fixed for all time.

Constructors

__init__(n_interactions: int, n_actions: int = 10, n_context_features: int = 10, n_action_features: int = 10, n_exemplars: int = 10, kernel: Literal['linear', 'polynomial', 'exponential', 'gaussian'] = 'gaussian', degree: int = 2, gamma: float = 1, seed: int = 1) None

Instantiate a KernelSyntheticSimulation.

Parameters:
  • n_interactions – The number of interactions the simulation should have.

  • n_actions – The number of actions each interaction should have.

  • n_context_features – The number of features each context should have.

  • n_action_features – The number of features each action should have.

  • n_exemplars – The number of exemplar context-action pairs.

  • kernel – The family of the kernel basis functions.

  • degree – This argument is only relevant when using polynomial kernels.

  • gamma – This argument is only relevant when using exponential kernels.

  • seed – The random number seed used to generate all features, weights and noise in the simulation.

Methods

read() Iterable[SimulatedInteraction]

A sequence of interactions.

Remarks:

This function should always be “re-iterable”.

Attributes

params