找回密码
 立即注册
查看: 3564|回复: 0

求大神帮我看看错误出在哪里??代码如下~拜托拜托

[复制链接]
发表于 2015-5-10 10:47:02 | 显示全部楼层 |阅读模式
> attach(tradata)
> x=subset(tradata,select=-UNS)
> y=UNS
> type=c("C-classification","nu-classification","one-classification")
> kernel=c("linear","polynomial","radial","sigmoid")
> pred=array(0,dim=c(257,3,4))
> accuracy=matrix(0,3,4)
> yy=as.integer(y)
> for(i in 1:3)
+ {
+ for(j in 1:4)
+ {
+ pred[,i,j]=predict(svm(x,y,type=type[i],kernel=kernel[j]),x)
+ if(i>2) accuracy[i,j]=sum(pred[,i,j]!=1)
+ else accuracy[i,j]=sum(pred[,i,j]!=yy)
+ }
+ }
错误于svm.default(x, y, type = type[i], kernel = kernel[j]) :
  specified nu is infeasible!

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|R语言中文网

GMT+8, 2024-11-25 20:36 , Processed in 0.018318 second(s), 17 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表