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.logistic <- multinom(Species ~ ., data = training)
table(predict(iris.logistic, testing, type="class"), testing$Species)
网友评论