Curve Length

Description

This module implements the Curve Length feature extractor, which measures the cumulative amplitude changes in EEG signals over time. This feature is useful for capturing the complexity and variability of brain activity, making it suitable for tasks like motor imagery classification.

The Curve Length is calculated as the sum of the absolute differences between consecutive samples in the signal.

Class

class bciflow.modules.fe.curvelength.curvelength(flating: bool = False)[source]

Bases: object

flating

If True, the output data is returned in a flattened format (default is False).

Type:

bool

fit(eegdata)[source]

This method does nothing, as the Curve Length feature extractor does not require training.

Parameters:

eegdata (dict) – The input data.

Return type:

self

fit_transform(eegdata) dict[source]

This method combines fitting and transforming into a single step. It returns a dictionary with the transformed data.

Parameters:

eegdata (dict) – The input data.

Returns:

output – The transformed data.

Return type:

dict

transform(eegdata) dict[source]

This method computes the Curve Length for each trial, band, and channel in the input data. The result is stored in the dictionary under the key ‘X’.

Parameters:

eegdata (dict) – The input data.

Returns:

output – The transformed data.

Return type:

dict