Inference Dataset¶
- class darts.utils.data.inference_dataset.DualCovariatesInferenceDataset(target_series, covariates=None, n=1, input_chunk_length=12, output_chunk_length=1, use_static_covariates=True)[source]¶
Bases:
darts.utils.data.inference_dataset.InferenceDataset
Contains (past_target, historic_future_covariates, future_covariates, static_covariates) tuples.
- Parameters
target_series (
Union
[TimeSeries
,Sequence
[TimeSeries
]]) – The target series that are to be predicted into the future.covariates (
Union
[TimeSeries
,Sequence
[TimeSeries
],None
]) – Optionally, some future-known covariates that are used for predictions. This argument is required if the model was trained with future-known covariates.n (
int
) – Forecast horizon: The number of time steps to predict after the end of the target series.input_chunk_length (
int
) – The length of the target series the model takes as input.output_chunk_length (
int
) – The length of the target series the model emits in output.use_static_covariates (
bool
) – Whether to use/include static covariate data from input series.
- class darts.utils.data.inference_dataset.FutureCovariatesInferenceDataset(target_series, covariates=None, n=1, input_chunk_length=12, covariate_type=CovariateType.FUTURE, use_static_covariates=True)[source]¶
Bases:
darts.utils.data.inference_dataset.InferenceDataset
Contains (past_target, future_covariates, static_covariates) tuples
- Parameters
target_series (
Union
[TimeSeries
,Sequence
[TimeSeries
]]) – The target series that are to be predicted into the future.covariates (
Union
[TimeSeries
,Sequence
[TimeSeries
],None
]) – Optionally, some future-known covariates that are used for predictions. This argument is required if the model was trained with future-known covariates.n (
int
) – Forecast horizon: The number of time steps to predict after the end of the target series.input_chunk_length (
int
) – The length of the target series the model takes as input.use_static_covariates (
bool
) – Whether to use/include static covariate data from input series.
- class darts.utils.data.inference_dataset.GenericInferenceDataset(target_series, covariates=None, n=1, input_chunk_length=12, output_chunk_length=1, covariate_type=CovariateType.PAST, use_static_covariates=True)[source]¶
Bases:
darts.utils.data.inference_dataset.InferenceDataset
Contains (past_target, past_covariates | historic_future_covariates, future_past_covariates | future_covariate, static_covariates).
“future_past_covariates” are past covariates that happen to be also known in the future - those are needed for forecasting with n > output_chunk_length by any model relying on past covariates. For this reason, when n > output_chunk_length, this dataset will also emit the “future past_covariates”.
“historic_future_covariates” are historic future covariates that are given for the input_chunk in the past.
- Parameters
target_series (
Union
[TimeSeries
,Sequence
[TimeSeries
]]) – The target series that are to be predicted into the future.covariates (
Union
[TimeSeries
,Sequence
[TimeSeries
],None
]) – Optionally, one or a sequence of TimeSeries containing either past or future covariates. If covariates were used during training, the same type of cavariates must be supplied at prediction.n (
int
) – Forecast horizon: The number of time steps to predict after the end of the target series.input_chunk_length (
int
) – The length of the target series the model takes as input.output_chunk_length (
int
) – The length of the target series the model emits in output.use_static_covariates (
bool
) – Whether to use/include static covariate data from input series.
- class darts.utils.data.inference_dataset.InferenceDataset[source]¶
Bases:
abc.ABC
,torch.utils.data.dataset.Dataset
Abstract class for all darts torch inference dataset.
It can be used as models’ inputs, to obtain simple forecasts on each TimeSeries (using covariates if specified).
The first elements of the tuples it contains are numpy arrays (which will be translated to torch tensors by the torch DataLoader). The last elements of the tuples are the (past) target TimeSeries, which is needed in order to properly construct the time axis of the forecast series.
- class darts.utils.data.inference_dataset.MixedCovariatesInferenceDataset(target_series, past_covariates=None, future_covariates=None, n=1, input_chunk_length=12, output_chunk_length=1, use_static_covariates=True)[source]¶
Bases:
darts.utils.data.inference_dataset.InferenceDataset
Contains (past_target, past_covariates, historic_future_covariates, future_covariates, future_past_covariates, static_covariates) tuples. “future_past_covariates” are past covariates that happen to be also known in the future - those are needed for forecasting with n > output_chunk_length by any model relying on past covariates.
- Parameters
target_series (
Union
[TimeSeries
,Sequence
[TimeSeries
]]) – The target series that are to be predicted into the future.past_covariates (
Union
[TimeSeries
,Sequence
[TimeSeries
],None
]) – Optionally, some past-observed covariates that are used for predictions. This argument is required if the model was trained with past-observed covariates.future_covariates (
Union
[TimeSeries
,Sequence
[TimeSeries
],None
]) – Optionally, some future-known covariates that are used for predictions. This argument is required if the model was trained with future-known covariates.n (
int
) – Forecast horizon: The number of time steps to predict after the end of the target series.input_chunk_length (
int
) – The length of the target series the model takes as input.output_chunk_length (
int
) – The length of the target series the model emits in output.use_static_covariates (
bool
) – Whether to use/include static covariate data from input series.
- class darts.utils.data.inference_dataset.PastCovariatesInferenceDataset(target_series, covariates=None, n=1, input_chunk_length=12, output_chunk_length=1, covariate_type=CovariateType.PAST, use_static_covariates=True)[source]¶
Bases:
darts.utils.data.inference_dataset.InferenceDataset
Contains (past_target, past_covariates, future_past_covariates, static_covariates).
“future_past_covariates” are past covariates that happen to be also known in the future - those are needed for forecasting with n > output_chunk_length by any model relying on past covariates.
For this reason, when n > output_chunk_length, this dataset will also emit the “future past_covariates”.
- Parameters
target_series (
Union
[TimeSeries
,Sequence
[TimeSeries
]]) – The target series that are to be predicted into the future.covariates (
Union
[TimeSeries
,Sequence
[TimeSeries
],None
]) – Optionally, some past-observed covariates that are used for predictions. This argument is required if the model was trained with past-observed covariates.n (
int
) – Forecast horizon: The number of time steps to predict after the end of the target series.input_chunk_length (
int
) – The length of the target series the model takes as input.output_chunk_length (
int
) – The length of the target series the model emits in output.use_static_covariates (
bool
) – Whether to use/include static covariate data from input series.
- class darts.utils.data.inference_dataset.SplitCovariatesInferenceDataset(target_series, past_covariates=None, future_covariates=None, n=1, input_chunk_length=12, output_chunk_length=1, use_static_covariates=True)[source]¶
Bases:
darts.utils.data.inference_dataset.InferenceDataset
Contains (past_target, past_covariates, future_covariates, future_past_covariates, static_covariates) tuples. “future_past_covariates” are past covariates that happen to be also known in the future - those are needed for forecasting with n > output_chunk_length by any model relying on past covariates.
- Parameters
target_series (
Union
[TimeSeries
,Sequence
[TimeSeries
]]) – The target series that are to be predicted into the future.past_covariates (
Union
[TimeSeries
,Sequence
[TimeSeries
],None
]) – Optionally, some past-observed covariates that are used for predictions. This argument is required if the model was trained with past-observed covariates.future_covariates (
Union
[TimeSeries
,Sequence
[TimeSeries
],None
]) – Optionally, some future-known covariates that are used for predictions. This argument is required if the model was trained with future-known covariates.n (
int
) – Forecast horizon: The number of time steps to predict after the end of the target series.input_chunk_length (
int
) – The length of the target series the model takes as input.output_chunk_length (
int
) – The length of the target series the model emits in output.use_static_covariates (
bool
) – Whether to use/include static covariate data from input series.