## use the spam data
x <- matrix(rnorm(10*10),10,10)
## initialize kernel function
rbf <- rbfdot(sigma = 0.05)
rbf
## calculate kernel matrix
kernelMatrix(rbf, x)
y <- matrix(rnorm(10*1),10,1)
## calculate the quadratic kernel expression
kernelPol(rbf, x, ,y)
## calculate the kernel expansion
kernelMult(rbf, x, ,y)
Run the code above in your browser using DataLab