deepof.utils.rolling_window

deepof.utils.rolling_window(a: ndarray, window_size: int, window_step: int) 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

Returns:

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

Return type:

rolled_a (np.ndarray)