Shared types

Shared public types for PyMAB.

class PolicyCapabilities[source]

Bases: object

Static compatibility information for a policy implementation.

contextual: bool
reward_domains: frozenset[RewardDomain]
objective: PolicyObjective = 'cumulative_reward'
__init__(contextual, reward_domains, objective=PolicyObjective.CUMULATIVE_REWARD)
Parameters:
Return type:

None

class PolicyObjective[source]

Bases: Enum

Primary objective optimized by a policy.

CUMULATIVE_REWARD = 'cumulative_reward'
BEST_ARM = 'best_arm'
classmethod __contains__(value)

Return True if value is in cls.

value is in cls if: 1) value is a member of cls, or 2) value is the value of one of the cls’s members. 3) value is a pseudo-member (flags)

classmethod __getitem__(name)

Return the member matching name.

classmethod __iter__()

Return members in definition order.

classmethod __len__()

Return the number of members (no aliases)

class RewardDomain[source]

Bases: Enum

Mathematical support required by an environment or policy.

REAL = 'real'
UNIT_INTERVAL = 'unit_interval'
BINARY = 'binary'
classmethod __contains__(value)

Return True if value is in cls.

value is in cls if: 1) value is a member of cls, or 2) value is the value of one of the cls’s members. 3) value is a pseudo-member (flags)

classmethod __getitem__(name)

Return the member matching name.

classmethod __iter__()

Return members in definition order.

classmethod __len__()

Return the number of members (no aliases)