coba.primitives

Basic building blocks shared across modules.

Type Aliases

These exist to show how data and variables flow through coba objects.

Context

alias of Union[None, str, Number, Sequence, Mapping]

Action

alias of Union[str, Number, Sequence, Mapping]

Actions

alias of Union[None, Sequence[Action]]

Reward

alias of float

Prob

alias of float

Kwargs

alias of Mapping[str, Any]

Pred

alias of Union[Action, Tuple[Action, Prob], Tuple[Action, Kwargs], Tuple[Action, Prob, Kwargs]]

Interfaces

Environment

A source of Interactions.

Learner

An agent that acts and learns.

Evaluator

An evaluator for learners in environments.

Rewards

A function rewarding actions.

EnvironmentFilter

Modify an Environment.

Rewards

L1Reward

A reward function using L1 distance.

BinaryReward

A reward function with two values.

HammingReward

A reward function using Hamming distance.

DiscreteReward

A reward function mapping actions to rewards.

Interactions

Interaction

An interaction in an Environment.

SimulatedInteraction

An interaction with reward information for all actions.

LoggedInteraction

An interaction with a reward and propensity score for an action.

GroundedInteraction

An interaction with feedbacks for Interaction Grounded Learning.