I am new to R and I am learning the e1071 packages' svm function.
Following are the few questions I have.
- How does the plot function work?
I cannot understand the plotting case with more than 2 factors in the class variable. Like in the line below, why Petal.Width
and Petal.Length
are chosen as the two dimensions for plotting and how other dimensions affect the result? Moreover, I am also not clear with the slice parameter, what is it and why the values 3 and 4 are set?
plot(model,iris, Petal.Width ~ Petal.Length, slice= list(Sepal.Width=3,Sepal.Length=4))
- What is the tune function and how we choose the gamma and cost variables as shown in this example in the cran documentation.
obj <- tune.svm(Species~., data = iris, gamma = 2^(-1:1), cost = 2^(2:4))