July 2019
Intermediate to advanced
512 pages
19h 39m
English
Now, we will see how we can prepare our dataset in a way that our LSTM network needs. First, we read the input dataset as follows:
df = pd.read_csv('data/btc.csv')
Then we display a few rows of the dataset:
df.head()
The preceding code generates the following output:

As shown in the preceding data frame, the Close column represents the closing price of Bitcoin. We need only the Close column to make predictions, so we take that particular column alone:
data = df['Close'].values
Next, we standardize the data and bring it to the same scale:
scaler = StandardScaler()data = scaler.fit_transform(data.reshape(-1, 1))
We then plot ...
Read now
Unlock full access