How to overcome K-Mean weakness ?

John Park
2 min readFeb 1, 2017

The K-mean algorithm has a problem that the result varies depending on the initial value.

k-Means 1st trial
k-Mean 2nd trial

The k-Mean algorithm can be tested using the tools provided by the Naftali blog.

The above result is not the result of fitting the centeroid we chose, but only the result, depending on the initial position that we accidentally selected. This is clearer if you test with a slightly simpler result.

Fitting result change according to initial value change

It is a disadvantage of the k-Mean algorithm that different results can be obtained each time, even if the k-Mean algorithm is applied to the same data with the same number of point.

So how do we overcome this weakness of the k-Mean algorithm? We can overcome this by iterating the initial values and iterating through the algorithm.

The kmean library provided by Python scikit learn

--

--