If I have a certain dataset, how smart would it be to initialize cluster centers using means of random samples of that dataset. For example, suppose I want 5 clusters. I take 5 random samples of say, size=20% of the original dataset. Could I then take the mean of each of these 5 random samples and use those means as my 5 initial cluster centers? I don't know were I read this but I wanted to know what you guys think about the idea. Thank you in advanced.
|
|
If you randomly split the sample into 5 subsamples your 5 means will almost coincide. What is the sense of making such close points the initial cluster centres? In many K-means implementations, the default selection of initial cluster centres is based on the opposite idea: to find the 5 points which are most far apart and make them the initial centres. You may ask what may be the way to find those far apart points? Here's what SPSS' K-means is doing for that: Take any k cases (points) of the dataset as the initial centres. All the rest cases are being checked for the ability to substitute those as the initial centres, by the following conditions:
If condition (a) is not satisfied, condition (b) is checked; if it is not satisfied either the case does not become a centre. As the result of such run through cases we obtain k utmost cases in the cloud which become the initial centres. The result of this algo, although robust enough, is not fully insensitive to the starting choice of "any k cases" and to the sort order of cases in the dataset; so, several random starting attempts are still welcome, as it is always the case with K-means. |
|||||||||
|
|
Using the means of random samples will give you the opposite of what you need, as ttnphns pointed out in his comment. What we would need is a way to find data points that are fairly far from each other. Ideally, you could iterate over all points, find the distances between them, determine where the distances are the largest ... Not to sidestep the OP's intention, but I think the "solution" is built into the k-means algorithm. We perform multiple iterations and recalculate cluster centroids based on the previous iterations. We also usually run the kmeans algorithm several times (with random initial values), and compare the results. If one has a priori knowledge, domain knowledge, then that could lead to a superior method of identify where initial cluster centers should be. Otherwise, it's probably a matter of selecting random data points as initial values and then utilizing multiple runs and multiple iterations per run. |
|||
|
|
The means will be much too similar. You could just as well find the data set mean, and then place the initial centroids in a small circle/sphere around this mean. If you want to see some more sound initialization scheme for k-means, have a look at k-means++. They have devised a quite clever method for seeding k-means.
Author slides: http://www.ima.umn.edu/~iwen/REU/BATS-Means.pdf |
|||||||||
|
|
The answers proposed are all effective, but are much more difficult to operationalize than your original proposal. A very simple way to initialize is to take $k$ random observations as the original points. The probability of getting two initial points close is quite low, and the algorithm executes quickly for all but the most extreme cases. |
|||||||
|