as.cndkernmatrix: Assing cndkernmatrix class to matrix objects

Description Usage Arguments Author(s) See Also Examples

Description

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

Usage

1
2
## S4 method for signature 'matrix'
as.cndkernmatrix(x, center = FALSE)

Arguments

x

matrix to be assigned the cndkernmatrix class

center

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

Author(s)

Yusen Zhang
yusenzhang@126.com

See Also

cndkernmatrix,qkernmatrix

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.cndkernmatrix to label the cov. matrix as a CND kernel matrix
### which is eq. to using a linear kernel

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

K

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