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
Neural Networks with R
Neural Networks with R

Neural Networks with R: Build smart systems by implementing popular deep learning models in R

Arrow left icon
Profile Icon Balaji Venkateswaran Profile Icon Giuseppe Ciaburro
Arrow right icon
R$50 per month
Full star icon Full star icon Full star icon Full star icon Empty star icon 4 (10 Ratings)
Paperback Sep 2017 270 pages 1st Edition
eBook
R$49.99 R$196.99
Paperback
R$245.99
Subscription
Free Trial
Renews at R$50p/m
Arrow left icon
Profile Icon Balaji Venkateswaran Profile Icon Giuseppe Ciaburro
Arrow right icon
R$50 per month
Full star icon Full star icon Full star icon Full star icon Empty star icon 4 (10 Ratings)
Paperback Sep 2017 270 pages 1st Edition
eBook
R$49.99 R$196.99
Paperback
R$245.99
Subscription
Free Trial
Renews at R$50p/m
eBook
R$49.99 R$196.99
Paperback
R$245.99
Subscription
Free Trial
Renews at R$50p/m

What do you get with a Packt Subscription?

Free for first 7 days. $19.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing
Table of content icon View table of contents Preview book icon Preview Book

Neural Networks with R

Learning Process in Neural Networks

Just as there are many different types of learning and approaches to human learning, so we can say about the machines as well. To ensure that a machine will be able to learn from experience, it is important to define the best available methodologies depending on the specific job requirements. This often means choosing techniques that work for the present case and evaluating them from time to time, to determine if we need to try something new.

 We have seen the basics of neural networks in Chapter 1, Neural Network and Artificial Intelligence Concepts, and also two simple implementations using R. In this chapter, we will deal with the learning process, that is how to train, test, and deploy a neural network machine learning model. The training phase is used for learning, to fit the parameters of the neural networks. The testing phase is...

What is machine learning?

What do we mean by the term machine learning? The definition is quite difficult, to do so, we are asking large field of scientists to help. We can mention an artificial intelligence pioneer's quote:

"Field of study that gives computers the ability to learn without being explicitly programmed." 

 – Arthur Samuel

Machine learning is about training a model or an algorithm with data and then using the model to predict any new data. For example, a toddler is taught how to walk from his crawling phase. Initially, the toddler's parents hold the toddler's hand to help him up, and he is taught through the data that is given. On the basis of these procedures, if an obstacle presents itself in the toddler's path or if there is a turn somewhere, the toddler is able to navigate on his own after the training. The...

Supervised learning

Supervised learning is a learning method where there is a part of the training data which acts as a teacher to the algorithm to determine the model. The machine is taught what to learn from the target data. The target data, or dependent or response variables, are the outcome of the collective action of the independent variables. The network training is done with the target data and its behavior with patterns of input data. The target labels are known in advance and the data is fed to the algorithm to derive the model.

Most of neural network usage is done using supervised learning. The weights and biases are adjusted based on the output values. The output can be categorical (like true/false or 0/1/2) or continuous (like 1,2,3, and so on). The model is dependent on the type of output variables, and in the case of neural networks, the output layer is built on...

Unsupervised learning

In unsupervised learning (or self organization), the output layer is trained to organize the input data into another set of data without the need of a target variable. The input data is analyzed and patterns are found in it to derive the output, as shown in the following figure. Since there is no teacher (or target variable), this type of learning is called unsupervised learning.

The different techniques available for unsupervised learning are as follows:

  • Clustering (K-means, hierarchical)
  • Association techniques
  • Dimensionality reduction
  • Self Organizing Map (SOM)/ Kohonen networks

To summarize, the two main types of machine learning are depicted in the following figure:

For neural networks, we have both the types available, using different ways available in R.

Reinforcement learning

Reinforcement learning is a type of machine learning where there is constant feedback given to the model to adapt to the environment. There is a performance evaluation at each step to improve the model. For neural networks, there is a special type called Q-learning, combined with neuron to implement reinforcement learning in the backpropagation feedback mechanism. The details are out of scope of this book.

The following are the three types of learnings we have covered so far:

Training and testing the model

Training and testing the model forms the basis for further usage of the model for prediction in predictive analytics. Given a dataset of 100 rows of data, which includes the predictor and response variables, we split the dataset into a convenient ratio (say 70:30) and allocate 70 rows for training and 30 rows for testing. The rows are selected in random to reduce bias.

