Skip to main content

MDS

Multidimensional scaling: places points in a low-dimensional space so that pairwise distances match the originals as closely as possible.

Algorithm

Metric (and non-metric) MDS via the SMACOF majorisation iteration, which monotonically decreases the stress functional.

Constructor

Skigen::MDS<Scalar> model(int n_components = 2, int max_iter = 300, Scalar eps = 1e-3, bool metric = true, uint64_t random_state = 0);

Parameters

ParameterDefaultDescription
n_components2Embedding dimensionality.
max_iter300SMACOF iterations.
eps1e-3Stress-convergence tolerance.
metrictrueMetric vs non-metric MDS.

Methods

MethodDescription
fit_transform(X)Return the embedding.

Fitted Attributes

AccessorDescription
stress()Final stress value.

Example

Skigen::MDS<double> mds(2);
auto Y = mds.fit_transform(X);
Verified against scikit-learn

This estimator is checked by the parity suite. See the generator tests/parity/generate_manifold_reference.py and the reference fixtures in tests/parity/data/mds/, exercised by tests/parity/parity_manifold.cpp.

API Reference

For full signatures see the MDS API Reference.