# NOT RUN {
## load iris data
data(iris)
set.seed(100)
subid = sample(1:150,50)
X = as.matrix(iris[subid,1:4])
label = as.factor(iris[subid,5])
## 1. standard KECA with gaussian kernel
output1 <- do.keca(X,ndim=2)
## 2. gaussian kernel with large bandwidth
output2 <- do.keca(X,ndim=2,kernel=c("gaussian",5))
## 3. use laplacian kernel
output3 <- do.keca(X,ndim=2,kernel=c("laplacian",1))
## Visualize three different projections
opar = par(no.readonly=TRUE)
par(mfrow=c(1,3))
plot(output1$Y, pch=19, col=label, main="Gaussian kernel")
plot(output2$Y, pch=19, col=label, main="Gaussian, sigma=5")
plot(output3$Y, pch=19, col=label, main="Laplacian kernel")
par(opar)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab