Learn R Programming

Rdimtools (version 0.4.1)

do.crp: Collaborative Representation-based Projection

Description

Collaborative Representation-based Projection (CRP) is an unsupervised linear dimension reduction method. Its embedding is based on \(\ell\)_2 graph construction, similar to that of SPP where sparsity constraint is imposed via \(\ell_1\) optimization problem. Note that though it may be way faster, rank deficiency can pose a great deal of problems, especially when the dataset is large.

Usage

do.crp(X, ndim = 2, preprocess = c("center", "scale", "cscale",
  "decorrelate", "whiten"), lambda = 1)

Arguments

X

an \((n\times p)\) matrix or data frame whose rows are observations

ndim

an integer-valued target dimension.

preprocess

an additional option for preprocessing the data. Default is "center". See also aux.preprocess for more details.

lambda

regularization parameter for constructing \(\ell_2\) graph.

Value

a named list containing

Y

an \((n\times ndim)\) matrix whose rows are embedded observations.

trfinfo

a list containing information for out-of-sample prediction.

projection

a \((p\times ndim)\) whose columns are basis for projection.

See Also

do.spp

Examples

Run this code
# NOT RUN {
## generate samples
X <- aux.gensamples(n=200)

## test different regularization parameters
out1 <- do.crp(X,ndim=2,lambda=0.1)
out2 <- do.crp(X,ndim=2,lambda=1)
out3 <- do.crp(X,ndim=2,lambda=10)

# visualize
par(mfrow=c(1,3))
plot(out1$Y[,1], out1$Y[,2], main="lambda=0.1")
plot(out2$Y[,1], out2$Y[,2], main="lambda=1")
plot(out3$Y[,1], out3$Y[,2], main="lambda=10")
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab