gluonts.ev.aggregations module#
- class gluonts.ev.aggregations.Aggregation(axis: Union[int, tuple, NoneType] = None)[source]#
Bases:
object
- axis: Optional[Union[int, tuple]] = None#
- class gluonts.ev.aggregations.Mean(axis: Optional[Union[int, tuple]] = None, partial_result: Optional[Union[List[numpy.ndarray], numpy.ndarray]] = None, n: Optional[Union[int, numpy.ndarray]] = None)[source]#
Bases:
gluonts.ev.aggregations.Aggregation
Map-reduce way of calculating the mean of a stream of values.
partial_result represents one of two things, depending on the axis: Case 1 - axis 0 is aggregated (axis is None or 0):
First sum values according to axis and keep track of number of entries summed over (n) to divide by in the end.
- Case 2 - axis 0 is not being aggregated:
In this case, partial_result is a list of means that in the end gets concatenated to a np.ndarray. As this directly calculates the mean, n is not used.
- n: Optional[Union[int, numpy.ndarray]] = None#
- partial_result: Optional[Union[List[numpy.ndarray], numpy.ndarray]] = None#
- class gluonts.ev.aggregations.Sum(axis: Optional[Union[int, tuple]] = None, partial_result: Optional[Union[List[numpy.ndarray], numpy.ndarray]] = None)[source]#
Bases:
gluonts.ev.aggregations.Aggregation
Map-reduce way of calculating the sum of a stream of values.
partial_result represents one of two things, depending on the axis: Case 1 - axis 0 is aggregated (axis is None or 0):
In each step, sum is being calculated and added to partial_result.
- Case 2 - axis 0 is not being aggregated:
In this case, partial_result is a list that in the end gets concatenated to a np.ndarray.
- partial_result: Optional[Union[List[numpy.ndarray], numpy.ndarray]] = None#