[R] Plot.svm error
    pedrosmarques at portugalmail.pt 
    pedrosmarques at portugalmail.pt
       
    Thu Jan  3 00:43:53 CET 2008
    
    
  
Hi all,
Sorry to be bothering again with probably an easy error to fix, but I've been trying to solve the problem and haven't yet been able to do it. So, I'm doing this:
> dados<-read.table("b.txt",sep="",nrows=30000)
> model<-svm(x=dados[,-1],y=dados[,1],scale=TRUE,type="C-classification",kernel="radial",cost=1,degree=3,gamma=0.083,coef0=0,nu=0.5,epsilon=0.1)
Warning message:
In svm.default(x = dados[, -1], y = dados[, 1], scale = TRUE, type = "C-classification",  :
  Variable(s) V12 and V13 constant. Cannot scale data.
> summary(model)
Call:
svm.default(x = dados[, -1], y = dados[, 1], scale = TRUE, type = "C-classification", 
    kernel = "radial", degree = 3, gamma = 0.083, coef0 = 0, cost = 1, 
    nu = 0.5, epsilon = 0.1)
Parameters:
   SVM-Type:  C-classification 
 SVM-Kernel:  radial 
       cost:  1 
      gamma:  0.083 
Number of Support Vectors:  19665
 ( 8284 7579 1327 943 510 875 147 )
Number of Classes:  7 
Levels: (as integer) 
 2 1 3 7 5 6 4
> class<-factor(dados[,1])
> plot(model, data= dados[,-1], formula= class~.,svSymbol = 1, dataSymbol = 2, symbolPalette = rainbow(4),color.palette = terrain.colors)
Error in Summary.factor(c(2L, 1L, 1L, 1L, 2L, 2L, 2L, 1L, 1L, 2L, 1L,  : 
  min not meaningful for factors
I should be very grateful if someone could help me on this..
Best regards,
Pedro Marques
    
    
More information about the R-help
mailing list