A bandit testbed is an experimental framework for evaluating bandit algorithms. You generate random bandit instances, run algorithms on them, and measure performance (cumulative regret, action accuracy).
To fairly compare epsilon-greedy and UCB, you need:
The testbed generates multiple independent bandits and averages the results across them. This controls for randomness in the problem and gives stable performance estimates.
Build a class BanditTestbed with:
__init__(num_arms, num_instances, seed) - creates num_instances random bandits with num_arms armsrun_algorithm(select_fn, num_steps) - runs the selection function for num_steps steps on all instancesget_results() - returns (mean_rewards, optimal_counts, regrets)True rewards are drawn from N(0, 1), then for each step, the agent selects an arm, observes a reward drawn from N(true_reward, 1).
No results yet
Run your code to check it against the examples, or submit to run every test.