Training Datasets Base Classes

class darts.utils.data.training_dataset.DualCovariatesTrainingDataset[source]

Bases: TrainingDataset, ABC

Abstract class for a DualCovariatesTorchModel training dataset. It contains 4-tuples of (past_target, historic_future_covariates, future_covariates, static_covariates, future_target) np.ndarray. The covariates are optional and can be None.

class darts.utils.data.training_dataset.FutureCovariatesTrainingDataset[source]

Bases: TrainingDataset, ABC

Abstract class for a FutureCovariatesTorchModel training dataset. It contains 3-tuples of (past_target, future_covariate, static_covariates, future_target) np.ndarray. The covariates are optional and can be None.

class darts.utils.data.training_dataset.MixedCovariatesTrainingDataset[source]

Bases: TrainingDataset, ABC

Abstract class for a MixedCovariatesTorchModel training dataset. It contains 5-tuples of (past_target, past_covariates, historic_future_covariates, future_covariates, static_covariates, future_target) np.ndarray. The covariates are optional and can be None.

class darts.utils.data.training_dataset.PastCovariatesTrainingDataset[source]

Bases: TrainingDataset, ABC

Abstract class for a PastCovariatesTorchModel training dataset. It contains 3-tuples of (past_target, past_covariate, static_covariates, future_target) np.ndarray. The covariates are optional and can be None.

class darts.utils.data.training_dataset.SplitCovariatesTrainingDataset[source]

Bases: TrainingDataset, ABC

Abstract class for a SplitCovariatesTorchModel training dataset. It contains 4-tuples of (past_target, past_covariates, future_covariates, static_covariates, future_target) np.ndarray. The covariates are optional and can be None.

class darts.utils.data.training_dataset.TrainingDataset[source]

Bases: ABC, Dataset

Super-class for all training datasets for torch models in Darts. These include

  • “PastCovariates” datasets (for PastCovariatesTorchModel): containing (past_target,

    past_covariates, static_covariates, future_target)

  • “FutureCovariates” datasets (for FutureCovariatesTorchModel): containing (past_target,

    future_covariates, static_covariates, future_target)

  • “DualCovariates” datasets (for DualCovariatesTorchModel): containing (past_target,

    historic_future_covariates, future_covariates, static_covariates, future_target)

  • “MixedCovariates” datasets (for MixedCovariatesTorchModel): containing (past_target,

    past_covariates, historic_future_covariates, future_covariates, static_covariates, future_target)

  • “SplitCovariates” datasets (for SplitCovariatesTorchModel): containing (past_target,

    past_covariates, future_covariates, static_covariates, future_target)

The covariates are optional and can be None.

This is meant to be used for training (or validation), all data except future_target represents model inputs (future_target is the output the model are trained to predict).

Darts TorchForecastingModel`s can be fit from instances of `TrainingDataset of the right type using the fit_from_dataset() method.

TrainingDataset inherits torch Dataset; meaning that the implementations have to provide the __getitem__() method.

It contains np.ndarray (and not TimeSeries), because training requires the values only, and so we can get big performance gains when slicing by returning only numpy views of the data underlying the TimeSeries.