@@ -133,7 +133,7 @@ def fit(self, series: TimeSeries) -> "ForecastingModel":
133
133
self
134
134
Fitted model.
135
135
"""
136
- if not isinstance (self , DualCovariatesForecastingModel ):
136
+ if not isinstance (self , FutureCovariatesLocalForecastingModel ):
137
137
series ._assert_univariate ()
138
138
raise_if_not (
139
139
len (series ) >= self .min_train_series_length ,
@@ -1068,6 +1068,20 @@ def load(path: Union[str, BinaryIO]) -> "ForecastingModel":
1068
1068
return model
1069
1069
1070
1070
1071
+ class LocalForecastingModel (ForecastingModel , ABC ):
1072
+ """The base class for "local" forecasting models, handling only single univariate time series.
1073
+
1074
+ Local Forecasting Models (LFM) are models that can be trained on a single univariate target series only. In Darts,
1075
+ most models in this category tend to be simpler statistical models (such as ETS or FFT). LFMs usually train on
1076
+ the entire target series supplied when calling :func:`fit()` at once. They can also predict in one go with
1077
+ :func:`predict()` for any number of predictions `n` after the end of the training series.
1078
+
1079
+ All implementations must implement the `_fit()` and `_predict()` methods.
1080
+ """
1081
+
1082
+ pass
1083
+
1084
+
1071
1085
class GlobalForecastingModel (ForecastingModel , ABC ):
1072
1086
"""The base class for "global" forecasting models, handling several time series and optional covariates.
1073
1087
@@ -1080,7 +1094,7 @@ class GlobalForecastingModel(ForecastingModel, ABC):
1080
1094
The name "global" stems from the fact that a training set of a forecasting model of this class is not constrained
1081
1095
to a temporally contiguous, "local", time series.
1082
1096
1083
- All implementations have to implement the :func:`fit()` and :func:`predict()` methods defined below .
1097
+ All implementations must implement the :func:`fit()` and :func:`predict()` methods.
1084
1098
The :func:`fit()` method is meant to train the model on one or several training time series, along with optional
1085
1099
covariates.
1086
1100
@@ -1371,12 +1385,18 @@ def _get_encoders_n(self, n) -> int:
1371
1385
return n
1372
1386
1373
1387
1374
- class DualCovariatesForecastingModel (ForecastingModel , ABC ):
1375
- """The base class for the forecasting models that are not global, but support future covariates.
1376
- Among other things, it lets Darts forecasting models wrap around statsmodels models
1377
- having a `future_covariates` parameter, which corresponds to future-known covariates.
1388
+ class FutureCovariatesLocalForecastingModel (LocalForecastingModel , ABC ):
1389
+ """The base class for future covariates "local" forecasting models, handling single uni- or multivariate target
1390
+ and optional future covariates time series.
1378
1391
1379
- All implementations have to implement the `_fit()` and `_predict()` methods defined below.
1392
+ Future Covariates Local Forecasting Models (FC-LFM) are models that can be trained on a single uni- or multivariate
1393
+ target and optional future covariates series. In Darts, most models in this category tend to be simpler statistical
1394
+ models (such as ARIMA). FC-LFMs usually train on the entire target and future covariates series supplied when
1395
+ calling :func:`fit()` at once. They can also predict in one go with :func:`predict()` for any number of predictions
1396
+ `n` after the end of the training series. When using future covariates, the values for the future `n` prediction
1397
+ steps must be given in the covariate series.
1398
+
1399
+ All implementations must implement the :func:`_fit()` and :func:`_predict()` methods.
1380
1400
"""
1381
1401
1382
1402
_expect_covariate = False
@@ -1535,12 +1555,22 @@ def _predict_wrapper(
1535
1555
)
1536
1556
1537
1557
1538
- class TransferableDualCovariatesForecastingModel (DualCovariatesForecastingModel , ABC ):
1539
- """The base class for the forecasting models that are not global, but support future covariates, and can
1540
- additionally be applied to new data unrelated to the original series used for fitting the model. Currently,
1541
- all the derived classes wrap statsmodels models.
1558
+ class TransferableFutureCovariatesLocalForecastingModel (
1559
+ FutureCovariatesLocalForecastingModel , ABC
1560
+ ):
1561
+ """The base class for transferable future covariates "local" forecasting models, handling single uni- or
1562
+ multivariate target and optional future covariates time series. Additionally, at prediction time, it can be
1563
+ applied to new data unrelated to the original series used for fitting the model.
1564
+
1565
+ Transferable Future Covariates Local Forecasting Models (TFC-LFM) are models that can be trained on a single uni-
1566
+ or multivariate target and optional future covariates series. Additionally, at prediction time, it can be applied
1567
+ to new data unrelated to the original series used for fitting the model. Currently in Darts, all models in this
1568
+ category wrap to statsmodel models such as VARIMA. TFC-LFMs usually train on the entire target and future covariates
1569
+ series supplied when calling :func:`fit()` at once. They can also predict in one go with :func:`predict()`
1570
+ for any number of predictions `n` after the end of the training series. When using future covariates, the values
1571
+ for the future `n` prediction steps must be given in the covariate series.
1542
1572
1543
- All implementations have to implement the `_fit()`, `_predict()` methods.
1573
+ All implementations must implement the :func: `_fit()` and :func: `_predict()` methods.
1544
1574
"""
1545
1575
1546
1576
def predict (
@@ -1610,8 +1640,8 @@ def predict(
1610
1640
series
1611
1641
)
1612
1642
1613
- # DualCovariatesForecastingModel performs some checks on self.training_series. We temporary replace that with
1614
- # the new ts
1643
+ # FutureCovariatesLocalForecastingModel performs some checks on self.training_series. We temporary replace
1644
+ # that with the new ts
1615
1645
if series is not None :
1616
1646
self ._orig_training_series = self .training_series
1617
1647
self .training_series = series
@@ -1641,7 +1671,7 @@ def _predict(
1641
1671
num_samples : int = 1 ,
1642
1672
) -> TimeSeries :
1643
1673
"""Forecasts values for a certain number of time steps after the end of the series.
1644
- TransferableDualCovariatesForecastingModel must implement the predict logic in this method.
1674
+ TransferableFutureCovariatesLocalForecastingModel must implement the predict logic in this method.
1645
1675
"""
1646
1676
pass
1647
1677
0 commit comments