moe.tests.bandit.ucb package

Submodules

moe.tests.bandit.ucb.ucb1_test module

Test UCB1 bandit implementation.

Test default values with one, two, and three arms. Test different cases including unsampled arms and multiple winners.

class moe.tests.bandit.ucb.ucb1_test.TestUCB1[source]

Bases: moe.tests.bandit.ucb.ucb_test_case.UCBTestCase

Verify that different historical infos return correct results.

bandit_class

alias of UCB1

test_init_default()[source]

Verify that default values do not throw and error. This is purely an integration test.

test_one_arm()[source]

Check that the one-arm case always returns the given arm as the winning arm and the allocation is 1.0.

test_three_arms_one_unsampled_arm()[source]

Check that the three-arms cases with integer and float payoffs return the expected arm allocations. When arm3 is the only unsampled arm, we expect all allocation is given to arm3.

test_three_arms_two_winners()[source]

Check that the three-arms cases with two winners return the expected arm allocations. This tests num_arms > num_winning_arms > 1.

test_two_unsampled_arms()[source]

Check that the two-unsampled-arms case always allocate each arm equally (the allocation is 0.5 for both arms). This tests num_unsampled_arms == num_arms > 1.

moe.tests.bandit.ucb.ucb1_tuned_test module

Test UCB1-tuned bandit implementation.

Test default values with one, two, and three arms. Test different cases including unsampled arms and multiple winners.

class moe.tests.bandit.ucb.ucb1_tuned_test.TestUCB1Tuned[source]

Bases: moe.tests.bandit.ucb.ucb_test_case.UCBTestCase

Verify that different historical infos return correct results.

bandit_class

alias of UCB1Tuned

test_init_default()[source]

Verify that default values do not throw and error. This is purely an integration test.

test_one_arm()[source]

Check that the one-arm case always returns the given arm as the winning arm and the allocation is 1.0.

test_three_arms_diferent_variance()[source]

Check that the three-arms cases with different variance (same average payoff) return the expected arm allocations. The highest variance wins.

test_three_arms_one_unsampled_arm()[source]

Check that the three-arms cases with integer and float payoffs return the expected arm allocations. When arm3 is the only unsampled arm, we expect all allocation is given to arm3.

test_three_arms_two_winners()[source]

Check that the three-arms cases with two winners return the expected arm allocations. This tests num_arms > num_winning_arms > 1.

test_two_unsampled_arms()[source]

Check that the two-unsampled-arms case always allocate each arm equally (the allocation is 0.5 for both arms). This tests num_unsampled_arms == num_arms > 1.

moe.tests.bandit.ucb.ucb_test_case module

Base test case class for UCB tests; includes different cases where unsampled arms are winners.

class moe.tests.bandit.ucb.ucb_test_case.UCBTestCase[source]

Bases: moe.tests.bandit.bandit_test_case.BanditTestCase

Base test case for the UCB bandit library.

Module contents

Testing code for the (Python) UCB bandit policies.

Files in this package * moe.tests.bandit.ucb.ucb_test_case: base test case for UCB tests * moe.tests.bandit.ucb.ucb1_test: tests for moe.bandit.ucb.ucb1.UCB1 * moe.tests.bandit.ucb.ucb1_tuned_test: tests for moe.bandit.ucb.ucb1_tuned.UCB1Tuned