diff --git a/supervised/algorithms/catboost.py b/supervised/algorithms/catboost.py index 5aa68cd0..331be4cc 100644 --- a/supervised/algorithms/catboost.py +++ b/supervised/algorithms/catboost.py @@ -68,7 +68,7 @@ def __init__(self, params): logger.debug("CatBoostAlgorithm.__init__") - def _assess_iterations(self, X, y, eval_set, max_time): + def _assess_iterations(self, X, y, eval_set, max_time = None): if max_time is None: max_time = 3600 try: @@ -85,8 +85,8 @@ def _assess_iterations(self, X, y, eval_set, max_time): verbose_eval=False, ) elapsed_time = np.round(time.time() - start_time, 2) - new_rounds = int(min(10000, max_time / elapsed_time * 2.0)) - new_rounds = max(max_rounds, 100) + new_rounds = int(min(10000, max_time / elapsed_time)) + new_rounds = max(max_rounds, 10) return new_rounds except Exception as e: return 1000 @@ -122,10 +122,9 @@ def fit( ) # disable for now ... - # new_iterations = self._assess_iterations(X, y, eval_set, max_time) - # self.model.set_params(iterations=new_iterations) - - self.model.set_params(iterations=self.rounds) + new_iterations = self._assess_iterations(X, y, eval_set, max_time = None) + self.model.set_params(iterations=new_iterations) + #self.model.set_params(iterations=self.rounds) self.model.fit( X, diff --git a/supervised/tuner/time_controller.py b/supervised/tuner/time_controller.py index 972f4e00..6ed92b8a 100644 --- a/supervised/tuner/time_controller.py +++ b/supervised/tuner/time_controller.py @@ -68,7 +68,7 @@ def time_should_use(self, fit_level): "insert_random_feature": 0.05, "features_selection": 0.05, "hill_climbing_1": 0.2, # enough to have only first step from hill climbing - "boost_on_errors": 0.1, + "boost_on_errors": 0.05, "stack": 0.15, }