Book Image

R Deep Learning Essentials

By : Joshua F. Wiley
Book Image

R Deep Learning Essentials

By: Joshua F. Wiley

Overview of this book

<p>Deep learning is a branch of machine learning based on a set of algorithms that attempt to model high-level abstractions in data by using model architectures. With the superb memory management and the full integration with multi-node big data platforms, the H2O engine has become more and more popular among data scientists in the field of deep learning.</p> <p>This book will introduce you to the deep learning package H2O with R and help you understand the concepts of deep learning. We will start by setting up important deep learning packages available in R and then move towards building models related to neural networks, prediction, and deep prediction, all of this with the help of real-life examples.</p> <p>After installing the H2O package, you will learn about prediction algorithms. Moving ahead, concepts such as overfitting data, anomalous data, and deep prediction models are explained. Finally, the book will cover concepts relating to tuning and optimizing models.</p>
Table of Contents (14 chapters)
R Deep Learning Essentials
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface
Bibliography
Index

Preface

This book is about how to train and use deep learning models or deep neural networks in the R programming language and environment. This book is not intended to provide an in-depth theoretical coverage of deep neural networks, but it will give you enough background to help you understand their basics and use and interpret the results. This book will also show you some of the packages and functions available to train deep neural networks, optimize their hyperparameters to improve the accuracy of your model, and generate predictions or otherwise use the model you built. The book is intended to provide an easy-to-read coverage of the essentials in order to get going with real-life examples and applications.

What this book covers

Chapter 1, Getting Started with Deep Learning, shows how to get the R and H2O packages set up and installed on a computer or server along with covering all the basic concepts related to deep learning.

Chapter 2, Training a Prediction Model, covers how to build a shallow unsupervised neural network prediction model.

Chapter 3, Preventing Overfitting, explains different approaches that can be used to prevent models from overfitting the data in order to improve generalizability called regularization on unsupervised data.

Chapter 4, Identifying Anomalous Data, covers how to perform unsupervised deep learning in order to identify anomalous data, such as fraudulent activity or outliers.

Chapter 5, Training Deep Prediction Models, shows how to train deep neural networks to solve prediction and classification problems, such as image recognition.

Chapter 6, Tuning and Optimizing Models, explains how to adjust model tuning parameters to improve and optimize the accuracy and performance of deep learning models.

Appendix, Bibliography, contains the references for all the citations throughout the book.

What you need for this book

You do not need much to use for this book. The main piece of software that you need is R, which is open source and runs on Windows, Mac OS, and many varieties of Linux. You will also need a recent version of Java. Once you have R and Java installed, you will need to install some R packages, all of which work on every major operating system.

Perhaps, the more challenging requirement is that, for any real deep learning application, and even to explore quite small examples, modern hardware is required. For this book, I primarily used a desktop with an Intel Xeon E5-2670 v2 running at 2.50 GHz (10 physical cores, 20 logical cores), with 32 GB of memory, and a Samsung 850 PRO 512GB SSD. You do not necessarily need an equivalent system, but I found that running some examples on a latest laptop with 16 GB of memory and a dual core i7 processor is time consuming.

Who this book is for

This book caters to aspiring data scientists who are well-versed with machine learning concepts with R and are looking to explore the deep learning paradigm using the packages available in R. You should have a fundamental understanding of the R language and be comfortable with statistical algorithms and machine learning techniques, but you do not need to be well-versed with deep learning concepts.

Conventions

In this book, you will find a number of text styles that distinguish between different kinds of information. Here are some examples of these styles and an explanation of their meaning.

Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "Of course, we cannot actually use the library() function until we have installed the packages."

A block of code is set as follows:

## uncomment to install the checkpoint package
## install.packages("checkpoint")
library(checkpoint)

checkpoint("2016-02-20", R.version = "3.2.3")

When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:

performance.outsample[,-4]
  Size Maxit Shuffle Accuracy AccuracyLower AccuracyUpper
1   40    60   FALSE     0.93          0.92          0.94
2   20   100   FALSE     0.92          0.91          0.93
3   20   100    TRUE     0.92          0.91          0.93
4   50   100   FALSE     0.91          0.90          0.92
5   50   100   FALSE     0.92          0.91          0.93

Any command-line input or output is written as follows:

h2oiris <- as.h2o(
  droplevels(iris[1:100, ]))

New terms and important words are shown in bold.

Note

Warnings or important notes appear in a box like this.

Tip

Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or disliked. Reader feedback is important for us as it helps us develop titles that you will really get the most out of.

To send us general feedback, simply e-mail , and mention the book's title in the subject of your message.

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide at www.packtpub.com/authors.

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Downloading the example code

You can download the example code files for this book from your account at http://www.packtpub.com. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.

You can download the code files by following these steps:

  1. Log in or register to our website using your e-mail address and password.

  2. Hover the mouse pointer on the SUPPORT tab at the top.

  3. Click on Code Downloads & Errata.

  4. Enter the name of the book in the Search box.

  5. Select the book for which you're looking to download the code files.

  6. Choose from the drop-down menu where you purchased this book from.

  7. Click on Code Download.

Once the file is downloaded, please make sure that you unzip or extract the folder using the latest version of:

  • WinRAR / 7-Zip for Windows

  • Zipeg / iZip / UnRarX for Mac

  • 7-Zip / PeaZip for Linux

Downloading the color images of this book

We also provide you with a PDF file that has color images of the screenshots/diagrams used in this book. The color images will help you better understand the changes in the output. You can download this file from https://www.packtpub.com/sites/default/files/downloads/RDeepLearningEssentials_ColorImages.pdf.

Errata

Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you could report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/submit-errata, selecting your book, clicking on the Errata Submission Form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded to our website or added to any list of existing errata under the Errata section of that title.

To view the previously submitted errata, go to https://www.packtpub.com/books/content/support and enter the name of the book in the search field. The required information will appear under the Errata section.

Piracy

Piracy of copyrighted material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works in any form on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at with a link to the suspected pirated material.

We appreciate your help in protecting our authors and our ability to bring you valuable content.

Questions

If you have a problem with any aspect of this book, you can contact us at , and we will do our best to address the problem.