deepof.utils.rolling_window

deepof.utils.rolling_window(a: ndarray, window_size: int, window_step: int, automatic_changepoints: str = False, precomputed_breaks: ndarray | None = None) ndarray

Return a 3D numpy.array with a sliding-window extra dimension.

Parameters:
  • a (np.ndarray) – N (instances) * m (features) shape

  • window_size (int) – Size of the window to apply

  • window_step (int) – Step of the window to apply

  • automatic_changepoints (str) – Changepoint detection algorithm to apply. If False, applies a fixed sliding window.

  • precomputed_breaks (np.ndarray) – Precomputed breaks to use, bypassing the changepoint detection algorithm. None by default (break points are computed).

Returns:

N (sliding window instances) * l (sliding window size) * m (features)

Return type:

rolled_a (np.ndarray)