[R] stringdot

Nair, Murlidharan T mnair at iusb.edu
Wed Jun 25 19:18:40 CEST 2008

I tried the following


## train svm using custom kernel
stringkernel<-stringdot(length = 4, lambda = 0.5, type = "sequence", normalized = TRUE)
gene <- ksvm(Class~.,data=promotergene,kernel=stringkernel,C=10,cross=5)

I get the following error

cannot allocate vector of size 1.2 Gb.

Is my usage wrong ?. I am running this under linux serve 6850 which has about 8Gb memory
Any would be appreciated.

From: r-help-bounces at r-project.org [r-help-bounces at r-project.org] On Behalf Of Nair, Murlidharan T [mnair at iusb.edu]
Sent: Wednesday, June 25, 2008 9:44 AM
To: r-help at stat.math.ethz.ch
Subject: [R] stringdot


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"


## 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
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