Learn R Programming

Rdimtools (version 1.0.0)

do.lmds: Landmark Multidimensional Scaling

Description

Landmark MDS is a variant of Classical Multidimensional Scaling in that it first finds a low-dimensional embedding using a small portion of given dataset and graft the others in a manner to preserve as much pairwise distance from all the other data points to landmark points as possible.

Usage

do.lmds(
  X,
  ndim = 2,
  ltype = "random",
  npoints = max(nrow(X)/5, ndim + 1),
  preprocess = c("center", "cscale", "decorrelate", "whiten")
)

Arguments

X

an \((n\times p)\) matrix or data frame whose rows are observations and columns represent independent variables.

ndim

an integer-valued target dimension.

ltype

on how to select landmark points, either "random" or "MaxMin".

npoints

the number of landmark points to be drawn.

preprocess

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

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.

References

silva_global_2002Rdimtools

lee_landmark_2009Rdimtools

See Also

do.mds

Examples

Run this code
# NOT RUN {
# generate data
X <- aux.gensamples(dname="crown")

## 1. use 10% of random points
output1 <- do.lmds(X,ndim=2,npoints=round(nrow(X)/10))

## 2. using MaxMin scheme
output2 <- do.lmds(X,ndim=2,npoints=round(nrow(X)/10),ltype="MaxMin")

## 3. original mds case
output3 <- do.mds(X,ndim=2)

## Visualization
opar <- par(no.readonly=TRUE)
par(mfrow=c(1,3))
plot(output1$Y, main="10% random points")
plot(output2$Y, main="10% MaxMin points")
plot(output3$Y, main="original MDS")
par(opar)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab