ts_benchmark.baselines.duet package

The following module is for adapting the DUET model to TFB.

ts_benchmark.baselines.duet.duet module

Classes

DUET(**kwargs)

TransformerConfig(**kwargs)

class DUET(**kwargs)[source]

Bases: ModelBase

batch_forecast(horizon: int, batch_maker: BatchMaker, **kwargs) numpy.ndarray[source]

Make predictions by batch.

Parameters:
  • horizon – The length of each prediction.

  • batch_maker – Make batch data used for prediction.

Returns:

An array of predicted results.

detect_hyper_param_tune(train_data: pandas.DataFrame)[source]
forecast(horizon: int, train: pandas.DataFrame) numpy.ndarray[source]

Make predictions.

Parameters:
  • horizon – The predicted length.

  • testdata – Time data data used for prediction.

Returns:

An array of predicted results.

forecast_fit(train_valid_data: pandas.DataFrame, train_ratio_in_tv: float) ModelBase[source]

Train the model.

Parameters:
  • train_data – Time data data used for training.

  • 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.

multi_forecasting_hyper_param_tune(train_data: pandas.DataFrame)[source]
padding_data_for_forecast(test)[source]
static required_hyper_params() dict[source]

Return the hyperparameters required by model.

Returns:

An empty dictionary indicating that model does not require additional hyperparameters.

single_forecasting_hyper_param_tune(train_data: pandas.DataFrame)[source]
validate(valid_data_loader, criterion)[source]