# gluonts.transform.sampler module¶

class gluonts.transform.sampler.BucketInstanceSampler[source]

This sample can be used when working with a set of time series that have a skewed distributions. For instance, if the dataset contains many time series with small values and few with large values.

The probability of sampling from bucket i is the inverse of its number of elements.

Parameters

scale_histogram – The histogram of scale for the time series. Here scale is the mean abs value of the time series.

scale_histogram: ScaleHistogram = None
class gluonts.transform.sampler.ContinuousTimePointSampler[source]

Bases: pydantic.main.BaseModel

Abstract class for “continuous time” samplers, which, given a lower bound and upper bound, sample “points” (events) in continuous time from a specified interval.

min_future: float = None
min_past: float = None
class gluonts.transform.sampler.ContinuousTimePredictionSampler[source]
allow_empty_interval: bool = None
class gluonts.transform.sampler.ContinuousTimeUniformSampler[source]

Implements a simple random sampler to sample points in the continuous interval between a and b.

num_instances: int = None
class gluonts.transform.sampler.ExpectedNumInstanceSampler[source]

Keeps track of the average time series length and adjusts the probability per time point such that on average num_instances training examples are generated per time series.

Parameters

num_instances – number of training examples generated per time series on average

n: int = None
num_instances: float = None
total_length: int = None
class gluonts.transform.sampler.InstanceSampler[source]

Bases: pydantic.main.BaseModel

An InstanceSampler is called with the time series ts, and returns a set of indices at which training instances will be generated.

The sampled indices i satisfy a <= i <= b, where a = min_past and b = ts.shape[axis] - min_future.

class Config[source]

Bases: object

arbitrary_types_allowed = True
axis: int = None
min_future: int = None
min_past: int = None
class gluonts.transform.sampler.PredictionSplitSampler[source]

Sampler used for prediction. Always selects the last time point for splitting i.e. the forecast point for the time series.

allow_empty_interval: bool = None
gluonts.transform.sampler.TestSplitSampler(axis: int = -1, min_past: int = 0) → gluonts.transform.sampler.PredictionSplitSampler[source]
class gluonts.transform.sampler.UniformSplitSampler[source]

Samples each point with the same fixed probability.

Parameters

p – Probability of selecting a time point

p: float = None
gluonts.transform.sampler.ValidationSplitSampler(axis: int = -1, min_past: int = 0, min_future: int = 0) → gluonts.transform.sampler.PredictionSplitSampler[source]