Skip to Content
Neural Networks with R
book

Neural Networks with R

by Balaji Venkateswaran, Giuseppe Ciaburro
September 2017
Beginner to intermediate
270 pages
5h 53m
English
Packt Publishing
Content preview from Neural Networks with R

Let us go through the code line-by-line

To understand all the steps in the code just proposed, we will look at them in detail. First, the code snippet will be shown, and the explanation will follow.

library(NeuralNetTools)library(nnet)

This includes the libraries NeuralNetTools and nnet() for our program.

###Set working directory for the training datasetwd("C:/R")getwd()###Read the input filemydata=read.csv('RestaurantTips.csv',sep=",",header=TRUE)mydataattach(mydata)names(mydata)

This sets the working directory and reads the input CSV file.

##Train the model based on output from inputmodel=nnet(CustomerWillTip~Service+Ambience+Food,  data=mydata,  size =5,  rang=0.1,  decay=5e-2,  maxit=5000)print(model)

This calls the nnet() function with ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Deep Learning with R

Deep Learning with R

J.J. Allaire
Advanced Machine Learning with R

Advanced Machine Learning with R

Cory Lesmeister, Dr. Sunil Kumar Chinnamgari

Publisher Resources

ISBN: 9781788397872Supplemental Content