[R] Strange indices of support verctors from e1071

Juergen Rose rose at rz.uni-potsdam.de
Mon Jun 8 18:30:42 CEST 2009


Am Montag, den 08.06.2009, 18:20 +0200 schrieb Juergen Rose:
> Hello,
> 
> In the attached file training.csv (I apologize for the large file) I
> have 238 objects belonging to 13 classes, which are described by 183
> properties. I would like to find a svm model for these objects.
> 
> I tried the following R statements.
> 
> library('e1071')
> datatraining <- read.csv("training.csv",head=TRUE)
> 
> names<-names(datatraining)
> print("before print(names)");                 print(names)
> # There are 186 names, respectively 184 properties P3, P4 ... P1549
> 
> data <- subset(datatraining,select=c(-dataname_gen_spec,-Gen))
> classes <- subset(datatraining,select=Gen)
> #  There are 13 classes
> 
> model <- svm(data,classes,type='C-classification',kernel='linear')
> print(sprintf("There are %d support vectors",model$tot.nSV));
> #  There are 176 support vectors
> 
> print("before summary(model)");              summary(model)
> $index);
> print("before print(model$index)");          print(model$index);
> 
> 
> I expect that the index values are between 1 and 184, because there are
> 84 properties, but I get several indices larger than 200.  What did I
> misunderstood?
> 
> Any hint is very appreciated.
> 
> Regards Juergen

Hi, once again, I just recognized, that the support vectors are objects and not properties.
So that my last question was nonsense. But the reason for my question
was, that I would like to get the important properties from a svm model.
Is there any way?


> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.




More information about the R-help mailing list