scikit-learn/scikit-learn — pull request #2558 by Jorge-C (2013-10-30 04:17:36+00:00)
Title: BUG: Compare strings for equality, not identity.

In a script I found that calling MDS with dissimilarity='precomputed' was failing because strings are compared by identity. A quick way to reproduce the bug is this:

from sklearn.manifold import MDS
import numpy as np

mds = MDS(dissimilarity=''.join(list('precomputed')))
X = np.ones(10,10)
pos = mds.fit_transform(X)

raises a

ValueError: Proximity must be 'precomputed' or 'euclidean'. Got precomputed instead

The fix is really simple, but I can add a test case to it or an issue if you prefer that.