def test_class_fractions_to_num_examples_wind_xsmall(self): """Ensures correct output from class_fractions_to_num_examples. In this case, target variable = wind-speed class and number of examples to draw is extra small. """ this_dict = dl_utils.class_fractions_to_num_examples( sampling_fraction_by_class_dict= SAMPLING_FRACTION_BY_WIND_3CLASS_DICT, target_name=WIND_TARGET_NAME_3CLASSES, num_examples_total=NUM_EXAMPLES_XSMALL) self.assertTrue(this_dict == NUM_EXAMPLES_XSMALL_BY_WIND_3CLASS_DICT)
def test_class_fractions_to_num_examples_tornado_xsmall(self): """Ensures correct output from class_fractions_to_num_examples. In this case, target variable = tornado occurrence and number of examples to draw is extra small. """ this_dict = dl_utils.class_fractions_to_num_examples( sampling_fraction_by_class_dict= SAMPLING_FRACTION_BY_TORNADO_CLASS_DICT, target_name=TORNADO_TARGET_NAME, num_examples_total=NUM_EXAMPLES_XSMALL) self.assertTrue(this_dict == NUM_EXAMPLES_XSMALL_BY_TORNADO_CLASS_DICT)