I have several timeseries datasets of stock data, with fundamental indicators. I would like to build a model that selects stocks for buy and hold.

I understand that to perform this task I have two options:

  1. Train a model for each stock: This way, I understand that it is the most practical, however, the amount of data for each model will be very reduced (Each dataset has less than 1000 lines).

  2. Putting all the data together in a single dataset: I didn't find anything on the internet to support this idea, however, I understand that the model would be more robust and would have a much larger amount of data to be trained.

So, what would be the correct way to perform this type of analysis? Any of you would suggest another way?

Thannk you in advance!

  • $\begingroup$ Do you already have a specific model in mind? $\endgroup$
    – Leevo
    Nov 26 '20 at 19:17
  • $\begingroup$ I thought about using a Random Forest from sklearn or Xgboost. My dependent variable would be the net margin or closing price. All other variables / features would be independent variables. $\endgroup$
    – Ubler
    Nov 26 '20 at 20:22

I would suggest option two. Because this way your model would have the chance to learn something for one stock, which it can apply for other stocks as well. If you provide the type of stock as an input feature, it should be able to distinguish between the specialities which only occure within one stock and the common things. So it is kind of able to transfer knowledge from one stock to the other.

But at the same time, I would suggest to try out both and choose whatever performs the best. This way you can also justify your choice in the end.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.