MinMaxNorm#
- class dpeeg.transforms.MinMaxNorm(min: ndarray | None = None, max: ndarray | None = None, dim: int | None = None)[source]#
Min-max normalization per subject.
By default, the EEG data (
edata) of eegdata are normalized.\[\mathbf{z} = \frac{\mathbf{x}-\mathbf{x}_{min}}{\mathbf{x}_{max}-\mathbf{x}_{min}}\]where \(\mathbf{x}\) and \(\mathbf{z}\) denote the input data and the output of normalization, respectively. \(\mathbf{x}_{max}\) and \(\mathbf{x}_{min}\) represent the maximum and minimum values of the sample.
- Parameters:
min (ndarray, optional) – The minimum used in the normalization process. If None, use the statistics of the current sample for normalization.
max (ndarray, optional) – The maximum used in the normalization process. If None, use the statistics of the current smaple for normalization.
dim (int, optional) – The dimension to normalize. Usually, -1 for channels and -2 for time points. If None, normalize at the sample level.
- Returns:
data – Transformed eegdata.
- Return type:
eegdata or dataset