Live data from Hacker News

Stock Price Prediction with LSTMs

miguelgfierro.com

1–10 of 20 posts

Re: Stock Price Prediction with LSTMs

#5

Please forgive my ignorance, since I'm a neophyte in this field. But since you have taking true value & training data, both, from the past, won't your "prediction value" be prone to lots of biases?

I'm the farthest thing from an expert but here are some factors to consider. You're going to train on the past data. Typically at least to begin with you pick some time period and train on part of the data and keep back some to test on. And yes, there's definitely a risk of overfitting. So some of the real data will be in sample and some out of sample for testing. If you want to get more sophisticated there is one of a number of resampling techniques in which you systematically choose different subsets of the data to train on and then look at the variation of the predictions. That can give you some idea of the error you'll get. Not sure how that works on data with high dimensionality but if you're doing an autoregression/autocorrelation (i.e. predicting tomorrows price based on it's past behavior) you'll only have the single time series. The first thing you'll likely notice if you try and apply that sort of model to stocks is that stocks are at least as highly correlated and likely much more so to the market than they are to their own past behavior.

Re: Stock Price Prediction with LSTMs

#6
post #4

According to the graph this seems to basically perfectly predict future stock price. I don't believe it's possible to be that accurate at all, what am I missing here?

Ditto. There’s no way this is projecting almost a year into the future and maintaining accuracy. It’s being trained on the test somehow or it’s doing something different from what I’m interpreting.

Re: Stock Price Prediction with LSTMs

#7
The model could be trained in such a way that it will only work with historical data and pass only back tests accurately. This is because you are training against the “answer” which is already known.

Re: Stock Price Prediction with LSTMs

#8
post #4

According to the graph this seems to basically perfectly predict future stock price. I don't believe it's possible to be that accurate at all, what am I missing here?

for one, the author scaled their mean-OLHC values _prior_ to making their train-test split, meaning data from the test set has leaked into the training set. Time series prediction is a bit easier if you understand how the future values are distributed!

Re: Stock Price Prediction with LSTMs

#9
post #4

According to the graph this seems to basically perfectly predict future stock price. I don't believe it's possible to be that accurate at all, what am I missing here?

That's because it's a one-step behind prediction. (If you go to the linked notebook and look carefully at the graph its evident.) If you could shift the prediction one step forward, you'd be rich!

Re: Stock Price Prediction with LSTMs

#10
Actual way this experiment should work: feed the recurrent NN with stock markets data from the latest 10 years but the latest year. Then display the prediction for the latest year and the actual data. I want to see if it will match like that...
Post reply on HN