On this site(Stress attribute -- sklearn.manifold.MDS / Python), Kruskal stress is used to metric mds. However, looking at the wiki(https://en.wikipedia.org/wiki/Multidimensional_scaling), metric mds uses raw stress and non-metric mds uses Kruskal stress. For this, I'm confusing that Kruskal stress can use metric mds or not.
Asked
Active
Viewed 70 times
1 Answers
0
You can use Kruskal's Stress-1 by passing normalized_stress
as True
to sklearn.manifold.MDS
. But you have to set the metric
parameter to False
as well since the stress is only calculated for non-metric MDS. Example:
from sklearn.datasets import load_digits
from sklearn.manifold import MDS
X, _ = load_digits(return_X_y=True)
embedding = MDS(n_components=2, metric=False, normalized_stress=True)
X_transformed = embedding.fit_transform(X[:100])

CognizantApe
- 1,149
- 10
- 10