When machine learning became popular, immediately there was a lot of attention given to predicting stock prices. Many different algorithms have been applied to predict stock prices, from more traditional algorithms such as random forests to the more recent extreme gradient boosting. While the latter might still outperform deep learning approaches in most cases, it can still be of valuable to use in a neural network approach. This can, for example, be used in an ensemble of networks or for multi-layer stacking. In the following recipe, we will predict stock prices with the Keras framework.
Predicting stock prices with neural networks
How to do it...
- We start by importing all the libraries, as follows:
import matplotlib...