-
Notifications
You must be signed in to change notification settings - Fork 914
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat/Pass kwargs to the underlying models fit functions #2460
base: master
Are you sure you want to change the base?
Changes from 4 commits
52ec07d
ac6283d
d148ecf
939498a
f5c5a51
697cf7a
616a44e
bc3b4fd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -2902,7 +2902,12 @@ class FutureCovariatesLocalForecastingModel(LocalForecastingModel, ABC): | |||||
All implementations must implement the :func:`_fit()` and :func:`_predict()` methods. | ||||||
""" | ||||||
|
||||||
def fit(self, series: TimeSeries, future_covariates: Optional[TimeSeries] = None): | ||||||
def fit( | ||||||
self, | ||||||
series: TimeSeries, | ||||||
future_covariates: Optional[TimeSeries] = None, | ||||||
**fit_kwargs, | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would call it Also, should we add this to all forecasting models? E.g.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The main concern I have here is the
@dennisbader What do you think? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looking through the code, there are some more models where I find it difficult to deal with the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Yes, I see your point. We could do something like this:
What do you think? |
||||||
): | ||||||
"""Fit/train the model on the (single) provided series. | ||||||
|
||||||
Optionally, a future covariates series can be provided as well. | ||||||
|
@@ -2915,6 +2920,9 @@ def fit(self, series: TimeSeries, future_covariates: Optional[TimeSeries] = None | |||||
A time series of future-known covariates. This time series will not be forecasted, but can be used by | ||||||
some models as an input. It must contain at least the same time steps/indices as the target `series`. | ||||||
If it is longer than necessary, it will be automatically trimmed. | ||||||
fit_kwargs | ||||||
Optional keyword arguments that will be passed to the fit function of the underlying model if supported | ||||||
by the underlying model. | ||||||
|
||||||
Returns | ||||||
------- | ||||||
|
@@ -2946,7 +2954,7 @@ def fit(self, series: TimeSeries, future_covariates: Optional[TimeSeries] = None | |||||
|
||||||
super().fit(series) | ||||||
|
||||||
return self._fit(series, future_covariates=future_covariates) | ||||||
return self._fit(series, future_covariates=future_covariates, **fit_kwargs) | ||||||
|
||||||
@abstractmethod | ||||||
def _fit(self, series: TimeSeries, future_covariates: Optional[TimeSeries] = None): | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once all suggestions have been addressed, we could formulate it as below :)