Once the training data is available, the data is fed to the neural network to get the massive universal function in place. The training data determines the weights, biases, and activation functions to be used to get to output from input. Until recently, we could not say that a weight has a positive or a negative influence on the target variable. But now we've been able to shed some light inside the black box. For example, by plotting a trained neural network, we can discover trained...

What is machine learning?


What do we mean by the term machine learning? The definition is quite difficult, to do so, we are asking large field of scientists to help. We can mention an artificial intelligence pioneer's quote:

"Field of study that gives computers the ability to learn without being explicitly programmed." 

 – Arthur Samuel

Machine learning is about training a model or an algorithm with data and then using the model to predict any new data. For example, a toddler is taught how to walk from his crawling phase. Initially, the toddler's parents hold the toddler's hand to help him up, and he is taught through the data that is given. On the basis of these procedures, if an obstacle presents itself in the toddler's path or if there is a turn somewhere, the toddler is able to navigate on his own after the training. The data used for training is the training data and the recipient continues to learn even after the formal training.

Machines too can be taught like toddlers to do a task based...

Supervised learning


Supervised learning is a learning method where there is a part of the training data which acts as a teacher to the algorithm to determine the model. The machine is taught what to learn from the target data. The target data, or dependent or response variables, are the outcome of the collective action of the independent variables. The network training is done with the target data and its behavior with patterns of input data. The target labels are known in advance and the data is fed to the algorithm to derive the model.

Most of neural network usage is done using supervised learning. The weights and biases are adjusted based on the output values. The output can be categorical (like true/false or 0/1/2) or continuous (like 1,2,3, and so on). The model is dependent on the type of output variables, and in the case of neural networks, the output layer is built on the type of target variable.

Note

For neural networks, all the independent and dependent variables need to be numeric...

Unsupervised learning


In unsupervised learning (or self organization), the output layer is trained to organize the input data into another set of data without the need of a target variable. The input data is analyzed and patterns are found in it to derive the output, as shown in the following figure. Since there is no teacher (or target variable), this type of learning is called unsupervised learning.

The different techniques available for unsupervised learning are as follows:

  • Clustering (K-means, hierarchical)
  • Association techniques
  • Dimensionality reduction
  • Self Organizing Map (SOM)/ Kohonen networks

To summarize, the two main types of machine learning are depicted in the following figure:

For neural networks, we have both the types available, using different ways available in R.

Reinforcement learning


Reinforcement learning is a type of machine learning where there is constant feedback given to the model to adapt to the environment. There is a performance evaluation at each step to improve the model. For neural networks, there is a special type called Q-learning, combined with neuron to implement reinforcement learning in the backpropagation feedback mechanism. The details are out of scope of this book.

The following are the three types of learnings we have covered so far:

Training and testing the model


Training and testing the model forms the basis for further usage of the model for prediction in predictive analytics. Given a dataset of 100 rows of data, which includes the predictor and response variables, we split the dataset into a convenient ratio (say 70:30) and allocate 70 rows for training and 30 rows for testing. The rows are selected in random to reduce bias.

Once the training data is available, the data is fed to the neural network to get the massive universal function in place. The training data determines the weights, biases, and activation functions to be used to get to output from input. Until recently, we could not say that a weight has a positive or a negative influence on the target variable. But now we've been able to shed some light inside the black box. For example, by plotting a trained neural network, we can discover trained synaptic weights and basic information about the training process.

Once the sufficient convergence is achieved, the...

The data cycle


The data forms a key component for model building and the learning process. The data needs to be collected, cleaned, converted, and then fed to the model for learning. The overall data life cycle is shown as follows:

One of the critical requirements for modeling is having good and balanced data. This helps in higher accuracy models and better usage of the available algorithms. A data scientist's time is mostly spent on cleansing the data before building the model.

We have seen the training and testing before deployment of the model. For testing, the results are captured as evaluation metrics, which helps us decide if we should use a particular model or change it instead.

We will see the evaluation metrics next.

Evaluation metrics


Evaluating a model involves checking if the predicted value is equal to the actual value during the testing phase. There are various metrics available to check the model, and they depend on the state of the target variable.

For a binary classification problem, the predicted target variable and the actual target variable can be in any of the following four states:

Predicted

Actual

Predicted = TRUE

Actual = TRUE

Predicted = TRUE

Actual = FALSE

Predicted = FALSE

Actual = TRUE

Predicted = FALSE

Actual = FALSE

 

When we have the predicted and actual values as same values, we are said to be accurate. If all predicted and actual values are same (either all TRUE or all FALSE), the model is 100 percent accurate. But, this is never the case.

