From 962d3e7b77d6648940b729dca52e7a6865fa5ac3 Mon Sep 17 00:00:00 2001 From: christopherbunn Date: Mon, 14 Aug 2023 10:59:02 -0400 Subject: [PATCH] Moved number of simulations as constant. --- .../estimators/regressors/exponential_smoothing_regressor.py | 4 +++- .../components/estimators/regressors/varmax_regressor.py | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/evalml/pipelines/components/estimators/regressors/exponential_smoothing_regressor.py b/evalml/pipelines/components/estimators/regressors/exponential_smoothing_regressor.py index 091f3fb1c2..1706927401 100644 --- a/evalml/pipelines/components/estimators/regressors/exponential_smoothing_regressor.py +++ b/evalml/pipelines/components/estimators/regressors/exponential_smoothing_regressor.py @@ -27,6 +27,8 @@ class ExponentialSmoothingRegressor(Estimator): random_seed (int): Seed for the random number generator. Defaults to 0. """ + _N_REPETITIONS = 400 + name = "Exponential Smoothing Regressor" hyperparameter_ranges = { "trend": [None, "additive"], @@ -167,7 +169,7 @@ def get_prediction_intervals( # anchor represents where the simulations should start from (forecasting is done from the "end") y_pred = self._component_obj._fitted_forecaster.simulate( nsimulations=X.shape[0], - repetitions=400, + repetitions=self._N_REPETITIONS, anchor="end", random_state=self.parameters["random_state"], ) diff --git a/evalml/pipelines/components/estimators/regressors/varmax_regressor.py b/evalml/pipelines/components/estimators/regressors/varmax_regressor.py index 36d5fa0258..ecca230042 100644 --- a/evalml/pipelines/components/estimators/regressors/varmax_regressor.py +++ b/evalml/pipelines/components/estimators/regressors/varmax_regressor.py @@ -34,6 +34,8 @@ class VARMAXRegressor(Estimator): solely be based off of the datetimes and target values. Defaults to True. """ + _N_REPETITIONS = 400 + name = "VARMAX Regressor" hyperparameter_ranges = { "p": Integer(0, 10), @@ -235,7 +237,7 @@ def get_prediction_intervals( # anchor represents where the simulations should start from (forecasting is done from the "end") y_pred = self._component_obj._fitted_forecaster.simulate( nsimulations=X.shape[0], - repetitions=400, + repetitions=self._N_REPETITIONS, anchor="end", random_state=self.random_seed, exog=X if use_exog else None,