1
$\begingroup$

I have data and tried to do clustering on it. every time I run the code with the below statements it changes the angle of the shape but still the same below shape

mds = manifold.MDS(max_iter=200, eps=1e-4, n_init=1,dissimilarity='precomputed')
dp_mds = mds.fit_transform(dist)

Does that normal?

enter image description here

and Does this shape has more cluster? enter image description here

$\endgroup$

1 Answer 1

0
$\begingroup$

The change in angles is due to the random nature of sklearn.manifold.MDS. Change your code to

mds = manifold.MDS(max_iter=200,
                   eps=1e-4,
                   n_init=1,
                   dissimilarity='precomputed',
                   random_state=0)

dp_mds = mds.fit_transform(dist)

Setting the random_state to any integer solves the problem.

$\endgroup$
2
  • $\begingroup$ thanks a lot for replying , i will try it now .. but does the second image has two cluster ? $\endgroup$ Commented Feb 23, 2021 at 17:16
  • $\begingroup$ You should investigate further, using one manifold learning algorithm in these situations doesn't seem correct. $\endgroup$ Commented Feb 23, 2021 at 17:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.