R Deep Learning Essentials
Second Edition
A step-by-step guide to building deep learning models using TensorFlow, Keras, and MXNet
Mark Hodnett
Joshua F. Wiley
BIRMINGHAM - MUMBAI
R Deep Learning EssentialsSecond Edition
Copyright 2018 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the authors, nor Packt Publishing or its dealers and distributors, will be held liable for any damages caused or alleged to have been caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
Commissioning Editor: Sunith Shetty
Acquisition Editor: Aman Singh
Content Development Editor: Snehal Kolte
Technical Editor: Dinesh Chaudhary
Copy Editor: Safis Editing
Project Coordinator: Manthan Patel
Proofreader: Safis Editing
Indexer: Tejal Daruwale Soni
Graphics: Jisha Chirayil
Production Coordinator: Nilesh Mohite
First published: March 2016
Second edition: August 2018
Production reference: 2230818
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham
B3 2PB, UK.
ISBN 978-1-78899-289-3
www.packtpub.com
mapt.io
Mapt is an online digital library that gives you full access to over 5,000 books and videos, as well as industry leading tools to help you plan your personal development and advance your career. For more information, please visit our website.
Why subscribe?
Spend less time learning and more time coding with practical eBooks and Videos from over 4,000 industry professionals
Improve your learning with Skill Plans built especially for you
Get a free eBook or video every month
Mapt is fully searchable
Copy and paste, print, and bookmark content
PacktPub.com
Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at service@packtpub.com for more details.
At www.PacktPub.com , you can also read a collection of free technical articles, sign up for a range of free newsletters, and receive exclusive discounts and offers on Packt books and eBooks.
Contributors
About the authors
Mark Hodnett is a data scientist with over 20 years of industry experience in software development, business intelligence systems, and data science. He has worked in a variety of industries, including CRM systems, retail loyalty, IoT systems, and accountancy. He holds a master's in data science and an MBA.
He works in Cork, Ireland, as a senior data scientist with AltViz.
I would like to thank Sharon for her patience while I worked on this project. I would also like to acknowledge the great work of J. J. Allaire, Hadley Wickham, the entire RStudio team, and all other contributors for their ongoing support of the R language. Finally, I would like to thank the team at Packt and the technical reviewer who helped deliver this project.
Joshua F. Wiley is a lecturer at Monash University, conducting quantitative research on sleep, stress, and health. He earned his Ph.D. from the University of California, Los Angeles and completed post doctoral training in primary care and prevention. In statistics and data science, Joshua focuses on biostatistics and is interested in reproducible research and graphical displays of data and statistical models. He develops or co-develops a number of R packages including varian, a package to conduct Bayesian scale-location structural equation models, and MplusAutomation, a popular package that links R to the commercial Mplus software.
About the reviewer
Vitor Bianchi Lanzetta is an economist with a masters in applied economics from the University of So Paulo, one of the most reputable universities in Latin America. He is very passionate about data science and has done academic research using neural networks, and he has co-authored Hands-On Data Science with R. He also authored R Data Visualization Recipes and reviewed Mike Bernicos Deep Learning Quick Reference.
Packt is searching for authors like you
If you're interested in becoming an author for Packt, please visit authors.packtpub.com and apply today. We have worked with thousands of developers and tech professionals, just like you, to help them share their insight with the global tech community. You can make a general application, apply for a specific hot topic that we are recruiting an author for, or submit your own idea.
Preface
Deep learning is probably the hottest technology in data science right now, and R is one of the most popular data science languages. However, R is not considered as an option for deep learning by many people, which is a shame, as R is a wonderful language for data science. This book shows that R is a viable option for deep learning, because it supports libraries such as MXNet and Keras.
When I decided to write this book, I had numerous goals. First, I wanted to show how to apply deep learning to various tasks, and not just to computer vision and n atural language processing. This book covers those topics, but it also shows how to use deep learning for prediction, regression, anomaly detection, and recommendation systems. The second goal was to look at topics in deep learning that are not covered well elsewhere; for example, interpretability with LIME, deploying models, and using the cloud for deep learning. The last goal was to give an overall view of deep learning and not just provide machine learning code. I think I achieved this by discussing topics such as how to create datasets from raw data, how to benchmark models against each other, how to manage data when model building, and how to deploy your models. My hope is that by the end of this book, you will also be convinced that R is a valid choice for use in deep learning.
Who this book is for
If you have some experience with R and are looking for a book that shows some practical examples of how to use R for deep learning, this is the book for you! This book assumes that you are familiar with some of the concepts in machine learning, such as splitting data into train and test sets. Anyone who has built machine learning algorithms in R should have no problem with this book.
Next page