Beispiel #1
0
def test_random_grid_search_for_glm():
    """
    Create and instantiate classes, call test methods to test randomize grid search for GLM Gaussian
    or Binomial families.

    :return: None
    """
    # randomize grid search for Gaussian
    test_glm_gaussian_random_grid = Test_glm_random_grid_search("gaussian")
    test_glm_gaussian_random_grid.test1_glm_random_grid_search_model_number("mse(xval=True)")   # this test must be run.
    test_glm_gaussian_random_grid.test2_glm_random_grid_search_max_model()
    test_glm_gaussian_random_grid.test3_glm_random_grid_search_max_runtime_secs()
    test_glm_gaussian_random_grid.test4_glm_random_grid_search_metric("MSE", False)
#    test_glm_gaussian_random_grid.test4_glm_random_grid_search_metric("r2", True)  # R2 was removed as a stopping metric
    # test_glm_gaussian_random_grid.tear_down()  # obsolete

    # exit with error if any tests have failed
    if test_glm_gaussian_random_grid.test_failed > 0:
        sys.exit(1)
    else:
        pyunit_utils.remove_files(os.path.join(test_glm_gaussian_random_grid.current_dir,
                                               test_glm_gaussian_random_grid.json_filename))
Beispiel #2
0
 def tear_down(self):
     pyunit_utils.remove_files(
         os.path.join(self.current_dir, self.json_filename))
     pyunit_utils.remove_files(
         os.path.join(self.current_dir, self.json_filename_bad))
 def tear_down(self):
     pyunit_utils.remove_files(os.path.join(self.current_dir, self.json_filename))
     pyunit_utils.remove_files(os.path.join(self.current_dir, self.json_filename_bad))