Mutual Information Best Individual Features (MIBIF)
Description
This module implements the Mutual Information Best Individual Features (MIBIF) feature extractor, which selects the best features based on mutual information between features and labels. This feature is commonly used in BCI applications to reduce dimensionality and improve classification performance.
The MIBIF is calculated using mutual information scores, which measure the dependency between each feature and the target labels.
Class
- class bciflow.modules.fs.mibif.MIBIF(n_features, clf, paired=True)[source]
Bases:
object
- n_features
The number of features to be selected.
- Type:
int
- paired
Whether the features are paired or not (default is True).
- Type:
bool
- order
The order of the features based on mutual information scores.
- Type:
list
- clf
The classifier used to calculate the mutual information.
- Type:
object
- pairs
The pairs of features (used when paired=True).
- Type:
np.ndarray
- find_pair(u, max_col)[source]
Finds the pair of a feature.
- Parameters:
u (int) – The feature index.
max_col (int) – The maximum number of columns.
- Returns:
The index of the pair of the feature.
- Return type:
int
- fit(eegdata)[source]
This method fits the MIBIF feature extractor to the data by calculating mutual information scores.
- Parameters:
eegdata (dict) – The input data, containing ‘X’ (features) and ‘y’ (labels).
- Return type:
self
- fit_transform(eegdata)[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, containing ‘X’ (features) and ‘y’ (labels).
- Returns:
output – The transformed data, containing the selected features.
- Return type:
dict