[R] extract weighting values from a relevance vector machine (kernlab package)

Martin Batholdy batholdy at googlemail.com
Thu Feb 16 16:40:44 CET 2012


Dear R-users,

How can I extract the weighting values (w-values) for each feature from a rvm-object of the kernlab package?
I can access the relevance vectors but how can I get the weighting values of each feature?

example code:

# create data
x1 <- rnorm(401,sd=1.10)
x2 <- rnorm(401,sd=1.10)
x3 <- rnorm(401,sd=1.10)
x4 <- rnorm(401,sd=1.10)
y <- (0.4 * sin(x1)/x1 + rnorm(401,sd=0.10)) + (0.7 * sin(x2)/x2 + rnorm(401,sd=0.05)) + (1.2 * sin(x3)/x3 + rnorm(401,sd=0.15)) + (2.2 * sin(x4)/x4 + rnorm(401,sd=0.25))

# train relevance vector machine
foo <- rvm(data.frame(x1, x2, x3, x4), y, kernel='vanilladot')
foo

alpha(foo)
RVindex(foo)



thanks for any suggestions!



More information about the R-help mailing list