[R] stringdot

From: Nair, Murlidharan T <mnair_at_iusb.edu>
Date: Wed, 25 Jun 2008 09:44:28 -0400


Hi!!

I am trying to figure out how to use the string kernel "stringdot" in kernlab.

k <- function(x,y) {
  (sum(x*y) +1)*exp(-0.001*sum((x-y)^2)) }
class(k) <- "kernel"

data(promotergene)

## train svm using custom kernel

gene.k <- ksvm(Class~.,data=promotergene,kernel=k,C=10,cross=5) # works fine in this case

gene.rbf <- ksvm(Class~.,data=promotergene,kernel="rbfdot",C=10,cross=5)# works fine with the rbf kernel

gene.string <- ksvm(Class~.,data=promotergene,kernel="stringdot",C=10,cross=5) # this give the following error

#Error in match.arg(kernel, c("rbfdot", "polydot", "tanhdot", "vanilladot", : # 'arg' should be one of “rbfdot”, “polydot”, “tanhdot”, “vanilladot”, “laplacedot”, “besseldot”, “anovadot”, “splinedot”, “matrix”

What am I doing wrong here?

Thanks ../Murli



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. Received on Wed 25 Jun 2008 - 13:55:06 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 25 Jun 2008 - 18:30:46 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive