LambdaSimulation

class coba.environments.LambdaSimulation

A contextual bandit environment created from generative lambda functions.

Constructors

__init__(n_interactions: int | None, context: Callable[[int], Context], actions: Callable[[int, Context], Sequence[Action]], reward: Callable[[int, Context, Action], float]) None
__init__(n_interactions: int | None, context: Callable[[int, CobaRandom], Context], actions: Callable[[int, Context, CobaRandom], Sequence[Action]], reward: Callable[[int, Context, Action, CobaRandom], float], seed: int) None

Instantiate a LambdaSimulation.

Methods

read() Iterable[SimulatedInteraction]

A sequence of interactions.

Remarks:

This function should always be “re-iterable”.

Attributes

params