June 2018
Intermediate to advanced
318 pages
9h 24m
English
We have already learned a lot about the epsilon-greedy policy. In the epsilon-greedy policy, either we select the best arm with a probability 1-epsilon or we select the arms at random with a probability epsilon:

Now we will see how to select the best arm using the epsilon-greedy policy:
# number of rounds (iterations)num_rounds = 20000# Count of number of times an arm was pulledcount = np.zeros(10)# Sum of rewards of each armsum_rewards = np.zeros(10)# Q value which is the average rewardQ = np.zeros(10)
def epsilon_greedy(epsilon): ...
Read now
Unlock full access