[R] cross validation in rvm not working? (kernlab package)

Martin Batholdy batholdy at googlemail.com
Tue Feb 14 12:42:41 CET 2012


Hi,

according to ?rvm the relevance vector machine function as implemented in the kernlab-package 
has an argument 'cross' with which you can perform k-fold cross validation.

However, when I try to add a 10-fold cross validation I get the following error message:

Error in match.arg(type, c("C-svc", "nu-svc", "kbb-svc", "spoc-svc", "C-bsvc",  : 
  'arg' should be one of “C-svc”, “nu-svc”, “kbb-svc”, “spoc-svc”, “C-bsvc”, “one-svc”, “eps-svr”, “eps-bsvr”, “nu-svr”


code-example:

# create data
x <- seq(-20,20,0.1)
y <- sin(x)/x + rnorm(401,sd=0.05)

# train relevance vector machine
foo <- rvm(x, y, cross=10)


So, does that mean that cross-validation is not working for rvm at the moment?
(since the type argument only allows support vector regression or classification)



More information about the R-help mailing list