Logistic回归

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)

你可能感兴趣的:(Logistic回归)