gpt4 book ai didi

r - 在 R 中使用 tune.svm() 指定 k 折交叉验证

转载 作者:行者123 更新时间:2023-12-04 06:59:44 25 4
gpt4 key购买 nike

我有两个要使用 SVM 选择的参数列表( Gamma 和成本)。我想做 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详情

关于r - 在 R 中使用 tune.svm() 指定 k 折交叉验证,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29099408/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com