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.
do.npe(X, ndim = 2, type = c("proportion", 0.1), symmetric = "union",
weight = TRUE, preprocess = c("null", "center", "scale", "cscale",
"whiten", "decorrelate"), regtype = FALSE, regparam = 1)
an
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
a vector of eigenvalues corresponding to basis expansion in an ascending order.
a
a list containing information for out-of-sample prediction.
he_neighborhood_2005Rdimtools
# NOT RUN {
## generate data
X <- aux.gensamples(n=333)
## 1. connecting 5% of data for graph construction.
output1 <- do.npe(X,ndim=2,type=c("proportion",0.05))
## 2. constructing 25%-connected graph with regularization parameter
output2 <- do.npe(X,ndim=2,type=c("proportion",0.2),symmetric='intersect',regparam=1.0)
## 3. constructing half-connected graph with reg parameter = 10.0.
output3 <- do.npe(X,ndim=2,type=c("proportion",0.5),regparam=10.0)
## Visualize three different projections
par(mfrow=c(1,3))
plot(output1$Y[,1],output1$Y[,2],main="5%")
plot(output2$Y[,1],output2$Y[,2],main="25%")
plot(output3$Y[,1],output3$Y[,2],main="50%")
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab