--- title: Bandits keywords: fastai sidebar: home_sidebar summary: "Bandit models including beta bandit, and epsilon bandit." description: "Bandit models including beta bandit, and epsilon bandit." nb_path: "nbs/models/models.bandits.ipynb" ---
{% raw %}
{% endraw %} {% raw %}
{% endraw %} {% raw %}

class BetaBandit[source]

BetaBandit(alpha:int=0, beta:int=0, alpha_prior:float=1.0, beta_prior:float=1.0)

Bandit class that is used in Thompson sampling. Attributes: alpha: Alpha parameter of the beta distribution (number of positive examples). beta: Beta parameter of the beta distribution (number of negative examples).

Methods: update: Updates alpha and beta priors of the BetaBandit. sample: Samples the BetaBandit's distribution n times.

{% endraw %} {% raw %}
{% endraw %} {% raw %}

class EpsilonBandit[source]

EpsilonBandit(positive_examples:int=0)

Bandit class that is used in Epsilon-greedy multi-armed bandits. Attributes: positive_examples: Number of positive examples.

Methods: update: Updates the number of positive examples of the EpsilonBandit. get_value: Gets the number of positive examples of the EpsilonBandit.

{% endraw %} {% raw %}
{% endraw %}