Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
The Deep Learning with Keras Workshop

You're reading from  The Deep Learning with Keras Workshop

Product type Book
Published in Jul 2020
Publisher Packt
ISBN-13 9781800562967
Pages 496 pages
Edition 1st Edition
Languages
Authors (3):
Matthew Moocarme Matthew Moocarme
Profile icon Matthew Moocarme
Mahla Abdolahnejad Mahla Abdolahnejad
Profile icon Mahla Abdolahnejad
Ritesh Bhagwat Ritesh Bhagwat
Profile icon Ritesh Bhagwat
View More author details

Table of Contents (11) Chapters

Preface
1. Introduction to Machine Learning with Keras 2. Machine Learning versus Deep Learning 3. Deep Learning with Keras 4. Evaluating Your Model with Cross-Validation Using Keras Wrappers 5. Improving Model Accuracy 6. Model Evaluation 7. Computer Vision with Convolutional Neural Networks 8. Transfer Learning and Pre-Trained Models 9. Sequential Modeling with Recurrent Neural Networks Appendix

9. Sequential Modeling with Recurrent Neural Networks

Activity 9.01: Predicting the Trend of Amazon's Stock Price Using an LSTM with 50 Units (Neurons)

In this activity, we will examine the stock price of Amazon for the last 5 years—from January 1, 2014, to December 31, 2018. In doing so, we will try to predict and forecast the company's future trend for January 2019 using an RNN and LSTM. We have the actual values for January 2019, so we can compare our predictions to the actual values later. Follow these steps to complete this activity:

  1. Import the required libraries:
    import numpy as np
    import matplotlib.pyplot as plt
    import pandas as pd
    from tensorflow import random
  2. Import the dataset using the pandas read_csv function and look at the first five rows of the dataset using the head method:
    dataset_training = pd.read_csv('../AMZN_train.csv')
    dataset_training.head()

    The following figure shows the output of the preceding code:

    Figure 9.24: The first...

lock icon The rest of the chapter is locked
arrow left Previous Chapter
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}