Esempio n. 1
0
 def test_set_model_time_limit(self):
     model_type = "Xgboost"
     automl = AutoML(results_path=self.automl_dir,
                     model_time_limit=10,
                     algorithms=[model_type])
     automl._estimate_training_times()
     print(automl._time_limit)
     for _ in range(12):
         automl.log_train_time(model_type, 10)
         # should be always true
         self.assertTrue(automl._enough_time_to_train(model_type))
Esempio n. 2
0
    def test_set_total_time_limit(self):
        model_type = "Xgboost"
        automl = AutoML(results_path=self.automl_dir,
                        total_time_limit=100,
                        algorithms=[model_type])
        automl._estimate_training_times()
        time_spend = 0
        for _ in range(12):
            automl.log_train_time(model_type, 10)
            if automl._enough_time_to_train(model_type):
                time_spend += 10

        self.assertTrue(time_spend < 100)
    def test_bin_class_01(self):
        X = np.random.rand(self.rows, 3)
        X = pd.DataFrame(X, columns=[f"f{i}" for i in range(3)])
        y = np.random.randint(0, 2, self.rows)

        automl = AutoML(
            results_path=self.automl_dir,
            total_time_limit=1,
            tuning_mode="Insane",
            algorithms=["Xgboost"],
        )
        automl._estimate_training_times()
        self.assertEqual(automl._start_random_models, 15)
    def test_set_model_time_limit_omit_total_time(self):
        model_type = "Xgboost"
        automl = AutoML(
            results_path=self.automl_dir,
            model_time_limit=10,
            total_time_limit=10,  # this parameter setting should be omitted
            algorithms=[model_type],
        )
        automl._estimate_training_times()

        for _ in range(12):
            automl.log_train_time(model_type, 10)
            # should be always true
            self.assertTrue(automl._enough_time_to_train(model_type))
    def test_enough_time_to_train(self):
        model_type = "Xgboost"
        model_type_2 = "LightGBM"

        automl = AutoML(
            results_path=self.automl_dir,
            total_time_limit=10,  # this parameter setting should be omitted
            algorithms=[model_type, model_type_2],
        )
        automl._estimate_training_times()

        for i in range(5):
            # should be always true
            self.assertTrue(automl._enough_time_to_train(model_type))
            automl.log_train_time(model_type, 1)