liveBook · Manning

Stress

As explained in Data Without Labels

Stress is an MDS discrepancy measure that quantifies the difference between original dissimilarities and distances in the fitted low-dimensional representation.

Stress measures how faithfully multidimensional scaling (MDS) preserves original pairwise dissimilarities in a lower-dimensional representation. It acts as the model’s cost or loss: smaller values indicate closer agreement between original distances and fitted distances. section 6.2.2

For points i and j, stress compares the original distance dij with the lower-dimensional distance ||xi − xj||. MDS searches for coordinates that minimize the resulting discrepancy. section 6.2.2

A practical MDS workflow uses stress to assess dimensionality:

  • Scale the input data or distance matrix before fitting MDS. section 6.3
  • Fit MDS repeatedly across candidate component counts and record each model’s stress_ value. section 6.3
  • Plot stress against the number of components and inspect the kink or elbow to select a practical dimensionality. section 6.3
  • Interpret lower stress as better fit, while recognizing that optimization can converge at a local rather than global minimum. section 6.2.2

Comparing candidate MDS dimensions

A five-city distance matrix is scaled, fitted with MDS for one through nine components, and evaluated through mds.stress_. Plotting the collected values reveals kinks around two and three components; the chosen embedding can then be plotted and its stress printed. section 6.3

Table 6.2 Stress values and their goodness of fit
Stress values
Goodness of fit
0.200
Poor
0.100
Fair
0.050
Good
0.025
Excellent
0.000
Perfect

Use the stress-to-fit table as a quick interpretive reference: 0.200 is poor, 0.100 fair, 0.050 good, 0.025 excellent, and 0.000 perfect. section 6.2.2

How Data Without Labels covers it

How deep it goes
Defines stress through pairwise distances, explains its minimization, and applies it across candidate component counts.
Examples
Uses Iris visualization, a five-city distance matrix, stress plots, and a stress-to-goodness-of-fit table.
What it assumes
Assumes familiarity with distances and dimensionality reduction while explaining stress and its optimization from basic principles.
What you can do after
Evaluate/understand MDS fit and select a practical number of embedding components using stress plots and values.
How it connects
Connects stress to MDS, cost functions, loss functions, gradient descent, and dimensionality selection.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Data Without Labels. The section links point to the parts of the book it draws on.