kernelMatrix: Calculate Kernel Matrix

Description Usage Arguments Value Examples

View source: R/kernelCalculation.R

Description

Calculate the similarities between all samples in a list, and return as matrix.

Usage

1
kernelMatrix(X, kernFun, ...)

Arguments

X

list of samples, where each list element is a suitable input for kernFun

kernFun

Kernel function of type f(x,y)=r, where r is a scalar and x and y are elements whose similarity is evaluated.

...

further arguments passed to distFun

Value

The similarity / kernel matrix

Examples

1
2
3
4
5
x <- list(5:1,c(2,4,5,1,3),c(5,4,3,1,2), sample(5))
kernFun <- function(x,y){
		exp(-distancePermutationHamming(x,y))
}
kernelMatrix(x,distancePermutationHamming)

CEGO documentation built on May 14, 2021, 1:08 a.m.