| do.lspp | R Documentation |
Local Similarity Preserving Projection (LSPP) is a variant of LPP in that
it employs a sample-dependent graph generation process as of do.sdlpp.
LSPP takes advantage of labeling information to correct local similarity weight
in order to make intra-class weight larger than inter-class weight. It uses
PCA preprocessing as suggested from the original work.
do.lspp(
X,
label,
ndim = 2,
t = 1,
preprocess = c("center", "scale", "cscale", "decorrelate", "whiten")
)
X |
an |
label |
a length- |
ndim |
an integer-valued target dimension. |
t |
kernel bandwidth in |
preprocess |
an additional option for preprocessing the data.
Default is "center". See also |
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
huang_local_2015Rdimtools
do.sdlpp, do.lpp
## generate data of 2 types with clear difference
diff = 15
dt1 = aux.gensamples(n=50)-diff;
dt2 = aux.gensamples(n=50)+diff;
## merge the data and create a label correspondingly
Y = rbind(dt1,dt2)
label = rep(1:2, each=50)
## compare with PCA
out1 <- do.pca(Y, ndim=2)
out2 <- do.slpp(Y, label, ndim=2)
## visualize
opar <- par(no.readonly=TRUE)
par(mfrow=c(1,2))
plot(out1$Y, col=label, pch=19, main="PCA")
plot(out2$Y, col=label, pch=19, main="LSPP")
par(opar)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.