Skip to main content

Module rolling

Module rolling 

Source
Expand description

Rolling (windowed) statistics with fixed capacity.

Time complexity per update: O(1). Space complexity: O(window_size).

The implementation stores the window contents in a VecDeque and recomputes the statistic on each update. For the window sizes typically used in online learning this is simple and correct. A more sophisticated incremental update could be added later, but only if accompanied by thorough removal tests.

Structsยง

RollingMean
Rolling mean over a fixed-size window.
RollingVariance
Rolling variance over a fixed-size window.