50% off | Unlimited Data & AI Learning
Get 50% off unlimited learning

Rdimtools (version 0.3.2)

do.crp: Collaborative Representation-based Projection

Description

Collaborative Representation-based Projection (CRP) is an unsupervised linear dimension reduction method. Its embedding is based on _2 graph construction, similar to that of SPP where sparsity constraint is imposed via 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×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 2 graph.

Value

a named list containing

Y

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

trfinfo

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

projection

a (p×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