Skip to content
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

Implement min_train_series_length() method for the FourTheta model #1101

Closed
rijkvandermeulen opened this issue Jul 28, 2022 · 2 comments
Closed
Labels
triage Issue waiting for triaging

Comments

@rijkvandermeulen
Copy link
Contributor

rijkvandermeulen commented Jul 28, 2022

Is your feature request related to a current problem? Please describe.
The FourTheta model extends the ForecastingModel class which has a class property defining the minimum required length for the training series (min_train_series_length). This property defautlts to 3 but can be overriden for each child class inherenting from ForecastingModel . Now, I'm missing the method that overrides this min_train_series_length in the case of the FourTheta model. I'm pretty sure the Theta model requires at least 2 * seasonality_period in case seasonality is used (i.e. season_mode != SeasonalityMode.NONE).

When you currently try to fit a seasonal FourTheta model when you have < 2*seasonality_period observations, it errors out when it tries to do a seasonal_decomposition in extract_trend_and_seasonality(). Would it be an idea to already capture this in an earlier stage by implementing the min_train_series_length() method

Describe proposed solution
Implement min_train_series_length() method for the FourTheta model overwriting the default of 3. Something like:

if self.season_mode.value: return self.seasonality_period * 2 else: return 3
Might be a bit more nuance to the abovementioned solution since seasonality_period is an optional param and can also be retrieved from the time series. Hence, if seasonality_period=None we need to first retrieve the seasonality_period.

Describe potential alternatives

Additional context

@rijkvandermeulen rijkvandermeulen added the triage Issue waiting for triaging label Jul 28, 2022
@hrzn
Copy link
Contributor

hrzn commented Jul 30, 2022

Thanks, that makes sense. Would you be willing to open a PR with this change?

@rijkvandermeulen
Copy link
Contributor Author

Sure, let me give that a try!

rijkvandermeulen pushed a commit to rijkvandermeulen/darts that referenced this issue Aug 1, 2022
hrzn added a commit to rijkvandermeulen/darts that referenced this issue Aug 7, 2022
hrzn added a commit to rijkvandermeulen/darts that referenced this issue Aug 7, 2022
hrzn added a commit to rijkvandermeulen/darts that referenced this issue Aug 7, 2022
rijkvandermeulen pushed a commit to rijkvandermeulen/darts that referenced this issue Aug 8, 2022
hrzn added a commit to rijkvandermeulen/darts that referenced this issue Aug 9, 2022
hrzn added a commit to rijkvandermeulen/darts that referenced this issue Aug 9, 2022
hrzn added a commit that referenced this issue Aug 9, 2022
)

* #1101 Implemented min_train_series_length for Theta and FourTheta

* #1103 Placed changelog entry under the Unreleased section

Co-authored-by: Rijk van der Meulen <rijk.vandermeulen@eyeon.nl>
Co-authored-by: Julien Herzen <julien@unit8.co>
@hrzn hrzn closed this as completed Aug 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage Issue waiting for triaging
Projects
None yet
Development

No branches or pull requests

2 participants