[R] Strange indices of support verctors from e1071

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


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





More information about the R-help mailing list