K-means trivial matlab implementationI implemented a simple and heavile commented k-means algorithm example.
The thing that suprised me, that initialization of Centroids by
randomly choosen input vector is in fact bad idea.
The problem is when the Centroid is set up as a distance outlier
and gets stuck there.
On the other hand, randomly chosen vectors from interval where all the data points are located perform without any such unexpected problems.
The source code is at github.
On of the visualised results for 2D sample inputs