I am trying to build an LSTM model that will predict future values of a time series, using past values as well as other features (these other features being the key).
For example, I have a time series Y:
Y = [1, 2, 3, 1, 2, 3]
that also has a bunch of features associated with each time point:
X1 = [5,5,4,3,3,3] X2 = [2,2,1,2,2,2]
I’m having the damnedest time figuring out how to extrapolate the LSTM example with Sin wave function prediction with my scenario, where the input layer should contain cells for both past values and their associated features.
Does anybody have a link to an example of time series prediction using both autoregressive AND other features in PyTorch?
Hey I’m facing a similar problem right now, did you find any way of solving this issue? i.e. combining previous predictions with current input features?
The simplest approach would be to use torch.cat them together along the feature dimension (dim=2). Have a linear layer with the appropriate number of outputs towards the top of the model. Then on prediction, you can torch.cat the outputs of the model with the next timestep’s extrinsic features.