From 37e0fbc5be6aa33d41bc32b727fdb7ab2503d24a Mon Sep 17 00:00:00 2001 From: James Fulton Date: Thu, 29 Feb 2024 10:56:58 +0000 Subject: [PATCH 1/3] temporarily move properties --- pvnet/models/base_model.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/pvnet/models/base_model.py b/pvnet/models/base_model.py index 5941971b..285c59d5 100644 --- a/pvnet/models/base_model.py +++ b/pvnet/models/base_model.py @@ -299,14 +299,21 @@ def __init__( self._accumulated_metrics = MetricAccumulator() self._accumulated_batches = BatchAccumulator(key_to_keep=self._target_key_name) self._accumulated_y_hat = PredAccumulator() + + self.use_quantile_regression = self.output_quantiles is not None + + if self.use_quantile_regression: + self.num_output_features = self.forecast_len * len(self.output_quantiles) + else: + self.num_output_features = self.forecast_len @property - def use_quantile_regression(self): + def _use_quantile_regression(self): """Whether the model should use quantile regression or simply predict the mean""" return self.output_quantiles is not None @property - def num_output_features(self): + def _num_output_features(self): """Number of ouput features he model chould predict for""" if self.use_quantile_regression: out_features = self.forecast_len * len(self.output_quantiles) From 2014dce52883d28534614ac656b723d2e0f75bbd Mon Sep 17 00:00:00 2001 From: James Fulton Date: Thu, 29 Feb 2024 11:14:15 +0000 Subject: [PATCH 2/3] remove properties fully --- pvnet/models/base_model.py | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/pvnet/models/base_model.py b/pvnet/models/base_model.py index 285c59d5..5f59400f 100644 --- a/pvnet/models/base_model.py +++ b/pvnet/models/base_model.py @@ -300,26 +300,15 @@ def __init__( self._accumulated_batches = BatchAccumulator(key_to_keep=self._target_key_name) self._accumulated_y_hat = PredAccumulator() + # Store whether the model should use quantile regression or simply predict the mean self.use_quantile_regression = self.output_quantiles is not None + # Store the number of ouput features that the model should predict for if self.use_quantile_regression: self.num_output_features = self.forecast_len * len(self.output_quantiles) else: self.num_output_features = self.forecast_len - @property - def _use_quantile_regression(self): - """Whether the model should use quantile regression or simply predict the mean""" - return self.output_quantiles is not None - - @property - def _num_output_features(self): - """Number of ouput features he model chould predict for""" - if self.use_quantile_regression: - out_features = self.forecast_len * len(self.output_quantiles) - else: - out_features = self.forecast_len - return out_features def _quantiles_to_prediction(self, y_quantiles): """ From 8bb4564c4daf9e0eead8e652c052422691ef37a3 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 29 Feb 2024 11:30:00 +0000 Subject: [PATCH 3/3] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- pvnet/models/base_model.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pvnet/models/base_model.py b/pvnet/models/base_model.py index 5f59400f..e9ebee20 100644 --- a/pvnet/models/base_model.py +++ b/pvnet/models/base_model.py @@ -299,17 +299,16 @@ def __init__( self._accumulated_metrics = MetricAccumulator() self._accumulated_batches = BatchAccumulator(key_to_keep=self._target_key_name) self._accumulated_y_hat = PredAccumulator() - + # Store whether the model should use quantile regression or simply predict the mean self.use_quantile_regression = self.output_quantiles is not None - + # Store the number of ouput features that the model should predict for if self.use_quantile_regression: self.num_output_features = self.forecast_len * len(self.output_quantiles) else: self.num_output_features = self.forecast_len - def _quantiles_to_prediction(self, y_quantiles): """ Convert network prediction into a point prediction.