R 서포트 벡터 머신

1 개요[ | ]

R 서포트 벡터 머신
library(e1071) # svm()
model = svm(Species ~ ., data=iris)
summary(model)
x = subset(iris, select = -Species)
y = iris$Species

model = svm(x, y)
summary(model)

pred = predict(model, x)
table(pred, y)

pred = predict(model, x, decision.values = TRUE)
attr(pred, "decision.values")[1:4,]
plot(cmdscale(dist(iris[,-5])),
     col = as.integer(iris[,5]),
     pch = c("o","+")[1:150 %in% model$index + 1])

2 같이 보기[ | ]

3 참고[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}