--- title: Epsilon keywords: fastai sidebar: home_sidebar summary: "ϵ-greedy algorithmic modules." description: "ϵ-greedy algorithmic modules." nb_path: "nbs/models/epsilon.ipynb" ---
{% raw %}
{% endraw %} {% raw %}
{% endraw %} {% raw %}

class EpsilonGreedy[source]

EpsilonGreedy(epsilon:float=0.2, batch_size:int=1000)

Class that is used to run a Epsilon-greedy multi-armed bandits test. Attributes: epsilon: Percentage of exploration. batch_size: Number of examples per batch.

Methods: add_bandit: Adds a new BetaBandit to the test. update_bandit: Updates the priors of the BetaBandit at index idx. add_best_bandit: Adds the best bandit of the current batch. bandit_batch: Determines how many times each bandit gets used in the running batch.

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

class EpsilonGreedyRunner[source]

EpsilonGreedyRunner(bandit_returns:List[float], epsilon:float=0.2, batch_size:int=10000, batches:int=10, simulations:int=100)

Class that is used to run simulations of Thompson sampling tests. Attributes: bandit_returns: List of average returns per bandit. epsilon: Percentage of exploration. batch_size: Number of examples per batch. batches: Number of batches. simulations: Number of simulations.

Methods: init_bandits: Prepares everything for new simulation. run: Runs the simulations and tracks performance.

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