# How to identify quickly an aproximative number of clusters from a relatively small dataset

How is it possible to identify quickly (without doing many tests) an approximative number of clusters from a dataset which is not vary large, even if this value is not the correct number of clusters, I just want to identify a reasonable value representing the number of clusters from this small dataset.

Note1: that I don't want to do many tests and/or cross-validate just to find an optimal number of clusters (time is important for me).

Note2: I know that there is no way to automatically set the "right" K nor is there a definition of what "right" is. I just want a reasonably approximative value.

• One. One cluster is always "reasonable" (a somewhat subjective criterion...) and takes only O(1) time, effort, and RAM to compute :-). Lest this seem facetious or non-constructive, my point is that this question really needs some clarification and additional information to be answerable: what are you clustering; why are you doing so; what really does "reasonable" mean, and exactly what would constitute an "optimal" number in this situation? – whuber Mar 12 '12 at 19:01
• BTW, I see you know how to accept answers, because you have accepted one out of your 11 questions so far. Is there a problem with the replies you have received for the other 10 that causes you not to accept any of those answers? – whuber Mar 12 '12 at 19:03
• When it's relatively small, why is time an issue? – Anony-Mousse Mar 13 '12 at 0:13
• I downvoted the question because you didn't tell the number of variables or cases nor the software package(s) you have available. – rolando2 Apr 12 '12 at 0:45

In Mathematica there is a very useful function that might help you (FindClusters):

FindClusters[{1, 2, 10, 12, 3, 1, 13, 25}]


finds clusters of nearby values and gives you this output:

{{1, 2, 3, 1}, {10, 12, 13, 25}}

You can also search for an exact number of clusters (in this case 4):

FindClusters[{1, 2, 10, 12, 3, 1, 13, 25}, 4]


{{1, 1}, {2, 3}, {10}, {12, 13, 25}}

might want to have a look at gap statistic

http://blog.echen.me/2011/03/19/counting-clusters/