as.qkernmatrix: Assing qkernmatrix class to matrix objects

Description Usage Arguments Author(s) See Also Examples

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

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## 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

qkerntool documentation built on May 2, 2019, 6:11 a.m.