physioex.data.ZScore#
- class physioex.data.ZScore(ddof=0, eps=0.0)[source]#
Bases:
PreprocessingStepWhole-signal z-score with a tunable
ddofand a std floor.y = (x - mean) / max(std, eps)where the mean and standard deviation (with the givenddof) are computed over the whole signal. Used by the wav2sleep reference preprocessing, which z-scores each 10 h recording withddof=1, eps=1e-6over the full grid including the zero padding (the padding is therefore part of the statistics – keepFixedLengthbefore this step in that pipeline).If
std == 0andeps == 0the step returnsx - mean(a constant signal is degenerate for a ratio).Parameters#
- ddofint
Delta degrees of freedom for the standard deviation (default 0).
- epsfloat
Floor for the standard deviation (default 0.0).
Methods
__init__([ddof, eps])compile(fs_in[, header])Precompute any expensive state and return a callable specialized for fs_in.
spec()Return canonical, hashable text repr.
- compile(fs_in, header=None)[source]#
Precompute any expensive state and return a callable specialized for fs_in.
headeris an optional per-channel metadata dict (physical dimension, physical min/max, …) forwarded to steps that declare they need it (needs_headerattribute, e.g.PhysicalScale). Steps that ignore it simply do not read it; the signature default keeps every existingcompile(fs)call site working.- Parameters:
- Return type: