You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
### Z-score standardization of time-series signals
92
+
93
+
##### Arguments:
94
+
-**signals**: A `pandas.DataFrame` or `numpy.ndarray` including signals in its rows.
95
+
-**axis**: An `int` (`0` or `1`) specifying the normalization direction.
96
+
-`axis=1` (default): each signal is independently standardized over time (row-wise).
97
+
-`axis=0`: each time step is standardized across signals (column-wise).
98
+
-**return_df**: A `bool` indicating whether to return a `pandas.DataFrame` when the input is a DataFrame.
99
+
-**eps**: A small `float` added to the standard deviation to avoid division by zero.
100
+
101
+
##### Return Values:
102
+
- A scaled `pandas.DataFrame` or `numpy.ndarray` (matching the input type by default), where each signal has zero mean and unit variance according to the selected axis.
103
+
104
+
##### Descriptions:
105
+
This function applies **Z-score standardization** (also known as standardization or Z-score normalization) to time-series signals.
106
+
Each signal (or time step) is centered by subtracting its mean and scaled by its standard deviation, improving numerical stability and convergence behavior during model training.
107
+
108
+
##### Usage example:
109
+
110
+
```Python
111
+
# Importings
112
+
import pandas as pd
113
+
import numpy as np
114
+
from damavand.damavand.augmentations import z_score_scaler
115
+
116
+
# Example signals (rows = signals, columns = time steps)
117
+
signals = pd.DataFrame(np.random.randn(5, 1000))
118
+
119
+
# Apply row-wise Z-score standardization (each signal independently)
0 commit comments