k-Armed Bandit 1.0.0
A collection of k-armed bandits and assoicated agents for reinforcement learning
|
Test case to verify behavior of the epsilon greedy agent implementation. More...
Public Member Functions | |
None | setUp (self) |
Create an agent to use for tests. | |
test_action_selection (self) | |
Test appropriate actions are selected. | |
test_epsilon_bounds (self) | |
Test that epsilon only accepts probability values. | |
test_update (self) | |
Test that the update works correctly. | |
Public Attributes | |
agent | |
Test case to verify behavior of the epsilon greedy agent implementation.
Definition at line 6 of file test_epsilon_greedy.py.
None agent.tests.test_epsilon_greedy.TestEpsilonGreedy.setUp | ( | self | ) |
Create an agent to use for tests.
Definition at line 11 of file test_epsilon_greedy.py.
agent.tests.test_epsilon_greedy.TestEpsilonGreedy.test_action_selection | ( | self | ) |
Test appropriate actions are selected.
As the agent can select via explore or exploit, no specific action is assumed. So this just tests that all selected actions are within the correct range of [0, k).
Definition at line 17 of file test_epsilon_greedy.py.
agent.tests.test_epsilon_greedy.TestEpsilonGreedy.test_epsilon_bounds | ( | self | ) |
Test that epsilon only accepts probability values.
Definition at line 30 of file test_epsilon_greedy.py.
agent.tests.test_epsilon_greedy.TestEpsilonGreedy.test_update | ( | self | ) |
Test that the update works correctly.
The agent uses a weighted average, so use known values to ensure correct calculation.
Definition at line 44 of file test_epsilon_greedy.py.
agent.tests.test_epsilon_greedy.TestEpsilonGreedy.agent |
Definition at line 15 of file test_epsilon_greedy.py.