在 R 中使用 tune.svm() 指定 k 折交叉验证
Specifying k-fold cross validation using tune.svm() in R
我有两个参数列表(gamma 和成本),我想 select 使用 SVM。我想进行 5 折交叉验证,但我的代码进行了 10 折交叉验证(这是默认设置)。
我的代码看起来像这样:
prioir_svm <- tune.svm(train, y = trainY, cost = Cs, gamma = gammas, cross = 5)
谁能告诉我哪里出了问题?
试试这个:
tc <- tune.control(cross = 5)
prioir_svm <- tune.svm(train, y = trainY, cost = Cs, gamma = gammas,
tunecontrol = tc)
详见?tune.control
我有两个参数列表(gamma 和成本),我想 select 使用 SVM。我想进行 5 折交叉验证,但我的代码进行了 10 折交叉验证(这是默认设置)。 我的代码看起来像这样:
prioir_svm <- tune.svm(train, y = trainY, cost = Cs, gamma = gammas, cross = 5)
谁能告诉我哪里出了问题?
试试这个:
tc <- tune.control(cross = 5)
prioir_svm <- tune.svm(train, y = trainY, cost = Cs, gamma = gammas,
tunecontrol = tc)
详见?tune.control