|
> 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!
|
|