神经网络

BP网络#

library(ggplot2)
library(lattice)
library(kernlab)
library(caret)

train <- createDataPartition(y=iris$Species, p=0.75, list=FALSE)
training <- iris[train,]
testing <- iris[-train,]

library(nnet)

iris.nnet <-nnet(Species ~ ., linout = F, size = 10, decay = 0.01, maxit = 1000, trace = F, data = training)
table(predict(iris.nnet, testing, type='class'), testing$Species)       

你可能感兴趣的:(神经网络)