ZscoreNorm#
- class dpeeg.transforms.ZscoreNorm(mean: ndarray | None = None, std: ndarray | None = None, dim: int | None = None)[source]#
Z-score normalization per subject.
By default, the EEG data (
edata) of eegdata are normalized.\[\mathbf{z} = \frac{\mathbf{x} - \mu}{\sqrt{\sigma^{2}}}\]where \(\mathbf{x}\) and \(\mathbf{z}\) denote the input data and the output of normalization, respectively. \(\mu\) and \(\sigma^2\) represent the mean and variance values of the sample.
- Parameters:
mean (ndarray, optional) – The mean used in the normalization process. If None, use the statistics of the current sample for normalization.
std (ndarray, optional) – The standard deviation used in the normalization process. If None, use the statistics of the current sample 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