Last chance! 50% off unlimited learning
Sale ends in
Calculates Gaussian kernel:
gaussKern(x, newdata = x, theta = NULL)
a data matrix.
optional second data matrix.
the inverse kernel bandwidth parameter. If NULL
a default value is used
Returns a list containing the following components:
a Gaussian kernel matrix of class "kern"
.
the inverse kernel bandwidth parameter.
Also known as the radial basis kernel function, see rbfdot
(in package kernlab)
kPCA
bkpc
kernelMatrix
(in package kernlab)
# NOT RUN {
data(iris)
testset <- sample(1:150,20)
train <- as.matrix(iris[-testset ,-5])
test <- as.matrix(iris[testset ,-5])
# make training set kernel
gk <- gaussKern(train)
Ktrain <- gk$K
image(Ktrain)
# make testing set kernel
gk2 <- gaussKern(train, test, gk$theta)
Kest <- gk2$K
# }
Run the code above in your browser using DataLab