do.npe
performs a linear dimensionality reduction using Neighborhood Preserving
Embedding (NPE) proposed by He et al (2005). It can be regarded as a linear approximation
to Locally Linear Embedding (LLE). Like LLE, it is possible for the weight matrix being rank deficient.
If regtype
is set to TRUE
with a proper value of regparam
, it will
perform Tikhonov regularization as designated. When regularization is needed
with regtype
parameter to be FALSE
, it will automatically find a suitable
regularization parameter and put penalty for stable computation. See also
do.lle
for more details.
an \((n\times p)\) matrix or data frame whose rows are observations and columns represent independent variables.
an integer-valued target dimension.
a vector of neighborhood graph construction. Following types are supported;
c("knn",k)
, c("enn",radius)
, and c("proportion",ratio)
.
Default is c("proportion",0.1)
, connecting about 1/10 of nearest data points
among all data points. See also aux.graphnbd
for more details.
one of "intersect"
, "union"
or "asymmetric"
is supported. Default is "union"
. See also aux.graphnbd
for more details.
TRUE
to perform NPE on weighted graph, or FALSE
otherwise.
an additional option for preprocessing the data.
Default is "null". See also aux.preprocess
for more details.
FALSE
for not applying automatic Tikhonov Regularization,
or TRUE
otherwise.
a positive real number for Regularization. Default value is 1.
a named list containing
an \((n\times ndim)\) matrix whose rows are embedded observations.
a vector of eigenvalues corresponding to basis expansion in an ascending order.
a \((p\times ndim)\) whose columns are basis for projection.
a list containing information for out-of-sample prediction.
He X, Cai D, Yan S, Zhang H (2005). “Neighborhood Preserving Embedding.” In Proceedings of the Tenth IEEE International Conference on Computer Vision - Volume 2, ICCV '05, 1208--1213.
if (FALSE) {
## use 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])
## use different settings for connectivity
output1 = do.npe(X, ndim=2, type=c("proportion",0.10))
output2 = do.npe(X, ndim=2, type=c("proportion",0.25))
output3 = do.npe(X, ndim=2, type=c("proportion",0.50))
## visualize three different projections
opar <- par(no.readonly=TRUE)
par(mfrow=c(1,3))
plot(output1$Y, pch=19, col=label, main="NPE::10% connected")
plot(output2$Y, pch=19, col=label, main="NPE::25% connected")
plot(output3$Y, pch=19, col=label, main="NPE::50% connected")
par(opar)
}