ArmsΒΆ
See here the documentation: docs/Arms
Arms : contains different types of bandit arms:
Constant, UniformArm, Bernoulli, Binomial, Poisson, Gaussian, Exponential, Gamma.
Each arm class follows the same interface:
>>> my_arm = Arm(params)
>>> my_arm.mean
0.5
>>> my_arm.draw()  # one random draw
0.0
>>> my_arm.draw_nparray(20)  # or ((3, 10)), many draw
array([ 0.,  1.,  0.,  0.,  0.,  0.,  0.,  1.,  1.,  0.,  1.,  0.,  0.,
        1.,  0.,  0.,  0.,  1.,  1.,  1.])
Also the __init__.py file contains:
- uniformMeans, to generate uniformly spaced means of arms.
- uniformMeansWithSparsity, to generate uniformly spaced means of arms, with sparsity constraints.
- randomMeans, to generate randomly spaced means of arms.
- randomMeansWithGapBetweenMbestMworst, to generate randomly spaced means of arms, with a constraint on the gap between the M-best arms and the (K-M)-worst arms.
- randomMeans, to generate randomly spaced means of arms.
- shuffled, to return a shuffled version of a list.
- Utility functions array_from_strlist_from_strandtuple_from_strto obtain anumpy.ndarray, alistor atuplefrom a string (used for the CLI env variables interface).
- optimal_selection_probabilities.