Learn R Programming

Rdimtools (version 0.1.2)

do.keca: Kernel Entropy Component Analysis

Description

Kernel Entropy Component Analysis(KECA) is a kernel method of dimensionality reduction. Unlike Kernel PCA(do.kpca), it utilizes eigenbasis of kernel matrix \(K\) in accordance with indices of largest Renyi quadratic entropy in which entropy for \(j\)-th eigenpair is defined to be \(\sqrt{\lambda_j}e_j^T 1_n\), where \(e_j\) is \(j\)-th eigenvector of an uncentered kernel matrix \(K\).

Usage

do.keca(X, ndim = 2, preprocess = "null", kernel = c("gaussian", 1))

Arguments

X

an (n-by-p) matrix or data frame whose rows are observations and columns represent independent variables.

ndim

an integer-valued target dimension.

preprocess

an additional option for preprocessing the data. Default is ``null'', and other methods of ``decorrelate'',``center'' , and ``whiten'' are supported. See also aux.preprocess for more details.

kernel

a vector containing name of a kernel and corresponding parameters. See also aux.kernelcov for complete description of Kernel Trick.

Value

a named list containing

Y

an (n-by-ndim) matrix whose rows are embedded observations.

trfinfo

a list containing information for out-of-sample prediction.

entropy

a length-ndim vector of estimated entropy values.

References

jenssen_kernel_2010Rdimtools

See Also

aux.kernelcov

Examples

Run this code
# NOT RUN {
## generate ribbon-shaped data
## in order to pass CRAN pretest, n is set to be small.
X = aux.gensamples(dname="ribbon",n=100)

## 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
par(mfrow=c(1,3))
plot(output1$Y[,1],output1$Y[,2],main="Gaussian kernel")
plot(output2$Y[,1],output2$Y[,2],main="Gaussian, sigma=5")
plot(output3$Y[,1],output3$Y[,2],main="Laplacian kernel")

# }

Run the code above in your browser using DataLab