Hello,
Full disclosure upfront, I am new to machine learning and PyTorch.
I would like to create a neural network using PyTorch that takes time series data as input and classifies the wave shape as output. I am not sure, but I think this would be referred to as Time Series Classification.
Anyways, suppose that there are only three such possible wave shapes possible, either a,
- Sine wave
- Triangle wave
- Square wave
More specifically, the time series data input to the neural network would consist of three individual waveforms, all with the same wave shape but with varying phases.
To make things clearer, it might be helpful if we consider an example input in which the sine wave wave shape is used. In that case, the times series data input to the neural network would look like this,
Note that the time series data for each of the waveforms will all contain the same number of samples. In the example shown above, there are 100 data points for each waveform, for a total of 300 data points for this single time series data input.
I’ve generated several of sets of time series data using the three waveform shapes mentioned previously and concatenated them together into one large pandas data frame which I’ve called X_train. I also have another file called y_train which contains a table with the associated series id and label for each set of time series data contained in X_train.
Just to use some numbers, suppose I have 10 sets of time series data, where each set has a total of 300 data points as mentioned previously.
My question is, how should I structure the X and y training data so that I can use them to train my neural network in PyTorch? My guess is that I would need to convert the data into tensors, but I am not sure how to go about doing that or what dimension tensor I need to use. Is there a function to convert pandas data frames into tensors for PyTorch? Do I need to make any modifications to the dataframe before conversion?
Thanks for all your help!