[R] Strange indices of support verctors from e1071
Juergen Rose
rose at rz.uni-potsdam.de
Mon Jun 8 18:33:26 CEST 2009
Am Montag, den 08.06.2009, 12:30 -0400 schrieb milton ruser:
> Dear Rose,
>
> no attached file came with the message.
>
> bests
> milton
I try once more to attache the file. I hope that 89 KB is not to large
for the mailing list.
> On Mon, Jun 8, 2009 at 12:20 PM, Juergen Rose <rose at rz.uni-potsdam.de>
> wrote:
> 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
>
>
>
>
> ______________________________________________
> 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