Skip to content

Commit 6417c61

Browse files
committed
fix znorm
1 parent 72001fd commit 6417c61

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

aeon/utils/self_supervised/general.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import numpy as np
66

77

8-
def z_normalization(self, X, axis=1):
8+
def z_normalization(X, axis=1):
99
"""Z-Normalize collection of time series.
1010
1111
Parameters
@@ -21,8 +21,8 @@ def z_normalization(self, X, axis=1):
2121
-------
2222
Normalized version of X.
2323
"""
24-
stds = np.std(X, axis=1, keepdims=True)
24+
stds = np.std(X, axis=axis, keepdims=True)
2525
if len(stds[stds == 0.0]) > 0:
2626
stds[stds == 0.0] = 1.0
27-
return (X - X.mean(axis=1, keepdims=True)) / stds
28-
return (X - X.mean(axis=1, keepdims=True)) / (X.std(axis=1, keepdims=True))
27+
return (X - X.mean(axis=axis, keepdims=True)) / stds
28+
return (X - X.mean(axis=axis, keepdims=True)) / (X.std(axis=axis, keepdims=True))

0 commit comments

Comments
 (0)