gluonts.dataset.stat module#

class gluonts.dataset.stat.DatasetStatistics(integer_dataset: bool, max_target: float, mean_abs_target: float, mean_target: float, mean_target_length: float, max_target_length: int, min_target: float, feat_static_real: List[Set[float]], feat_static_cat: List[Set[int]], num_past_feat_dynamic_real: Optional[int], num_feat_dynamic_real: Optional[int], num_feat_dynamic_cat: Optional[int], num_missing_values: int, num_time_observations: int, num_time_series: int, scale_histogram: gluonts.dataset.stat.ScaleHistogram)[source]#

Bases: tuple

A NamedTuple to store the statistics of a Dataset.

property feat_static_cat#

Alias for field number 8

property feat_static_real#

Alias for field number 7

property integer_dataset#

Alias for field number 0

property max_target#

Alias for field number 1

property max_target_length#

Alias for field number 5

property mean_abs_target#

Alias for field number 2

property mean_target#

Alias for field number 3

property mean_target_length#

Alias for field number 4

property min_target#

Alias for field number 6

property num_feat_dynamic_cat#

Alias for field number 11

property num_feat_dynamic_real#

Alias for field number 10

property num_missing_values#

Alias for field number 12

property num_past_feat_dynamic_real#

Alias for field number 9

property num_time_observations#

Alias for field number 13

property num_time_series#

Alias for field number 14

property scale_histogram#

Alias for field number 15

class gluonts.dataset.stat.ScaleHistogram(base: float = 2.0, bin_counts: Optional[dict] = None, empty_target_count: int = 0)[source]#

Bases: object

Scale histogram of a timeseries dataset.

This counts the number of timeseries whose mean of absolute values is in the [base ** i, base ** (i+1)] range for all possible i. The number of entries with empty target is counted separately.

Parameters
  • base – Log-width of the histogram’s buckets.

  • bin_counts

  • empty_target_count

add(target_values)[source]#
bucket_index(target_values)[source]#
count(target)[source]#
gluonts.dataset.stat.calculate_dataset_statistics(ts_dataset: Any) gluonts.dataset.stat.DatasetStatistics[source]#

Computes the statistics of a given Dataset.

Parameters

ts_dataset – Dataset of which to compute the statistics.

Returns

NamedTuple containing the statistics.

Return type

DatasetStatistics