as.qkernmatrix {qkerntool}R Documentation

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 signature '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)

Author(s)

Yusen Zhang
yusenzhang@126.com

See Also

qkernmatrix,cndkernmatrix

Examples

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



[Package qkerntool version 1.19 Index]