How to create a simple neural network using R
library(datasets)
names(infert)
library(neuralnet)
The hidden layers are numbered 2 here. We are traning the network here
nn <- neuralnet( case~age+parity+stratum+spontaneous+pooled.stratum, data=infert, hidden=2, err.fct="sse", linear.output=FALSE, likelihood=TRUE)
nn
plotting the neural network with 2 hidden layers and 2 inputs
plot(nn)