Table Of Contents
Table Of Contents

gluonts.model.gp_forecaster package

class gluonts.model.gp_forecaster.GaussianProcessEstimator(freq: str, prediction_length: int, cardinality: int, trainer: gluonts.trainer._base.Trainer = gluonts.trainer._base.Trainer(batch_size=32, clip_gradient=10.0, ctx=None, epochs=100, hybridize=True, init="xavier", learning_rate=0.001, learning_rate_decay_factor=0.5, minimum_learning_rate=5e-05, num_batches_per_epoch=50, patience=10, weight_decay=1e-08), context_length: Optional[int] = None, kernel_output: gluonts.kernels._kernel_output.KernelOutput = gluonts.kernels._rbf_kernel.RBFKernelOutput(), params_scaling: bool = True, dtype: gluonts.core.component.DType = <class 'numpy.float64'>, max_iter_jitter: int = 10, jitter_method: str = 'iter', sample_noise: bool = True, time_features: Optional[List[gluonts.time_feature._base.TimeFeature]] = None, num_parallel_samples: int = 100)[source]

Bases: gluonts.model.estimator.GluonEstimator

GaussianProcessEstimator shows how to build a local time series model using Gaussian Processes (GP).

Each time series has a GP with its own hyper-parameters. For the radial basis function (RBF) Kernel, the learnable hyper-parameters are the amplitude and lengthscale. The periodic kernel has those hyper-parameters with an additional learnable frequency parameter. The RBFKernel is the default, but either kernel can be used by inputting the desired KernelOutput object. The noise sigma in the model is another learnable hyper-parameter for both kernels. These parameters are fit using an Embedding of the integer time series indices (each time series has its set of hyper-parameter that is static in time). The observations are the time series values. In this model, the time features are hour of the day and day of the week.

Parameters:
  • freq – Time series frequency.
  • prediction_length – Prediction length.
  • cardinality – Number of time series.
  • trainer – Trainer instance to be used for model training (default: Trainer()).
  • context_length – Training length (default: None, in which case context_length = prediction_length).
  • kernel_output – KernelOutput instance to determine which kernel subclass to be instantiated (default: RBFKernelOutput()).
  • params_scaling – Determines whether or not to scale the model parameters (default: True).
  • float_type – Determines whether to use single or double precision (default: np.float64).
  • max_iter_jitter – Maximum number of iterations for jitter to iteratively make the matrix positive definite (default: 10).
  • jitter_method – Iteratively jitter method or use eigenvalue decomposition depending on problem size (default: “iter”).
  • sample_noise – Boolean to determine whether to add \(\sigma^2I\) to the predictive covariance matrix (default: True).
  • time_features – Time features to use as inputs of the model (default: None, in which case these are automatically determined based on the frequency).
  • 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).
create_predictor(transformation: gluonts.transform.Transformation, trained_network: mxnet.gluon.block.HybridBlock) → gluonts.model.predictor.Predictor[source]

Create and return a predictor object.

Returns:A predictor wrapping a HybridBlock used for inference.
Return type:Predictor
create_training_network() → mxnet.gluon.block.HybridBlock[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.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:Transformation