1
$\begingroup$

I am trying to learn how to use the svm modeler e1071 in R. When I run my model I get what seems to be an obnoxiously high number of support vectors and a terrible "best performance" of 12% using tune. From eyeballing the data it should be very simple for an SVM to place a hyperplane that divides the classes. when I run model$coefs it shows me all the coefs have the same value as the cost. I must be doing something wrong. Can anyone tell me where my mistake is? Surely it is possible to have better performance than 12%.

Here is my data https://drive.google.com/file/d/17NzAy6V5uZ4lZC7sm0Ou3ooZ01-Tw0jX/view?usp=sharing. When I run

tune(svm,V1~.,data=trainsvm,kernel="linear",ranges=list(cost=c(0.001,0.01,0.1,1,5,10)),scale=F) 

says best parameter for cost is 0.01 and best performance is 0.1273417.

model<-svm(V1~.,data=trainsvm,kernel="linear",cost=0.01,type="C-classification",scale=T)` 

gives me 1224 support vectors if I ask it to show me the coefs model$coefs they are all 0.01 or -0.01.

Here is what the data looks like in excel

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.