0
votes

I have performed both Logistic Regression and SVM on my dataset using train and test sets. Now, in order to check that my results are robust, I want to perform cross validation (I am using caret package).

I am using this code:

train_control <- trainControl(method="repeatedcv", number=10, repeats=10)

model <- train(response ~., data=df, trControl=train_control, method="glm")

However, to me, it seems that I am only checking the accuracy of my logistic regression model (since I am using method="glm"). How can I use cross validation to check the accuracy of my SVM model? (a method called 'svm' does not exist)

1

1 Answers

0
votes

there are a few svm methods in Caret:

"svmLinear" : which uses the linear kernel

"svmPoly" : which uses the polynomial kernel

"svmRadial" : which uses the Radial Basis Function kernel

Check out this site for all the available models supported by Caret https://topepo.github.io/caret/available-models.html