do.npe {Rdimtools} | R Documentation |
Neighborhood Preserving Embedding
Description
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.
Usage
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
)
Arguments
X |
an |
ndim |
an integer-valued target dimension. |
type |
a vector of neighborhood graph construction. Following types are supported;
|
symmetric |
one of |
weight |
|
preprocess |
an additional option for preprocessing the data.
Default is "null". See also |
regtype |
|
regparam |
a positive real number for Regularization. Default value is 1. |
Value
a named list containing
- Y
an
(n\times ndim)
matrix whose rows are embedded observations.- eigval
a vector of eigenvalues corresponding to basis expansion in an ascending order.
- projection
a
(p\times ndim)
whose columns are basis for projection.- trfinfo
a list containing information for out-of-sample prediction.
Author(s)
Kisung You
References
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.
Examples
## Not run:
## 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)
## End(Not run)