Skip to contents

It is equivalent to compute `K` over centered data (i.e. the mean of each column is subtracted) in Feature Space.

Usage

centerK(K)

Arguments

K

Kernel matrix (class "matrix").

Value

Centered `K` (class "matrix").

Examples

dat <- matrix(rnorm(250),ncol=50,nrow=5)
K <- Linear(dat)
centerK(K)
#>           [,1]       [,2]       [,3]       [,4]      [,5]
#> [1,]  55.68802 -17.003217 -18.302657 -14.332653  -6.04949
#> [2,] -17.00322  34.483623   2.404086  -6.543107 -13.34138
#> [3,] -18.30266   2.404086  32.183244  -6.129631 -10.15504
#> [4,] -14.33265  -6.543107  -6.129631  37.751391 -10.74600
#> [5,]  -6.04949 -13.341385 -10.155042 -10.746000  40.29192