gluonts.model.estimator module

class gluonts.model.estimator.DummyEstimator(predictor_cls: type, **kwargs)[source]

Bases: gluonts.model.estimator.Estimator

An Estimator that, upon training, simply returns a pre-constructed Predictor.

Parameters
  • predictor_clsPredictor class to instantiate.

  • **kwargs – Keyword arguments to pass to the predictor constructor.

freq = None
lead_time = None
prediction_length = None
train(training_data: Iterable[Dict[str, Any]], validation_dataset: Optional[Iterable[Dict[str, Any]]] = None) → gluonts.model.predictor.Predictor[source]

Train the estimator on the given data.

Parameters
  • training_data – Dataset to train the model on.

  • validation_data – Dataset to validate the model on during training.

Returns

The predictor containing the trained model.

Return type

Predictor

class gluonts.model.estimator.Estimator(lead_time: int = 0, **kwargs)[source]

Bases: object

An abstract class representing a trainable model.

The underlying model is trained by calling the train method with a training Dataset, producing a Predictor object.

freq: str = None
classmethod from_hyperparameters(**hyperparameters)[source]
lead_time: int = None
prediction_length: int = None
train(training_data: Iterable[Dict[str, Any]], validation_data: Optional[Iterable[Dict[str, Any]]] = None) → gluonts.model.predictor.Predictor[source]

Train the estimator on the given data.

Parameters
  • training_data – Dataset to train the model on.

  • validation_data – Dataset to validate the model on during training.

Returns

The predictor containing the trained model.

Return type

Predictor

class gluonts.model.estimator.GluonEstimator(trainer: gluonts.trainer._base.Trainer, lead_time: int = 0, dtype: gluonts.core.component.DType = <class 'numpy.float32'>)[source]

Bases: gluonts.model.estimator.Estimator

An Estimator type with utilities for creating Gluon-based models.

To extend this class, one needs to implement three methods: create_transformation, create_training_network, create_predictor.

create_predictor(transformation: gluonts.transform._base.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._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

Transformation

freq = None
classmethod from_hyperparameters(**hyperparameters) → gluonts.model.estimator.GluonEstimator[source]
lead_time = None
prediction_length = None
train(training_data: Iterable[Dict[str, Any]], validation_data: Optional[Iterable[Dict[str, Any]]] = None, num_workers: Optional[int] = None, num_prefetch: Optional[int] = None, **kwargs) → gluonts.model.predictor.Predictor[source]

Train the estimator on the given data.

Parameters
  • training_data – Dataset to train the model on.

  • validation_data – Dataset to validate the model on during training.

Returns

The predictor containing the trained model.

Return type

Predictor

train_model(training_data: Iterable[Dict[str, Any]], validation_data: Optional[Iterable[Dict[str, Any]]] = None, num_workers: Optional[int] = None, num_prefetch: Optional[int] = None, **kwargs) → gluonts.model.estimator.TrainOutput[source]
class gluonts.model.estimator.TrainOutput(transformation, trained_net, predictor)[source]

Bases: tuple

property predictor

Alias for field number 2

property trained_net

Alias for field number 1

property transformation

Alias for field number 0