Hello all,

I am using the e1071 SVM with the tune options for classification, which work 
pretty well, given the examples of using tune.svm function for classification. 
But I have not found any example to tune the SVM novelty detection 
(one-classification) parameters (gamma, cost, nu), for example this are some of 
the options I have tried with no success:

obj<-tune(svm, x,y, type ="one-classification", gamma=2^(-1:1), cost=2^(1:3), 
nu=2^(-3:-1))
obj<-tune(svm, x,y, type ="one-classification", cost=2^(1:3), nu=2^(-3:-1))
obj<-tune(svm, x,y, type ="one-classification", gamma=2^(-1:1), nu=2^(-3:-1))
obj<-tune(svm, x,y, type ="one-classification", nu=2^(-3:-1))
obj<-tune(svm, x,y, type ="one-classification", gamma=2^(-1:1), cost=2^(1:3))

y is expressed as factor of [ 1,-1] values

also I tried:
obj<-tune(svm, x,y, type ="one-classification", ranges = list(gamma=2^(-1:1), 
cost=2^(1:3), nu=2^(-3:-1)))
and all the parameters combination showed above, but always the same message: 

Error in tune(svm, x, y, ranges = ......, type = "one-classification") : 
  Dependent variable has wrong type!

But if I try:

svm.model <-svm(x,y,type = "one-classification",gamma=2, cost =3, nu=0.001)

it runs without problems. Please, let me know whether what I should change in 
my code or the e1071 tune function does not work with SVM one-classification

Alfonso Torres
        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to