Windows
Ver. 1.1.5 (2023-02-02)
This module provides pool of window objects further used in the context of online adaptivity.
- class mlpro.bf.streams.tasks.windows.Window(p_buffer_size: int, p_delay: bool = False, p_enable_statistics: bool = False, p_name: str | None = None, p_range_max=1, p_duplicate_data: bool = False, p_visualize: bool = False, p_logging=True, **p_kwargs)
Bases:
StreamTask
This is the base class for window implementations
- Parameters:
p_buffer_size (int) – the size/length of the buffer/window.
p_delay (bool, optional) – Set to true if full buffer is desired before passing the window data to next step. Default is false.
p_name (str, optional) – Name of the Window. Default is None.
-Optional (p_logging) – Maximum range of task parallelism for window task. Default is set to multithread.
p_duplicate_data (bool) – If True, instances will be duplicated before processing. Default = False.
p_ada (bool, optional) – Adaptivity property of object. Default is True.
-Optional – Log level for the object. Default is log everything.
- C_NAME = 'Window'
- C_PLOT_STANDALONE: bool = False
- C_PLOT_IN_WINDOW = 'In Window'
- C_PLOT_OUTSIDE_WINDOW = 'Out Window'
- C_EVENT_BUFFER_FULL = 'BUFFER_FULL'
- C_EVENT_DATA_REMOVED = 'DATA_REMOVED'
- get_buffered_data()
Method to fetch the date from the window buffer
- Returns:
buffer (dict) – the buffered data in the form of dictionary
buffer_pos (int) – the latest buffer position
- get_boundaries()
Method to get the current boundaries of the Window
- Returns:
boundaries – Returns the current window boundaries in the form of a Numpy array.
- Return type:
np.ndarray
- get_mean()
Method to get the mean of the data in the Window.
- Returns:
mean – Returns the mean of the current data in the window in the form of a Numpy array.
- Return type:
np.ndarray
- get_variance()
Method to get the variance of the data in the Window.
- Returns:
variance – Returns the variance of the current data in the window as a numpy array.
- Return type:
np.ndarray
- get_std_deviation()
Method to get the standard deviation of the data in the window.
- Returns:
std – Returns the standard deviation of the data in the window as a numpy array.
- Return type:
np.ndarray