gluonts.zebras.schema module#

class gluonts.zebras.schema.Array(*, required: bool = True, internal: bool = False, default: typing.Any = None, preprocess: typing.Optional[typing.Callable] = None, ndim: typing.Optional[int] = None, shape: typing.Optional[tuple] = None, dtype: typing.Type = <class 'numpy.float32'>)[source]#

Bases: gluonts.zebras.schema.Field

dtype: Type#
ndim: Optional[int]#
shape: Optional[tuple]#
class gluonts.zebras.schema.Field(*, required: bool = True, internal: bool = False, default: Any = None, preprocess: Optional[Callable] = None)[source]#

Bases: pydantic.v1.main.BaseModel

Specification for user provided input data.

default: Any#
internal: bool#
load_from(data, name, **kwargs)[source]#
preprocess: Optional[Callable]#
required: bool#
class gluonts.zebras.schema.Metadata(*, required: bool = False, internal: bool = False, default: Any = None, preprocess: Optional[Callable] = None, type: Any = typing.Any)[source]#

Bases: gluonts.zebras.schema.Field

required: bool#
type: Any#
class gluonts.zebras.schema.Scalar(*, required: bool = True, internal: bool = False, default: Any = None, preprocess: Optional[Callable] = None, type: Type)[source]#

Bases: gluonts.zebras.schema.Field

type: Type#
class gluonts.zebras.schema.Schema(fields=None, **kwargs)[source]#

Bases: object

fields: Dict[str, gluonts.zebras.schema.Field]#
load_splitframe(data: Dict[str, Any], future_length: int, start: Optional[Union[gluonts.zebras._period.Period, str]] = None, freq: Optional[Union[gluonts.zebras._freq.Freq, str]] = None) gluonts.zebras._split_frame.SplitFrame[source]#
load_timeframe(data: Dict[str, Any], start: Optional[Union[gluonts.zebras._period.Period, str]] = None, freq: Optional[Union[gluonts.zebras._freq.Freq, str]] = None) gluonts.zebras._time_frame.TimeFrame[source]#
class gluonts.zebras.schema.TimeSeries(*, required: bool = True, internal: bool = False, default: typing.Any = None, preprocess: typing.Optional[typing.Callable] = None, ndim: typing.Optional[int] = None, dtype: typing.Type = <class 'numpy.float32'>, tdim: int = -1, past_only: bool = True)[source]#

Bases: gluonts.zebras.schema.Field

Specification for user provided input data.

Parameters
  • ndim – The expected number of dimensions of the input data. If provided, it is ensured that the input array has the expected number of dimensions.

  • optional – The expected number of dimensions of the input data. If provided, it is ensured that the input array has the expected number of dimensions.

  • tdim – Mark an array as a time series and specifies which axis is the time dimension. When this value is None the array is classified as "static”.

  • optional – Mark an array as a time series and specifies which axis is the time dimension. When this value is None the array is classified as "static”.

  • dtype (Type) – The data type, passed to numpy.array.

  • past_only (bool) – If the value is a time series, this marks if data is only expected for the past range when loading zebras.SplitFrame. The value is ignored for static fields.

  • required – When set to true, the field has to be in the user data. Otherwise default is used as a fallback value.

  • internal – Allows to ignore user provided data when set, and instead default is always used as the value.

  • default – The default value to use when either required or internal is set to true.

  • preprocess – This function is called on the value before validating the value. For example, one can set preprocess = np.atleast_2d to also allow one dimensional arrays as input even when ndim = 2.

  • optional – This function is called on the value before validating the value. For example, one can set preprocess = np.atleast_2d to also allow one dimensional arrays as input even when ndim = 2.

dtype: Type#
ndim: Optional[int]#
past_only: bool#
tdim: int#