神经网络
2016-11-24 本文已影响0人
Socrates1024
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)