Since neural networks are approximation models, there is always a bit of error possible. All the four states mentioned in the previous table are possible.

We define the following terminology and metrics for a model:

  • True Positives (TP): All cases where the...

Learning in neural networks


As we saw in Chapter 1, Neural Network and Artificial Intelligence Concepts, neural networks is a machine learning algorithm that has the ability to learn from data and give us predictions using the model built. It is a universal function approximation, that is, any input, output data can be approximated to a mathematical function. 

The forward propagation gives us an initial mathematical function to arrive at output(s) based on inputs by choosing random weights. The difference between the actual and predicted is called the error term. The learning process in a feed-forward neural network actually happens during the backpropagation stage. The model is fine tuned with the weights by reducing the error term in each iteration. Gradient descent is used in the backpropagation process.

Let us cover the backpropagation in detail in this chapter, as it is an important machine learning aspect for neural networks.

Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • Develop a strong background in neural networks with R, to implement them in your applications
  • Build smart systems using the power of deep learning
  • Real-world case studies to illustrate the power of neural network models

Description

Neural networks are one of the most fascinating machine learning models for solving complex computational problems efficiently. Neural networks are used to solve wide range of problems in different areas of AI and machine learning. This book explains the niche aspects of neural networking and provides you with foundation to get started with advanced topics. The book begins with neural network design using the neural net package, then you’ll build a solid foundation knowledge of how a neural network learns from data, and the principles behind it. This book covers various types of neural network including recurrent neural networks and convoluted neural networks. You will not only learn how to train neural networks, but will also explore generalization of these networks. Later we will delve into combining different neural network models and work with the real-world use cases. By the end of this book, you will learn to implement neural network models in your applications with the help of practical examples in the book.

Who is this book for?

This book is intended for anyone who has a statistical background with knowledge in R and wants to work with neural networks to get better results from complex data. If you are interested in artificial intelligence and deep learning and you want to level up, then this book is what you need!

What you will learn

  • Set up R packages for neural networks and deep learning
  • Understand the core concepts of artificial neural networks
  • Understand neurons, perceptrons, bias, weights, and activation functions
  • Implement supervised and unsupervised machine learning in R for neural networks
  • Predict and classify data automatically using neural networks
  • Evaluate and fine-tune the models you build.

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Sep 27, 2017
Length: 270 pages
Edition : 1st
Language : English
ISBN-13 : 9781788397872
Category :
Languages :
Concepts :

What do you get with a Packt Subscription?

Free for first 7 days. $19.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing

Product Details

Publication date : Sep 27, 2017
Length: 270 pages
Edition : 1st
Language : English
ISBN-13 : 9781788397872
Category :
Languages :
Concepts :

Packt Subscriptions

See our plans and pricing
Modal Close icon
R$50 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
R$500 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just R$25 each
Feature tick icon Exclusive print discounts
R$800 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just R$25 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total R$ 825.97
Machine Learning with R Cookbook, Second Edition
R$306.99
Neural Networks with R
R$245.99
R Deep Learning Cookbook
R$272.99
Total R$ 825.97 Stars icon
Banner background image

Table of Contents

7 Chapters
Neural Network and Artificial Intelligence Concepts Chevron down icon Chevron up icon
Learning Process in Neural Networks Chevron down icon Chevron up icon
Deep Learning Using Multilayer Neural Networks Chevron down icon Chevron up icon
Perceptron Neural Network Modeling – Basic Models Chevron down icon Chevron up icon
Training and Visualizing a Neural Network in R Chevron down icon Chevron up icon
Recurrent and Convolutional Neural Networks Chevron down icon Chevron up icon
Use Cases of Neural Networks – Advanced Topics Chevron down icon Chevron up icon

Customer reviews

Top Reviews
Rating distribution
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
(10 Ratings)
5 star 50%
4 star 20%
3 star 20%
2 star 0%
1 star 10%
Filter icon Filter
Top Reviews

Filter reviews by




