# another example using the iris
data(iris)
test <- sample(1:150,20)
kpc <- kha(~.,data=iris[-test,-5],kernel="rbfdot",kpar=list(sigma=0.2),features=2)
#print the principal component vectors
pcv(kpc)
#plot the data projection on the components
plot(predict(kpc,iris[,-5]),col=as.integer(iris[,5]),xlab="1st Principal Component",ylab="2nd Principal Component")
Run the code above in your browser using DataLab