Predict Stock Prices Using RNN: Part 1
Lilian Weng
A tutorial demonstrates how to build a recurrent neural network with LSTM cells using TensorFlow to predict S&P 500 stock prices, using historical daily close prices from January 1950 to June 2017. The model uses sliding windows of fixed size with num_steps set to 30 LSTM cells per layer, trained over a maximum of 50 epochs with an initial learning rate of 0.001. The approach normalizes price data to predict relative changes rather than absolute values, and splits data into 90% training and 10% test sets to evaluate future price predictions.
Why it matters
This is a tutorial for how to build a recurrent neural network using Tensorflow to predict stock market prices. The full working code is available in github.com/lilianweng/stock-rnn. If you don’t know what is recurrent neural network or LSTM cell, feel free to check my previous post.