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

Testing the network

We finally have the network trained and ready for use. Now, we can use it to make our predictions. Remember, we've set aside 30 percent of available data and then use them to test the network. It's time to use it.

predict_net_test <- compute(net,test_data[,1:9])

To predict data, we have used the compute function, which computes the outputs of all neurons for specific arbitrary covariate vectors, given a trained neural network. Let's look at the results by printing the first ten lines:

> head(predict_net_test$net.result,n=10)                 [,1]                       [,2]1  0.9999999935589190 0.0000000035872535107208482  0.0000011083596034 0.9999993767645581899117254  0.9792070465712006 0.0171647096645310796858565 0.9999999746453074 0.000000021909385204003642 ...
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