I have 2000 signals in a dataset of shape
(2000, 400000) where each signal is recorded within the range -127, 128. I want to downscale each signal from (-127, 128) to (-1,1) to save memory space and also for better visualization. There are two approaches:
minmax_scale individually at each signal something like the following:
from sklearn.preprocessing import minmax_scale data = read_dataset(...) for i in range(data): minmax_scale(i, feature_range=(-1, 1))
Fit the whole dataset using
MinMaxScaler something like the following:
from sklearn.preprocessing import MinMaxScaler data = read_dataset(...) scalar = MinMaxScaler(feature_range=(-1,1)) scaled_data = scalar.fit_transform(data)
I use the first approach because the dataset does not fit the memory but I am worried if it is incorrect. I want to make sure if my choice is sound, in theory.
Thank you very much.