I have a dataset with features (f) for different stocks (S) and want to infer for price using an LSTM model. Here is my df:

year S1_price S1_f1 S1_f2 S2_price S2_f1 S2_f2 Sn_price Sn_f1 Sn_f2
2010 100 0.1 0.12 200 0.2 0.22 300 0.3 0.32
2011 105 0.4 0.42 205 0.5 0.52 305 0.6 0.62
2012 110 0.7 0.72 210 0.8 0.82 310 0.9 0.92

and so on... (example values).

I would like to predict the prices of every stock by using the features as inputs looking 1yr back into the past.

Example for Stock 1 (predict 2012):

[[0.1 0.12]
 [0.4 0.42]] 110

However, I want to to that for all stocks, so I am not sure which type of LSTM to use.

Your help would be very much appreciated!


1 Answer 1


I tend to like GRU and its variants for this type of problem. Although, if your dataset isn't too large you can test some toy models(smaller versions) of the different types to know which will achieve the best accuracy.

Typically a good size to start with in that case would be about 20-25% of your full model size.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .