MDS<T>

Models & Types ยท AiDotNet.Preprocessing.DimensionalityReduction

Multidimensional Scaling for dimensionality reduction.

Inheritance: TransformerBase<T, Matrix<T>, Matrix<T>> โ†’ MDS<T>

For Beginners

MDS tries to place points in 2D/3D such that:

  • Points that were close in high-D stay close in low-D
  • Points that were far apart stay far apart
  • Unlike t-SNE/UMAP, MDS tries to preserve actual distances, not just neighborhoods

Classical MDS: Preserves exact distances (works well when data is linear) Non-metric MDS: Preserves distance rankings (more flexible, works better for complex data)

How It Works

MDS finds a low-dimensional embedding that preserves pairwise distances between points. Classical MDS uses eigendecomposition of the double-centered distance matrix. Non-metric MDS uses iterative optimization to preserve distance rankings.

MDS is useful for:

  • Visualizing similarity/dissimilarity data
  • Preserving pairwise relationships
  • When you have a distance matrix rather than feature vectors

Constructors

Constructor Summary
MDS(int nComponents, MDSType mdsType, MDSMetric metric, int maxIter, double eps, bool normalized, int? randomState, int[] columnIndices) Creates a new instance of MDS.

Properties

Property Summary
MDSType MdsType { get; } Gets the MDS type (classical or non-metric).
bool SupportsInverseTransform { get; } Gets whether this transformer supports inverse transformation.
double Stress { get; } Gets the final stress value (goodness of fit).
double[] Embedding { get; } Gets the embedding result.
int NComponents { get; } Gets the number of components (dimensions).

Methods

Method Summary
string[] GetFeatureNamesOut(string[] inputFeatureNames) Gets the output feature names after transformation.