tsaug icon indicating copy to clipboard operation
tsaug copied to clipboard

How to augment multi_variate time series data?

Open talhaanwarch opened this issue 5 years ago • 2 comments

I noticed that while augmenting multi-variate time series data, augmented data is concatenated on 0 axes, instead of being added to a new axis ie third axis. Let suppose data shape is (18,1000), after augmentation it turns to be (72,1000), but i believe it should be (4,18,1000). simply reshaping data.reshape(4,18,1000) resolve the problem or not?

talhaanwarch avatar Mar 29 '20 17:03 talhaanwarch

@talhaanwarch An input X should be a numpy array with shape (n,), (N, n), or (N, n, c), where n is the length of each series, N is the number of series, and c is the number of channels. Therefore, if we have a single original time series with 18 channels and 1000 time points, the shape of X should be (1, 1000, 18). Augmenting it by M times will return an output with shape (M, 1000, 18).

X = np.cumsum(np.random.normal(size=(1,1000, 18)), axis=1)  # (1, 1000, 18)
plot(X)

image

aug = tsaug.RandomTimeWarp() * 4
X_aug = aug.run(X)    # (4, 1000, 18)
plot(X_aug)

image

tailaiw avatar Mar 31 '20 15:03 tailaiw

How can I get an original signal after augmentation, I think I lost that, if I don't save it explicitly and then concatenate augmented and the original signal

talhaanwarch avatar Apr 16 '20 14:04 talhaanwarch