Advertisement
Guest User

Untitled

a guest
Dec 21st, 2014
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. fit.ksvm <- ksvm(Species~., data=iris, kernel= "rbfdot", prob.model=TRUE)
  2. fit.ksvm
  3.  
  4. plot(fit.ksvm, data=iris)
  5.  
  6. > plot(fit.ksvm, data=iris)
  7. Error in .local(x, ...) :
  8. plot function only supports binary classification
  9.  
  10. two-way SVM classification
  11. x <- rbind(matrix(rnorm(120),,2),matrix(rnorm(120,mean=3),,2))
  12. y <- matrix(c(rep(1,60),rep(-1,60)))
  13.  
  14. svp <- ksvm(x,y,type="C-svc")
  15. plot(svp,data=x)
  16.  
  17. library(e1071)
  18. m <- svm(Species~., data = iris)
  19. plot(m, iris, Petal.Width ~ Petal.Length, slice = list(Sepal.Width = 3, Sepal.Length = 4))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement