reagent.ope.test.unit_tests package

Submodules

reagent.ope.test.unit_tests.test_contextual_bandit_estimators module

class reagent.ope.test.unit_tests.test_contextual_bandit_estimators.TestSwitchEstimators(methodName='runTest')

Bases: unittest.case.TestCase

These unit tests verify basic properties of the Switch estimators, in that when the threshold is low, the model-based DM estimator is used and when the threshold is high, the propensity score estimator is used.

DR_EPSILON = 0.05
NUM_ACTIONS = 2
setUp() None

Hook method for setting up the test fixture before exercising it.

test_switch_dr_equal_to_dm()

Switch-DR with tau set at the min value should be equal to DM

test_switch_dr_equal_to_dr()

Switch-DR with tau set at the max value should be equal to DR

test_switch_equal_to_dm()

Switch with tau set at the min value should be equal to DM

test_switch_equal_to_ips()

Switch with tau set at the max value should be equal to IPS

reagent.ope.test.unit_tests.test_slate_estimators module

class reagent.ope.test.unit_tests.test_slate_estimators.TestEstimator(methodName='runTest')

Bases: unittest.case.TestCase

setUp() None

Hook method for setting up the test fixture before exercising it.

test_metrics()
test_slate_item_probabilities()
test_slate_slot_item_probabilities()

reagent.ope.test.unit_tests.test_types module

class reagent.ope.test.unit_tests.test_types.TestDistribution(methodName='runTest')

Bases: unittest.case.TestCase

class TestIntKeyDistribution(values: Union[Mapping[reagent.ope.estimators.types.KeyType, float], Sequence[float], numpy.ndarray, torch.Tensor])

Bases: reagent.ope.estimators.types.ActionDistribution

setUp() None

Hook method for setting up the test fixture before exercising it.

test_sample()
test_values()
class reagent.ope.test.unit_tests.test_types.TestTypes(methodName='runTest')

Bases: unittest.case.TestCase

TestClass

alias of reagent.ope.estimators.types.TypeWrapper[Union[int, Tuple[int], float, Tuple[float], numpy.ndarray, torch.Tensor]]

TestType

alias of Union[int, Tuple[int], float, Tuple[float], numpy.ndarray, torch.Tensor]

setUp() None

Hook method for setting up the test fixture before exercising it.

test_float_type()
test_int_type()
test_ndarray_type()
test_tensor_type()
test_tuple_float_type()
test_tuple_int_type()
class reagent.ope.test.unit_tests.test_types.TestValues(methodName='runTest')

Bases: unittest.case.TestCase

class TestIntKeyValues(values: Union[Mapping[reagent.ope.estimators.types.KeyType, float], Sequence[float], numpy.ndarray, torch.Tensor])

Bases: reagent.ope.estimators.types.Values[reagent.ope.estimators.types.TypeWrapper[int]]

TestIntType

alias of reagent.ope.estimators.types.TypeWrapper[int]

class TestTupleFloatKeyValues(values: Union[Mapping[reagent.ope.estimators.types.KeyType, float], Sequence[float], numpy.ndarray, torch.Tensor])

Bases: reagent.ope.estimators.types.Values[reagent.ope.estimators.types.TypeWrapper[Tuple[float]]]

TestTupleFloatType

alias of reagent.ope.estimators.types.TypeWrapper[Tuple[float]]

setUp() None

Hook method for setting up the test fixture before exercising it.

test_conversion()
test_copy()
test_indexing()
test_sort()
test_unzip()

reagent.ope.test.unit_tests.test_utils module

class reagent.ope.test.unit_tests.test_utils.TestUtils(methodName='runTest')

Bases: unittest.case.TestCase

test_clamper()
test_running_average()

Module contents