From 3aa5c970298fb5bfd3924f305b25ef42e257cade Mon Sep 17 00:00:00 2001 From: Timon Erhart <57718207+turbotimon@users.noreply.github.com> Date: Wed, 19 Feb 2025 14:57:35 +0100 Subject: [PATCH] add public function untrained_model() in docs (#2684) * remove untrained_model from autodoc exclude-members * update changelog and untrained_model docs --------- Co-authored-by: dennisbader --- CHANGELOG.md | 2 ++ darts/models/forecasting/forecasting_model.py | 2 +- docs/source/conf.py | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0c08004b1f..3c1d5d4d9c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,8 @@ but cannot always guarantee backwards compatibility. Changes that may **break co **Improved** +- Made method `ForecastingModel.untrained_model()` public. Use this method to get a new (untrained) model instance created with the same parameters. [#2684](https://github.com/unit8co/darts/pull/2684) by [Timon Erhart](https://github.com/turbotimon) + **Fixed** **Dependencies** diff --git a/darts/models/forecasting/forecasting_model.py b/darts/models/forecasting/forecasting_model.py index 39dbe08ea0..f9b56242ca 100644 --- a/darts/models/forecasting/forecasting_model.py +++ b/darts/models/forecasting/forecasting_model.py @@ -2601,7 +2601,7 @@ def _extract_model_creation_params(self): return model_params def untrained_model(self): - """Returns a new (untrained) model instance create with the same parameters.""" + """Returns a new (untrained) model instance created with the same parameters.""" return self.__class__(**copy.deepcopy(self.model_params)) @property diff --git a/docs/source/conf.py b/docs/source/conf.py index 8e368f7e9d..ad96924d78 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -54,7 +54,7 @@ + "PastCovariatesTorchModel,FutureCovariatesTorchModel,DualCovariatesTorchModel,MixedCovariatesTorchModel," + "SplitCovariatesTorchModel," + "min_train_series_length," - + "untrained_model,first_prediction_index,future_covariate_series,past_covariate_series," + + "first_prediction_index,future_covariate_series,past_covariate_series," + "initialize_encoders,register_datapipe_as_function,register_function,functions," + "SplitTimeSeriesSequence,randint,AnomalyModel", }