Artificial Neural Network-R Part 2

1
112

Artificial Neural Network- In this section we would build ANN and fit it into training data set. We would R-Package which offers the most options and works very efficiently while building the model. Efficiency of package is very important as the algorithm we trying to build is very complex and time consuming.

Step 1: First we need to install the required packages. For our analysis we would use ‘h2o’, as it is very efficient. Use the below commands to install the package.

R_ANN7

Step 2: As we know ANN algorithms are very complex and would require lot’s of computation. We would need to connect with external server to implement the ANN algorithm. Please use below command to connect to external server.

R_ANN8

Step 3:Now we are ready to build the ANN algorithm suitable for our business problem. We would see comands of functions required to implment the ANN are very easy while we use ‘h2o’ package. Let’s continue with our implmentaion of algorithm. In next step we would create a classifier.

R_ANN9

In the above defined classifier we are using ‘h2o’ function. Thee are several options available in ‘h2o’, but we have used the most basic and the important options. The activation function we have used is “Rectifier” . In “hidden =” option let us choose number of hidden layers and input nodes. As we can see we have kept c(6,6), so we have two parameters by which we opted for 2 hidden layers and (6,6) let us choose input variables to be equal to 6. So both the nodes would have 6 variables each.

Step 4: Testing the accuracy of classifier on the test data set.

R_ANN91

Step 5: Develop confusion matrix using following command

R_ANN92

Finally disconnect from ‘h2o’ server using following command.

h2o.shutdown()

1 COMMENT

  1. I?¦m not positive the place you’re getting your information, however good topic. I must spend a while studying more or understanding more. Thank you for excellent information I used to be on the lookout for this info for my mission.

LEAVE A REPLY

Please enter your comment!
Please enter your name here