2016-12-01 54 views
1

我正在使用本教程探索支持向量機迴歸http://www.svm-tutorial.com/2014/10/support-vector-regression-r/。使用網格搜索調整模型時遇到Error in do.call(method, c(list(train.x, data = data, subset = train.ind[[sample]]), : 'what' must be a function or character string,但我不確定這意味着什麼。這裏是我使用的代碼: svm_m <- svm(FuelRate~ Heading+Distance+Elevatio+YieldDry+HarvestM, data = fr_tr) tuneResult <- tune(svm_m, FuelRate ~ Heading+Distance+Elevatio+YieldDry+HarvestM, data = fr_tr, ranges = list(epsilon = seq(0,1,0.1), cost=2^(2:9)))。任何人都可以教我關於解決方案嗎?在R中調整支持向量迴歸模型時出現錯誤

回答

1

對不起,我在這裏使用了一個錯誤的參數tuneResult <- tune(svm_m, FuelRate ~ Heading+Distance+Elevatio+YieldDry+HarvestM, data = fr_tr, ranges = list(epsilon = seq(0,1,0.1), cost=2^(2:9)))。第一個參數應該是method = svm

相關問題