as.cndkernmatrix {qkerntool} | R Documentation |
Assing cndkernmatrix class to matrix objects
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
## S4 method for signature 'matrix'
as.cndkernmatrix(x, center = FALSE)
Arguments
x |
matrix to be assigned the |
center |
center the cndkernel matrix in feature space (default: FALSE) |
Author(s)
Yusen Zhang
yusenzhang@126.com
See Also
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.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
[Package qkerntool version 1.19 Index]