koplsCenterKTeTr {kopls} | R Documentation |
Centering function for the hybrid test/training kernel, which
is constructed from the test matrix Xte and the training matrix
Xtr as KteTr = <phi(Xte), phi(Xtr)>. Requires
additional (un-centered) training kernel to estimate mean values
(see koplsKernel
for details on constructing a kernel matrix).
koplsCenterKTeTr(KteTr, Ktrain)
KteTr |
Hybrid test/training kernel matrix; KteTr = <phi(Xte), phi(Xtr)>. |
Ktrain |
Training kernel matrix; Ktrain = <phi(Xtr), phi(Xtr)>. |
The centered test/training kernel matrix.
Max Bylesjo and Mattias Rantalainen
Rantalainen M, Bylesjo M, Cloarec O, Nicholson JK, Holmes E and Trygg J. Kernel-based orthogonal projections to latent structures (K-OPLS), J Chemometrics 2007; 21:376-385. doi:10.1002/cem.1071.
## Load data set data(koplsExample) ## Define kernel function parameter sigma<-25 ## Construct kernels Ktr<-koplsKernel(Xtr,NULL,'g',sigma) KteTr<-koplsKernel(Xte,Xtr,'g',sigma) ## Center kernel KteTr_centered<-koplsCenterKTeTr(KteTr, Ktr)