do.sammon | R Documentation |
do.sammon
is an implementation for Sammon mapping, one of the earliest
dimension reduction techniques that aims to find low-dimensional embedding
that preserves pairwise distance structure in high-dimensional data space.
do.sammon( X, ndim = 2, preprocess = c("null", "center", "scale", "cscale", "decorrelate", "whiten"), initialize = c("pca", "random") )
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 "null". See also |
initialize |
|
a named list containing
an (n\times ndim) matrix whose rows are embedded observations.
a list containing information for out-of-sample prediction.
Kisung You
Sammon, J.W. (1969) A Nonlinear Mapping for Data Structure Analysis. IEEE Transactions on Computers, C-18 5:401-409.
\insertRefsammon_nonlinear_1969Rdimtools
## load iris data data(iris) X = as.matrix(iris[,1:4]) label = as.factor(iris$Species) ## compare two initialization out1 = do.sammon(X,ndim=2) # random projection out2 = do.sammon(X,ndim=2,initialize="pca") # pca as initialization ## visualize opar <- par(no.readonly=TRUE) par(mfrow=c(1,2)) plot(out1$Y, pch=19, col=label, main="out1:rndproj") plot(out2$Y, pch=19, col=label, main="out2:pca") par(opar)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.