ts_benchmark.baselines.darts package
The following module is the adapter required for embedding the darts models into TFB.
ts_benchmark.baselines.darts.darts_models module
Functions
|
Adapts a Darts deep model class to OTB protocol |
|
Adapts a Darts regression model class to OTB protocol |
|
Adapts a Darts statistical model class to OTB protocol |
Classes
|
|
|
Darts model adapter class |
- class DartsModelAdapter(model_class: type, model_args: dict, model_name: str | None = None, allow_fit_on_eval: bool = False, supports_validation: bool = False, **kwargs)[source]
Bases:
ModelBaseDarts model adapter class
Adapts Darts models to OTB forecasting interface.
- forecast(horizon: int, series: pandas.DataFrame, **kwargs) numpy.ndarray[source]
Use the adapted Darts model for prediction.
- Parameters:
horizon – Forecast length.
series – Time series data to make inferences on.
- Returns:
Forecast result.
- forecast_fit(train_data: pandas.DataFrame, *, train_ratio_in_tv: float = 1.0, **kwargs) ModelBase[source]
Fit a suitable Darts model on time series data.
- Parameters:
train_data – Time series data.
train_ratio_in_tv – Represents the splitting ratio of the training set validation set. If it is equal to 1, it means that the validation set is not partitioned.
- Returns:
The fitted model object.
- property model_name
Returns the name of the model.
- darts_deep_model_adapter(model_class: type) Dict[source]
Adapts a Darts deep model class to OTB protocol
- Parameters:
model_class – a class of deep forecasting model from Darts library.
- Returns:
model factory that follows the OTB protocol.