- We start by importing all the libraries, as follows:
import matplotlib.pyplot as pltimport numpy as npimport pandas as pdfrom sklearn.preprocessing import MinMaxScalerfrom keras.layers.core import Dense, Activation, Dropoutfrom keras.layers.recurrent import LSTMfrom keras.models import Sequential
- Let's load the data and print the first rows:
data = pd.read_csv('Data/stock-data-2000-2017.csv')# Reorder the columns for conveniencedata = data[['Open', 'High', 'Low', 'Volume', 'Close']]data.head()
The following figure shows the output of the preceding code:
Figure 10.1: First five entries of the stock dataset
- Before we move ...