@@ -281,6 +281,7 @@ def min_train_samples(self) -> int:
281
281
return 1
282
282
283
283
@property
284
+ @abstractmethod
284
285
def extreme_lags (
285
286
self ,
286
287
) -> Tuple [
@@ -335,8 +336,7 @@ def extreme_lags(
335
336
>>> model.extreme_lags
336
337
(-10, 6, None, None, 4, 6)
337
338
"""
338
-
339
- return - 1 , 0 , None , None , None , None
339
+ pass
340
340
341
341
@property
342
342
def _training_sample_time_index_length (self ) -> int :
@@ -1914,6 +1914,23 @@ def fit(self, series: TimeSeries) -> "LocalForecastingModel":
1914
1914
super ().fit (series )
1915
1915
series ._assert_deterministic ()
1916
1916
1917
+ @property
1918
+ def extreme_lags (
1919
+ self ,
1920
+ ) -> Tuple [
1921
+ Optional [int ],
1922
+ Optional [int ],
1923
+ Optional [int ],
1924
+ Optional [int ],
1925
+ Optional [int ],
1926
+ Optional [int ],
1927
+ ]:
1928
+ # TODO: LocalForecastingModels do not yet handle extreme lags properly. Especially
1929
+ # TransferableFutureCovariatesLocalForecastingModel, where there is a difference between fit and predict mode)
1930
+ # do not yet. In general, Local models train on the entire series (input=output), different to Global models
1931
+ # that use an input to predict an output.
1932
+ return - self .min_train_series_length , - 1 , None , None , None , None
1933
+
1917
1934
1918
1935
class GlobalForecastingModel (ForecastingModel , ABC ):
1919
1936
"""The base class for "global" forecasting models, handling several time series and optional covariates.
@@ -2315,6 +2332,23 @@ def _supress_generate_predict_encoding(self) -> bool:
2315
2332
"""Controls wether encodings should be generated in :func:`FutureCovariatesLocalForecastingModel.predict()``"""
2316
2333
return False
2317
2334
2335
+ @property
2336
+ def extreme_lags (
2337
+ self ,
2338
+ ) -> Tuple [
2339
+ Optional [int ],
2340
+ Optional [int ],
2341
+ Optional [int ],
2342
+ Optional [int ],
2343
+ Optional [int ],
2344
+ Optional [int ],
2345
+ ]:
2346
+ # TODO: LocalForecastingModels do not yet handle extreme lags properly. Especially
2347
+ # TransferableFutureCovariatesLocalForecastingModel, where there is a difference between fit and predict mode)
2348
+ # do not yet. In general, Local models train on the entire series (input=output), different to Global models
2349
+ # that use an input to predict an output.
2350
+ return - self .min_train_series_length , - 1 , None , None , 0 , 0
2351
+
2318
2352
2319
2353
class TransferableFutureCovariatesLocalForecastingModel (
2320
2354
FutureCovariatesLocalForecastingModel , ABC
@@ -2492,7 +2526,3 @@ def _supports_non_retrainable_historical_forecasts(self) -> bool:
2492
2526
@property
2493
2527
def _supress_generate_predict_encoding (self ) -> bool :
2494
2528
return True
2495
-
2496
- @property
2497
- def extreme_lags (self ):
2498
- return - 1 , 0 , None , None , 0 , 0
0 commit comments