pyeeg.features.FeaturePipeline.normalize_features

FeaturePipeline.normalize_features(features: Dict[str, ndarray], method: str = 'zscore') Dict[str, ndarray]

Normalize features.

Applies the requested normalization independently to each feature array in features.

Parameters:
  • features (dict of str -> ndarray) – Feature name to values array mapping.

  • method (str, optional) –

    Normalization method. One of:

    • "none": return the input unchanged.

    • "zscore": subtract the mean and divide by the standard deviation ((x - mean) / std). If the standard deviation is zero, only the mean is subtracted.

    • "minmax": scale to the [0, 1] range via (x - min) / (max - min). If all values are equal, the minimum is subtracted.

    Any other value leaves the array unchanged (same behavior as "none"). Defaults to "zscore".

Returns:

normalized – Feature name to normalized values array mapping, with the same keys as the input.

Return type:

dict of str -> ndarray