Skip to content

Commit

Permalink
add the default_trials to constants:
Browse files Browse the repository at this point in the history
  • Loading branch information
codeloop committed Sep 11, 2023
1 parent 8813e40 commit 9f829a3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions ads/opctl/operator/lowcode/forecast/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,4 @@ class SupportedMetrics(str, metaclass=ExtendedEnumMeta):
}

MAX_COLUMNS_AUTOMLX = 15
DEFAULT_TRIALS = 10
3 changes: 2 additions & 1 deletion ads/opctl/operator/lowcode/forecast/model/neuralprophet.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
)
from ads.opctl import logger

from ...forecast.const import DEFAULT_TRIALS
from .. import utils
from .base_model import ForecastOperatorBaseModel

Expand Down Expand Up @@ -167,7 +168,7 @@ def objective(trial):
)
study.optimize(
objective,
n_trials=self.spec.tuning.n_trials if self.spec.tuning else 10,
n_trials=self.spec.tuning.n_trials if self.spec.tuning else DEFAULT_TRIALS,
n_jobs=-1,
)

Expand Down
3 changes: 2 additions & 1 deletion ads/opctl/operator/lowcode/forecast/model/prophet.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

from ads.opctl import logger

from ...forecast.const import DEFAULT_TRIALS
from .. import utils
from .base_model import ForecastOperatorBaseModel

Expand Down Expand Up @@ -144,7 +145,7 @@ def objective(trial):
)
study.optimize(
objective,
n_trials=self.spec.tuning.n_trials if self.spec.tuning else 10,
n_trials=self.spec.tuning.n_trials if self.spec.tuning else DEFAULT_TRIALS,
n_jobs=-1,
)

Expand Down

0 comments on commit 9f829a3

Please sign in to comment.