TLDRocket
Sign in

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.

Related stories

The daily briefing

Every AI story that matters, in your inbox by 8am.

TLDRocket reads 60+ sources, removes duplicate coverage, and summarises the day in two minutes. Free, no spam, unsubscribe anytime.