# NOT RUN {
# Example on iris dataset:
randDraw <- sample(1:nrow(iris), size = 100)
train <- iris[randDraw,]
test <- iris[setdiff(1:nrow(iris), randDraw),]
plot(iris[,1:4], pch = as.numeric(iris$Species))
NN <- neuralnetwork(train[,-5], train$Species, hiddenLayers = c(5, 5),
momentum = 0.8, learnRate = 0.001, verbose = FALSE)
plot(NN)
pred <- predict(NN, newdata = test[,-5])
plot(test[,-5], pch = as.numeric(test$Species),
col = as.numeric(test$Species == pred$predictions)+2)
#For other examples see function example_NN()
# }
Run the code above in your browser using DataLab