View source: R/150_DecompositionConfig.R
| setup_MDS | R Documentation |
Stress-minimizing multidimensional scaling with vegan::monoMDS(): finds k
coordinates per case whose distances match the dissimilarities between cases
as closely as possible, measured by Kruskal's stress-1. For classical
(Torgerson) scaling, which solves an eigenproblem instead, see setup_PCoA.
setup_MDS(
k = 2L,
dist_method = "euclidean",
model = "global",
nstart = 20L,
max_iter = 200L,
features = NULL
)
k |
Integer [1, Inf): Number of components. (passed to |
dist_method |
Character {"euclidean", "manhattan", "chord", "bray",
"canberra", "jaccard", "kulczynski", "hellinger"}: Dissimilarity between
cases, computed with |
model |
Character {"global", "local", "linear"}: "global" is nonmetric
MDS (one monotone regression); "local" fits one monotone regression per case;
"linear" is metric MDS. (passed to |
nstart |
Integer [1, Inf): Number of starting configurations. 1 starts from the classical scaling solution only. |
max_iter |
Integer [1, Inf): Maximum number of iterations per start.
(passed to |
features |
Optional Character vector: Names of at least 2 distinct
feature columns to decompose. |
Each start runs vegan::monoMDS() from its own initial configuration, and
the one with the lowest stress is kept. The first start is the classical
scaling solution, stats::cmdscale(); if that has fewer than k dimensions
with positive eigenvalues, the missing ones are random. Every other start is
uniform on [-1, 1]. The random values come from R's random number
generator, so the execution config's seed reproduces the fit. The final configuration is centered, scaled and rotated to its principal
axes, so its components are uncorrelated, but the first j components of a
k-dimensional solution are not the j-dimensional solution.
MDS cannot be applied to new data, so it cannot be used as the decomposition step in train, and reconstruct does not apply.
MDSConfig object.
EDG
mds_config <- setup_MDS(k = 2L, dist_method = "manhattan")
mds_config
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.