arundo / tsaug

A Python package for time series augmentation
https://tsaug.readthedocs.io
Apache License 2.0
347 stars 37 forks source link

How to understand normalisation in add_noise and how it is achieved? #20

Open chance12355666 opened 1 year ago

chance12355666 commented 1 year ago

Hello, I'd like to ask about the normalize parameter in add_noise, I'm using it so that it is True, I'm finding where to use this parameter in add_noise, and I can't figure out how to do the normalisation by noise(X.max(axis=1)-X.min(axis=1)), I think it might be using the is max-min normalisation, but the query says that the max-min normalisation formula is X=(X-min(X))/(max(X)-min(X)). How should I understand this place, and the role of normalise. f self.kind == "additive": if self.normalize: X_aug = X + noise * ( X.max(axis=1, keepdims=True) - X.min(axis=1, keepdims=True) ) else: X_aug = X + noise