Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Deep Learning with R for Beginners

You're reading from   Deep Learning with R for Beginners Design neural network models in R 3.5 using TensorFlow, Keras, and MXNet

Arrow left icon
Product type Course
Published in May 2019
Publisher Packt
ISBN-13 9781838642709
Length 612 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Authors (4):
Arrow left icon
Mark Hodnett Mark Hodnett
Author Profile Icon Mark Hodnett
Mark Hodnett
Pablo Maldonado Pablo Maldonado
Author Profile Icon Pablo Maldonado
Pablo Maldonado
Joshua F. Wiley Joshua F. Wiley
Author Profile Icon Joshua F. Wiley
Joshua F. Wiley
Yuxi (Hayden) Liu Yuxi (Hayden) Liu
Author Profile Icon Yuxi (Hayden) Liu
Yuxi (Hayden) Liu
Arrow right icon
View More author details
Toc

Table of Contents (23) Chapters Close

Title Page
Copyright and Credits
About Packt
Contributors
Preface
1. Getting Started with Deep Learning FREE CHAPTER 2. Training a Prediction Model 3. Deep Learning Fundamentals 4. Training Deep Prediction Models 5. Image Classification Using Convolutional Neural Networks 6. Tuning and Optimizing Models 7. Natural Language Processing Using Deep Learning 8. Deep Learning Models Using TensorFlow in R 9. Anomaly Detection and Recommendation Systems 10. Running Deep Learning Models in the Cloud 11. The Next Level in Deep Learning 12. Handwritten Digit Recognition using Convolutional Neural Networks 13. Traffic Signs Recognition for Intelligent Vehicles 14. Fraud Detection with Autoencoders 15. Text Generation using Recurrent Neural Networks 16. Sentiment Analysis with Word Embedding 1. Other Books You May Enjoy Index

Document classification


This chapter will be looking at text classification using Keras. The dataset we will use is included in the Keras library. As we have done in previous chapters, we will use traditional machine learning techniques to create a benchmark before applying a deep learning algorithm. The reason for this is to show how deep learning models perform against other techniques.

The Reuters dataset

We will use the Reuters dataset, which can be accessed through a function in the Keras library. This dataset has 11,228 records with 46 categories. To see more information about this dataset, run the following code:

library(keras)
?dataset_reuters

Although the Reuters dataset can be accessed from Keras, it is not in a format that can be used by other machine learning algorithms. Instead of the actual words, the text data is a list of word indices. We will write a short script (Chapter7/create_reuters_data.R) that downloads the data and the lookup index file and creates a data frame of the...

lock icon The rest of the chapter is locked
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 $19.99/month. Cancel anytime
Banner background image