patchy631/machine-learning

the reproduction of results?

Closed this issue · 1 comments

Hi, thanks for sharing the codes.
I have a simple question:
When I run the codes in KMeans_from_scratch.ipynb, sometimes I got a strange result, please see below
image

How to improve this?

Hi Thanks for trying this out.
KMeans does initialisation of cluster centroids randomly, there is a smarter way called KMeans ++ which i also mentioned in the thread & it's more robust.
I'll be discussing that in future, meanwhile you can find it in the scikit-learn package as a library.
Cheers!