| do.npe | R Documentation |
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
)
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. |
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.
Kisung You
he_neighborhood_2005Rdimtools
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.