Specifying cross-cross validation using tune.svm () in R

I have two lists of parameters (gamma and cost) that I want to select using SVM. I want to do 5x cross validation, but my code does 10x cross validation (which is the default). My code looks like this:

prioir_svm <- tune.svm(train, y = trainY, cost = Cs, gamma = gammas, cross = 5) 

Can someone tell me what is wrong?

+5
source share
1 answer

Try this instead:

 tc <- tune.control(cross = 5) prioir_svm <- tune.svm(train, y = trainY, cost = Cs, gamma = gammas, tunecontrol = tc) 

see ?tune.control for details

+8
source

Source: https://habr.com/ru/post/1215531/


All Articles