全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 R语言论坛
1592 1
2017-01-07
各位高手好,我在用caret包内的svmPoly做classification。
用默认参数运行后得到的模型提示:
Accuracy was used to select the optimal model using  the largest value.
The final values used for the model were degree = 1, scale = 0.1 and C = 1.


然后我用tuneGrid 调参数,该怎样在expand.grid内设置参数degree、scale、C的取值范围好呢。谢谢
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2017-1-7 16:28:33
用默认参数得到的模型的最大准确度是80%。我现在用以下代码调参数:
grid_svmpoly=expand.grid(degree=seq(0,5,length.out=25),scale=seq(0,5,length.out=25),C=seq(0,5,length.out=25))
modelFit <- train(group~.,data=table_svm,method="svmPoly",
                  preProc = c("center","scale"),#metric="ROC",
                  tuneGrid=grid_svmpoly,
                  trControl = ctrl)

结果报错:Error in { :
  task 1 failed - "No Support Vectors found. You may want to change your parameters"

该如何解决呢?
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群