【问题标题】:Specifying k-fold cross validation using tune.svm() in R在 R 中使用 tune.svm() 指定 k 折交叉验证
【发布时间】:2015-05-19 21:36:29
【问题描述】:

我有两个要使用 SVM 选择的参数列表(gamma 和 cost)。我想做 5 倍交叉验证,但我的代码进行 10 倍交叉验证(这是默认设置)。 我的代码如下所示:

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

谁能告诉我怎么回事?

【问题讨论】:

    标签: r svm


    【解决方案1】:

    试试这个:

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

    详情请见?tune.control

    【讨论】:

      猜你喜欢
      • 2018-08-29
      • 2016-11-15
      • 2016-01-15
      • 2019-12-18
      • 1970-01-01
      • 1970-01-01
      • 2020-08-29
      • 2017-06-09
      • 1970-01-01
      相关资源
      最近更新 更多