SVM Flashcards
Pre processing required for SVM Classification
you have to make the response variable a factor
y = as.factor(y)
You can scale the variables if needed by using a parameter in the svm function svm(…, scale = T)
how to specify the shape of the decision boundary
svm(y~., data=dat, kernel = ‘linear’…)
you can specify different values for the kernel
function used to tune svm model
library(e1071)
tune(svm, y~., data = dat, kernel = ‘linear’, ranges = list(cost(c(0.001, .01, .1, 1, 5, 10 , 100)))
what package has ROC curves
library(ROCR)
What do you want to do when p»_space; n
use a linear decision boundary
how to handle a multi-class response variable in svm
svm() function in the e1071 library will take care of it, just have to make sure that response variable is a factor. can set it to factor using y=as.factor(y)