For testing some classifiers, I want to generate a synthetic time-series data with 3 signals, and a single label which should depend on all data points in all three of them, these are the rules I want my signals to follow:
- The three signals should have some correlation between them
- The label should depend on all points on all three signals
- It should not be linearly separable, and it should be a hard problem for classifiers to handle. (Specifically, I do not want a simple bidirectional LSTM model to achieve an accuracy of above 80%)
I tried many ways which I am including one of them here to give a sense of what I am trying to do:
Generate a base sinus signal over time with a random frequency (in my example I used values between 7 8 9 10 for frequency) and a random phase, the problem is to find this frequency so label (y) depends on frequency (if frequency bigger than 8 y is 1 else y is 0) then I generate 3 random filters and convolve this base signal 3 times to generate my 3 signals I add noise in each step.
freq = np.random.choice([7, 8, 9, 10])
phase = np.random.rand() * 10
base = []
for i in range(data_size):
base.append(np.random.rand() + math.sin(phase + float(i/freq)))
for f in filters:
signal = np.convolve(base, f)
signal += np.random.rand(len(signal)) * 6
all_features.append(signal)
if freq > 8:
y = 0
else:
y = 1
The problem with this data is that a simple BiLSTM model achieves an accuracy of around 100% on it. So my question is that is there any way to achieve this? Do you know any library which I can use to generate this?
If you can provide an example in any programming language it will do, for example, I found simstudy package in R which I think can be used here, however, I do not know how to achieve this in there.
Thank you for your help.