SVM Flashcards

1
Q

Pre processing required for SVM Classification

A

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 well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

how to specify the shape of the decision boundary

A

svm(y~., data=dat, kernel = ‘linear’…)

you can specify different values for the kernel

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

function used to tune svm model

A

library(e1071)

tune(svm, y~., data = dat, kernel = ‘linear’, ranges = list(cost(c(0.001, .01, .1, 1, 5, 10 , 100)))

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

what package has ROC curves

A

library(ROCR)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What do you want to do when p&raquo_space; n

A

use a linear decision boundary

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

how to handle a multi-class response variable in svm

A

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)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly