Long Short-Term Memory Networks for Stock Forecasting

This chapter will show you how to use long short-term memory (LSTM) models to forecast stock prices. This type of model is particularly useful for time series-based forecasting tasks. An LSTM model is a special type of recurrent neural network (RNN). These models contain special characteristics that allow you to reuse recent output as input. In this way, these types of models are often described as having memory. We will begin by creating a simple baseline model for predicting stock prices. From there, we will create a minimal LSTM model and we will dive deeper into the advantages of this model type over our baseline model, as well as explore how this model type is an improvement over a more traditional RNN. Lastly, we will look at some ways to tune our model to further improve its performance.

In this chapter, we will cover the following topics: