PytorchForecastingDatasetBuilder

class PytorchForecastingDatasetBuilder(max_encoder_length: int = 30, min_encoder_length: Optional[int] = None, min_prediction_idx: Optional[int] = None, min_prediction_length: Optional[int] = None, max_prediction_length: int = 1, static_categoricals: Optional[List[str]] = None, static_reals: Optional[List[str]] = None, time_varying_known_categoricals: Optional[List[str]] = None, time_varying_known_reals: Optional[List[str]] = None, time_varying_unknown_categoricals: Optional[List[str]] = None, time_varying_unknown_reals: Optional[List[str]] = None, variable_groups: Optional[Dict[str, List[int]]] = None, constant_fill_strategy: Optional[Dict[str, Union[str, float, int, bool]]] = None, allow_missing_timesteps: bool = True, lags: Optional[Dict[str, List[int]]] = None, add_relative_time_idx: bool = True, add_target_scales: bool = True, add_encoder_length: Union[bool, str] = True, target_normalizer: Union[pytorch_forecasting.data.encoders.TorchNormalizer, pytorch_forecasting.data.encoders.NaNLabelEncoder, pytorch_forecasting.data.encoders.EncoderNormalizer, str, List[Union[pytorch_forecasting.data.encoders.TorchNormalizer, pytorch_forecasting.data.encoders.NaNLabelEncoder, pytorch_forecasting.data.encoders.EncoderNormalizer]], Tuple[Union[pytorch_forecasting.data.encoders.TorchNormalizer, pytorch_forecasting.data.encoders.NaNLabelEncoder, pytorch_forecasting.data.encoders.EncoderNormalizer]]] = 'auto', categorical_encoders: Optional[Dict[str, pytorch_forecasting.data.encoders.NaNLabelEncoder]] = None, scalers: Optional[Dict[str, Union[sklearn.preprocessing._data.StandardScaler, sklearn.preprocessing._data.RobustScaler, pytorch_forecasting.data.encoders.TorchNormalizer, pytorch_forecasting.data.encoders.EncoderNormalizer]]] = None)[source]

Bases: etna.core.mixins.BaseMixin

Builder for PytorchForecasting dataset.

Init dataset builder.

Parameters here is used for initialization of pytorch_forecasting.data.timeseries.TimeSeriesDataSet object.

Inherited-members

Parameters

Methods

create_inference_dataset(ts, horizon)

Create inference dataset.

create_train_dataset(ts)

Create train dataset.

set_params(**params)

Return new object instance with modified parameters.

to_dict()

Collect all information about etna object in dict.

create_inference_dataset(ts: etna.datasets.tsdataset.TSDataset, horizon: int) pytorch_forecasting.data.timeseries.TimeSeriesDataSet[source]

Create inference dataset.

This method should be used only after create_train_dataset that is used during model training.

Parameters
Raises

ValueError: – if method was used before create_train_dataset

Return type

pytorch_forecasting.data.timeseries.TimeSeriesDataSet

create_train_dataset(ts: etna.datasets.tsdataset.TSDataset) pytorch_forecasting.data.timeseries.TimeSeriesDataSet[source]

Create train dataset.

Parameters

ts (etna.datasets.tsdataset.TSDataset) – Time series dataset.

Return type

pytorch_forecasting.data.timeseries.TimeSeriesDataSet