Learn R Programming

qkerntool (version 1.19)

as.qkernmatrix: Assing qkernmatrix class to matrix objects

Description

as.qkernmatrix in package qkerntool can be used to create the qkernmatrix class to matrix objects representing a q kernel matrix. These matrices can then be used with the qkernmatrix interfaces which most of the functions in qkerntool support.

Usage

# S4 method for matrix
as.qkernmatrix(x, center = FALSE)

Arguments

x

matrix to be assigned the qkernmatrix class

center

center the kernel matrix in feature space (default: FALSE)

See Also

qkernmatrix,cndkernmatrix

Examples

Run this code
# NOT RUN {
## Create the data
x <- rbind(matrix(rnorm(10),,2),matrix(rnorm(10,mean=3),,2))
y <- matrix(c(rep(1,5),rep(-1,5)))

### Use as.qkernmatrix to label the cov. matrix as a qkernel matrix
### which is eq. to using a linear kernel

K <- as.qkernmatrix(crossprod(t(x)))

K


# }

Run the code above in your browser using DataLab