ajitB Oct 19, 2017
Full star icon Full star icon Full star icon Full star icon Full star icon 5
No single book today does as good a job as this one in blending the right amount of theory with real-life examples and coverage of all the current useful algorithms
Amazon Verified review Amazon
Kindle Customer May 27, 2019
Full star icon Full star icon Full star icon Full star icon Full star icon 5
With the help of R, this book helped me understand A.I. In a steady and reasonable progression. Thank you much.
Amazon Verified review Amazon
Karthikeyan.S Sep 29, 2017
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Good one!!!
Amazon Verified review Amazon
Leonardo Damasceno Dec 11, 2017
Full star icon Full star icon Full star icon Full star icon Full star icon 5
The book is well written and the presentation is sequential, great for anyone who wants to understand the theme.
Amazon Verified review Amazon
vinay thakur Apr 01, 2018
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Good Book to learn ANN with R ... Highly recommended to buy this book for All the R programming lover and Data science lover . Cheers
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

What is included in a Packt subscription? Chevron down icon Chevron up icon

A subscription provides you with full access to view all Packt and licnesed content online, this includes exclusive access to Early Access titles. Depending on the tier chosen you can also earn credits and discounts to use for owning content

How can I cancel my subscription? Chevron down icon Chevron up icon

To cancel your subscription with us simply go to the account page - found in the top right of the page or at https://subscription.packtpub.com/my-account/subscription - From here you will see the ‘cancel subscription’ button in the grey box with your subscription information in.

What are credits? Chevron down icon Chevron up icon

Credits can be earned from reading 40 section of any title within the payment cycle - a month starting from the day of subscription payment. You also earn a Credit every month if you subscribe to our annual or 18 month plans. Credits can be used to buy books DRM free, the same way that you would pay for a book. Your credits can be found in the subscription homepage - subscription.packtpub.com - clicking on ‘the my’ library dropdown and selecting ‘credits’.

What happens if an Early Access Course is cancelled? Chevron down icon Chevron up icon

Projects are rarely cancelled, but sometimes it's unavoidable. If an Early Access course is cancelled or excessively delayed, you can exchange your purchase for another course. For further details, please contact us here.

Where can I send feedback about an Early Access title? Chevron down icon Chevron up icon

If you have any feedback about the product you're reading, or Early Access in general, then please fill out a contact form here and we'll make sure the feedback gets to the right team. 

Can I download the code files for Early Access titles? Chevron down icon Chevron up icon

We try to ensure that all books in Early Access have code available to use, download, and fork on GitHub. This helps us be more agile in the development of the book, and helps keep the often changing code base of new versions and new technologies as up to date as possible. Unfortunately, however, there will be rare cases when it is not possible for us to have downloadable code samples available until publication.

When we publish the book, the code files will also be available to download from the Packt website.

How accurate is the publication date? Chevron down icon Chevron up icon

The publication date is as accurate as we can be at any point in the project. Unfortunately, delays can happen. Often those delays are out of our control, such as changes to the technology code base or delays in the tech release. We do our best to give you an accurate estimate of the publication date at any given time, and as more chapters are delivered, the more accurate the delivery date will become.

How will I know when new chapters are ready? Chevron down icon Chevron up icon

We'll let you know every time there has been an update to a course that you've bought in Early Access. You'll get an email to let you know there has been a new chapter, or a change to a previous chapter. The new chapters are automatically added to your account, so you can also check back there any time you're ready and download or read them online.

I am a Packt subscriber, do I get Early Access? Chevron down icon Chevron up icon

Yes, all Early Access content is fully available through your subscription. You will need to have a paid for or active trial subscription in order to access all titles.

How is Early Access delivered? Chevron down icon Chevron up icon

Early Access is currently only available as a PDF or through our online reader. As we make changes or add new chapters, the files in your Packt account will be updated so you can download them again or view them online immediately.

How do I buy Early Access content? Chevron down icon Chevron up icon

Early Access is a way of us getting our content to you quicker, but the method of buying the Early Access course is still the same. Just find the course you want to buy, go through the check-out steps, and you’ll get a confirmation email from us with information and a link to the relevant Early Access courses.

What is Early Access? Chevron down icon Chevron up icon

Keeping up to date with the latest technology is difficult; new versions, new frameworks, new techniques. This feature gives you a head-start to our content, as it's being created. With Early Access you'll receive each chapter as it's written, and get regular updates throughout the product's development, as well as the final course as soon as it's ready.We created Early Access as a means of giving you the information you need, as soon as it's available. As we go through the process of developing a course, 99% of it can be ready but we can't publish until that last 1% falls in to place. Early Access helps to unlock the potential of our content early, to help you start your learning when you need it most. You not only get access to every chapter as it's delivered, edited, and updated, but you'll also get the finalized, DRM-free product to download in any format you want when it's published. As a member of Packt, you'll also be eligible for our exclusive offers, including a free course every day, and discounts on new and popular titles.