I simulate a simple linear setup:
n = 1000 X = runif(n) Y = runif(n) ind = X + 2*Y < 1 ind[ind == TRUE] = runif(sum(ind)) < 1 plot(X,Y,col = ind + 1)
svm() functcion from
e1071 performs very well but it gives me a lot of vectors.
Call: svm(formula = ind ~ X + Y, type = "C-classification", kernel = "linear") Parameters: SVM-Type: C-classification SVM-Kernel: linear cost: 1 Number of Support Vectors: 99
Can you please tell me what and how should I tune to get one vector (or just a few)?
costparameter to have less support vectors. If the kernel you use is linear,
gammais not used. $\endgroup$
gammawas there from my another tests, I will update the code. $\endgroup$
e1071package there is a
tune.svmprocedure, which takes a given set of parameters and does CV automatically, but this is a bit different story. Thanks for helping with this one :) $\endgroup$