pysad.statistics.RunningStatistic

class pysad.statistics.RunningStatistic(statistic_cls, window_size, **kwargs)[source]

The running statistic that wraps any other statistics to track statistics with a fixed window size.

Parameters:
  • statistic_cls (class) – The class to be instantiated and to be windowed.

  • window_size (int) – The window size.

  • **kwargs (Keyword arguments) – The keyword arguments that is input to the statistic_cls.

Methods

__init__(statistic_cls, window_size, **kwargs)

get()

Method to obtain the tracked statistic.

update(num)

Updates the statistic with the value for a timestep.

get()[source]

Method to obtain the tracked statistic.

Returns:

The statistic.

Return type:

float

update(num)[source]

Updates the statistic with the value for a timestep.

Parameters:

num (float) – The incoming value, for which the statistic is used.

Returns:

self.

Return type:

object