[SciPy-User] [SciPy-user] different answers got from scipy.cluster.vq.kmeans

qingkunl qingkunlqk at gmail.com
Tue Jul 19 17:37:28 EDT 2011


Hello,
When I run scipy.cluster.vq.kmeans with exactly the same parameters passed
to the function, I got different answers each time.
>>> a
array([[1, 2, 3],
       [4, 5, 6],
       [7, 8, 9]])
>>> kmeans(a, 2, iter=20, thresh=1e-5)
(array([[2, 3, 4],
       [7, 8, 9]]), 1.7320508075688774)
>>> kmeans(a, 2, iter=20, thresh=1e-5)
(array([[7, 8, 9],
       [2, 3, 4]]), 1.7320508075688774)
>>> kmeans(a, 2, iter=20, thresh=1e-5)
(array([[1, 2, 3],
       [5, 6, 7]]), 1.7320508075688774)
>>> kmeans(a, 2, iter=20, thresh=1e-5)
(array([[5, 6, 7],
       [1, 2, 3]]), 1.7320508075688774)

I know they are all correct answers. But is there a way for me to get a
deterministic answer?

Thanks,
Qingkun
-- 
View this message in context: http://old.nabble.com/different-answers-got-from-scipy.cluster.vq.kmeans-tp32094443p32094443.html
Sent from the Scipy-User mailing list archive at Nabble.com.




More information about the SciPy-User mailing list