do.lpe | R Documentation |
Locality Pursuit Embedding (LPE) is an unsupervised linear dimension reduction method. It aims at preserving local structure by solving a variational problem that models the local geometrical structure by the Euclidean distances.
do.lpe( X, ndim = 2, preprocess = c("center", "scale", "cscale", "decorrelate", "whiten"), numk = max(ceiling(nrow(X)/10), 2) )
X |
an (n\times 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 "center". See also |
numk |
size of k-nn neighborhood in original dimensional space. |
a named list containing
an (n\times ndim) matrix whose rows are embedded observations.
a list containing information for out-of-sample prediction.
a (p\times ndim) whose columns are basis for projection.
Kisung You
min_locality_2004Rdimtools
## generate swiss roll with auxiliary dimensions set.seed(100) n = 100 theta = runif(n) h = runif(n) t = (1+2*theta)*(3*pi/2) X = array(0,c(n,10)) X[,1] = t*cos(t) X[,2] = 21*h X[,3] = t*sin(t) X[,4:10] = matrix(runif(7*n), nrow=n) ## try with different neighborhood sizes out1 = do.lpe(X, numk=5) out2 = do.lpe(X, numk=10) out3 = do.lpe(X, numk=25) ## visualize opar <- par(no.readonly=TRUE) par(mfrow=c(1,3)) plot(out1$Y, main="LPE::numk=5") plot(out2$Y, main="LPE::numk=10") plot(out3$Y, main="LPE::numk=25") par(opar)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.