I'm trying to find the best workflow for a stock prediction problem.

My idea goes as follows : I will use a classfication and a regression at the same time

  • Classification (-1 ; 0 ; 1)
  • Regression (float) => I will classify the output in the end just like the classification to make a decision (if the float number is really close to 0, it will be a zero for me)

The pipeline of the classification and regression will be the same:

  1. Data engineer with X (increase X with moving averages, Z score, lags etc of the current X)
  2. Remove outliers from X
  3. Scale X
  4. Split (train, validate, predict) => ex(if length of all data is 120 : train = 118, validate = 1 , predict = 1)
  5. Calculate important features to reduce dataset => Question 1 : Feature importance should be done on train or validate ? I think train
  6. Remove colinearity from the selected features (using VIF)
  7. Tunning parameters => Question 2 : Apply on train or validate ? Train in my opinion
  8. Question 3 : Where I can use the validation in this case if the length is 1 ?

I think I'm missing something. Of course I will run a backtest on this framework, but I want be sure that in term of biais I'm not violating something or something else.

If you got any ressources or something else, please share

  • $\begingroup$ The overall approach seems correct, but you can apply more simple models for a start. I tell that because stock markets are particularly difficult to predict due to the high noise they have and the complexity between feature. For example, some features could be meaningful during a specific period of time, whereas other could be meaningful in a different one. But generally speaking, there are often most significant feature at any time. So noise reduction, more simple model at start and select the most significant features could have good predicitons. $\endgroup$ Jan 19 at 10:38
  • $\begingroup$ Thanks @NicolasMartin for your response. In my experience, the best results were yielded by RandomF and LinearR, more complicated ones always underperformed. However my project is a little bit more general. I want to create a framework and let the user use the model that he wants. So what I'm trying to do is create this framework with all the avalaible options. I just want to get right the timeline for every step until predicting that number. I don't know if I'm clear enough $\endgroup$ Jan 19 at 15:11
  • 1
    $\begingroup$ Actually, you want to create a time series playground? Something like this service? daitan-innovation.github.io/timeseries-playground $\endgroup$ Jan 19 at 15:47
  • $\begingroup$ Hey, this looks great, thank you @NicolasMartin. I have a regression problem not a time series one but it will be quite useful for futue developpements $\endgroup$ Jan 19 at 16:39
  • $\begingroup$ You're welcome @GeriLeka. My mistake: I thought you wanted to make predictions including also timeseries models, and then a classification. Using relative values (= fluctuations) instead of absolute values could be better but it depends on the model. Are you considering the time line range also? $\endgroup$ Jan 19 at 17:29


Your Answer

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

Browse other questions tagged or ask your own question.