as.kernelMatrix: Assing kernelMatrix class to matrix objects

Description Usage Arguments Author(s) See Also Examples

Description

as.kernelMatrix in package KERE can be used to coerce the kernelMatrix class to matrix objects representing a kernel matrix. These matrices can then be used with the kernelMatrix interfaces which most of the functions in KERE support.

Usage

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

Arguments

x

matrix to be assigned the kernelMatrix class

center

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

Author(s)

Alexandros Karatzoglou
[email protected]

See Also

kernelMatrix, dots

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Create toy data
x <- rbind(matrix(rnorm(10),,2),matrix(rnorm(10,mean=3),,2))
y <- matrix(c(rep(1,5),rep(-1,5)))

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

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

K

KERE documentation built on May 29, 2017, 10:49 a.m.