banditpylib.learners.thresholding_bandit_learner
¶
Classes¶
ThresholdingBanditLearner
: Abstract class for learners playing with thresholding banditAPT
: Anytime Parameter-free Thresholding algorithmUniform
: Uniform Sampling
- class banditpylib.learners.thresholding_bandit_learner.ThresholdingBanditLearner(arm_num: int, name: Optional[str])[source]¶
Abstract class for learners playing with thresholding bandit
- Parameters
arm_num (int) – number of arms
name (Optional[str]) – alias name
Inheritance
- property arm_num: int¶
Number of arms
- property running_environment: Union[type, List[type]]¶
Type of bandit environment the learner plays with
- class banditpylib.learners.thresholding_bandit_learner.APT(arm_num: int, theta: float, eps: float, name: Optional[str] = None)[source]¶
Anytime Parameter-free Thresholding algorithm [LGC16]
- Parameters
arm_num (int) – number of arms
theta (float) – threshold
eps (float) – radius of indifferent zone
name (Optional[str]) – alias name
Inheritance
- actions(context: data_pb2.Context) → data_pb2.Actions[source]¶
Actions of the learner
- Parameters
context – contextual information about the bandit environment
- Returns
actions to take
- property goal: banditpylib.learners.utils.Goal¶
Goal of the learner
- class banditpylib.learners.thresholding_bandit_learner.Uniform(arm_num: int, theta: float, eps: float, name: Optional[str] = None)[source]¶
Uniform Sampling
Sample each arm in a round-robin way.
- Parameters
arm_num (int) – number of arms
theta (float) – threshold
eps (float) – radius of indifferent zone
name (Optional[str]) – alias name
Inheritance
- actions(context: data_pb2.Context) → data_pb2.Actions[source]¶
Actions of the learner
- Parameters
context – contextual information about the bandit environment
- Returns
actions to take
- property goal: banditpylib.learners.utils.Goal¶
Goal of the learner