R-4.0.2 语言实现SVM

library(lattice)

xyplot(Petal.Length ~ Petal.Width, data = iris, groups = Species,  auto.key=list(corner=c(1,0)))

 

 

R-4.0.2 语言实现SVM_第1张图片

 

 

data("iris")
attach(iris)
subdata<-iris[iris$Species != 'virginica',]
subdata$Species<-factor(subdata$Species)
 
library(e1071)
model1<-svm(Species ~ Petal.Length+Petal.Width,data=subdata)
plot(model1, subdata, Petal.Length ~ Petal.Width)

 

 

 

R-4.0.2 语言实现SVM_第2张图片

你可能感兴趣的:(算法)