models.node.processing.segmenter package#
Submodules#
models.node.processing.segmenter.fixedwindowsegmenter module#
- class models.node.processing.segmenter.fixedwindowsegmenter.FixedWindowSegmenter(parameters: dict)[source]#
Bases:
Segmenter
Segments the input data into fixed size windows. Each window is a list of samples, normally called epoch. This is important because the other nodes in the pipeline expect the data to be segmented in this way. For exemple, the trainable feature extractor node expects the input data to be segmented in epochs, so if you segment the data in epochs of 200 samples and configure the feature extractor training_set_size to be 10, the feature extractor will use 2000 samples to train the model. If you segment the data in epochs of 100 samples and configure the feature extractor training_set_size to be 10, the feature extractor will use 1000 samples to train the model.
- Attributes:
_MODULE_NAME (str): The name of the module (in his case
node.processing.segmenter.fixedwindowsegmenter
)- configuration.json usage:
module (str): The name of the module (
node.processing.segmenter
)type (str): The type of the node (
FixedWindowSegmenter
)window_size (int): The size of the window (epoch) in samples.
filling_value (str): The value to fill the last window if it’s not complete. Can be
zero
orlatest
.buffer_options (dict): Buffer options.
clear_output_buffer_on_data_input (bool): Whether to clear the output buffer when new data is inserted in the input buffer.
clear_input_buffer_after_process (bool): Whether to clear the input buffer after processing.
clear_output_buffer_after_process (bool): Whether to clear the output buffer after processing.
- segment_data(data: FrameworkData) FrameworkData [source]#
Method that segments the data into fixed size windows. It just segments the data on the main input channel, and if the last window is not complete, it fills it with zeros or with the last sample of the window, depending on the
filling_value
parameter.- Parameters:
data (FrameworkData) – The data to segment.
- Returns:
The segmented data.
- Return type:
models.node.processing.segmenter.segmenter module#
- class models.node.processing.segmenter.segmenter.Segmenter(parameters=None)[source]#
Bases:
ProcessingNode
This is the base class for all segmenters. A segmenter is a node that segments the input data into smaller parts. In many applications of the signal processing such as automatic analysis of EEG signal, it is needed that signal is split to smaller parts that each part has the same statistical characterizations such as the amplitude and frequency. This is called segmentation. This class does that by segmenting the input data into smaller parts. The segmentation itself is done by the segment_data method that must be implemented by the subclasses.
- Attributes:
_MODULE_NAME (str): The name of the module (in his case
node.processing.segmenter.segmenter
) INPUT_MAIN (str): The name of the main input (main
) OUTPUT_MAIN (str): The name of the main output (main
)
- INPUT_MAIN: Final[str] = 'main'#
- OUTPUT_MAIN: Final[str] = 'main'#
- abstract segment_data(data: FrameworkData) FrameworkData [source]#
This method segments the data. It must be implemented by the subclasses.