gluonts.mx.model.gpvar package#
- class gluonts.mx.model.gpvar.GPVAREstimator(freq: str, prediction_length: int, target_dim: int, trainer: gluonts.mx.trainer._base.Trainer = gluonts.mx.trainer._base.Trainer(add_default_callbacks=True, callbacks=None, clip_gradient=10.0, ctx=None, epochs=100, hybridize=True, init='xavier', learning_rate=0.001, num_batches_per_epoch=50, weight_decay=1e-08), context_length: Optional[int] = None, num_layers: int = 2, num_cells: int = 40, cell_type: str = 'lstm', num_parallel_samples: int = 100, dropout_rate: float = 0.1, target_dim_sample: Optional[int] = None, distr_output: Optional[gluonts.mx.distribution.distribution_output.DistributionOutput] = None, rank: Optional[int] = 2, scaling: bool = True, pick_incomplete: bool = False, lags_seq: Optional[List[int]] = None, shuffle_target_dim: bool = True, time_features: Optional[List[Callable[[pandas.core.indexes.period.PeriodIndex], numpy.ndarray]]] = None, conditioning_length: int = 100, use_marginal_transformation: bool = False, train_sampler: Optional[gluonts.transform.sampler.InstanceSampler] = None, validation_sampler: Optional[gluonts.transform.sampler.InstanceSampler] = None, batch_size: int = 32)[source]#
Bases:
gluonts.mx.model.estimator.GluonEstimator
Constructs a GPVAR estimator.
These models have been described as GP-Copula in this paper: https://arxiv.org/abs/1910.03002
Note that this implementation will change over time and we further work on this method. To replicate the results of the paper, please refer to our (frozen) implementation here: https://github.com/mbohlkeschneider/gluon-ts/tree/mv_release
- Parameters
freq – Frequency of the data to train on and predict
prediction_length (int) – Length of the prediction horizon
target_dim – Dimensionality of the input dataset
trainer – Trainer object to be used (default: Trainer())
context_length – Number of steps to unroll the RNN for before computing predictions (default: None, in which case context_length = prediction_length)
num_layers – Number of RNN layers (default: 2)
num_cells – Number of RNN cells for each layer (default: 40)
cell_type – Type of recurrent cells to use (available: ‘lstm’ or ‘gru’; default: ‘lstm’)
num_parallel_samples – Number of evaluation samples per time series to increase parallelism during inference. This is a model optimization that does not affect the accuracy (default: 100)
dropout_rate – Dropout regularization parameter (default: 0.1)
target_dim_sample – Number of dimensions to sample for the GP model
distr_output – Distribution to use to evaluate observations and sample predictions (default: LowrankGPOutput with dim=target_dim and rank=5). Note that target dim of the DistributionOutput and the estimator constructor call need to match. Also note that the rank in this constructor is meaningless if the DistributionOutput is constructed outside of this class.
rank – Rank for the LowrankGPOutput. (default: 2)
scaling – Whether to automatically scale the target values (default: true)
pick_incomplete – Whether training examples can be sampled with only a part of past_length time-units
lags_seq – Indices of the lagged target values to use as inputs of the RNN (default: None, in which case these are automatically determined based on freq)
shuffle_target_dim – Shuffle the dimensions before sampling.
time_features – Time features to use as inputs of the RNN (default: None, in which case these are automatically determined based on freq)
conditioning_length – Set maximum length for conditioning the marginal transformation
use_marginal_transformation – Whether marginal (CDFtoGaussianTransform) transformation is used by the model
train_sampler – Controls the sampling of windows during training.
validation_sampler – Controls the sampling of windows during validation.
batch_size – The size of the batches to be used training and prediction.
- create_predictor(transformation: gluonts.transform._base.Transformation, trained_network: mxnet.gluon.block.HybridBlock) gluonts.model.predictor.Predictor [source]#
Create and return a predictor object.
- Parameters
transformation – Transformation to be applied to data before it goes into the model.
module – A trained HybridBlock object.
- Returns
A predictor wrapping a HybridBlock used for inference.
- Return type
- create_training_data_loader(data: gluonts.dataset.Dataset, **kwargs) Iterable[Dict[str, Any]] [source]#
Create a data loader for training purposes.
- Parameters
data – Dataset from which to create the data loader.
- Returns
The data loader, i.e. and iterable over batches of data.
- Return type
DataLoader
- create_training_network() gluonts.mx.model.gpvar._network.GPVARTrainingNetwork [source]#
Create and return the network used for training (i.e., computing the loss).
- Returns
The network that computes the loss given input data.
- Return type
HybridBlock
- create_transformation() gluonts.transform._base.Transformation [source]#
Create and return the transformation needed for training and inference.
- Returns
The transformation that will be applied entry-wise to datasets, at training and inference time.
- Return type
- create_validation_data_loader(data: gluonts.dataset.Dataset, **kwargs) Iterable[Dict[str, Any]] [source]#
Create a data loader for validation purposes.
- Parameters
data – Dataset from which to create the data loader.
- Returns
The data loader, i.e. and iterable over batches of data.
- Return type
DataLoader
- lead_time: int#
- prediction_length: int#