In many cases, FindClusters and ClusteringComponents provide similar results. Options for hierarchical and agglomerative clustering are available for both of these functions. So, would you please help me to understand clearly the differences between them?

Just to be clear,my main question concerns about choosing appropriate function for different research questions and anlysis. That is, it's not important if the two functions (or other similar functions) produce different outputs with the same meaning rather I want to know when to use which function and why.

Also, please post any tutorial for cluster analysis in Mathematica if you aware of.

  • 2
    $\begingroup$ Did you try reference.wolfram.com/mathematica/tutorial/… ? $\endgroup$
    – Rod
    Jun 12 '13 at 16:58
  • $\begingroup$ @ Rod Lm , yes I did but I couldn't figure out the difference then I posted my question here. I know that there are different options but when results are similar in most the cases and ClusteringComponents is faster that the other procedures, wondering what's the advantage of FindClusters ? $\endgroup$
    – Amin
    Jun 12 '13 at 17:05
  • $\begingroup$ Take a look at the difference between ClusteringComponents[{1, 2, 3, 7, 8}, 2] and FindClusters[{1, 2, 3, 7, 8}, 2] ... $\endgroup$
    – Rod
    Jun 12 '13 at 17:07
  • $\begingroup$ @ Rod Lm ,just the outputs were different. ClusteringComponents gives cluster memberships for each element but FindClusters clusters elements into two clusters.The same results! $\endgroup$
    – Amin
    Jun 12 '13 at 17:15
  • 3
    $\begingroup$ @RodLm well, since (as you point out) the "what" is addressed in the documentation, while the "why" is unlikely to be answerable, I suppose there isn't anything left to say. As such, I'm voting to close as TL. $\endgroup$ Jun 12 '13 at 18:03

Apart from the output format, the main differences are:

  • FindClusters can take a custom DistanceFunction whereas ClusteringComponents can only use those listed in the documentation

  • FindClusters works with strings and lists of True/False but ClusteringComponents only takes numerical arrays

  • FindClusters takes a 1D list as input, ClusteringComponents can take arrays of any dimension and has a level argument to determine at what level to find clusters

It is also worth noting that with the method options "Optimize" and "Agglomerate", ClusteringComponents uses FindClusters internally. For the "KMeans" and "PAM" methods there are separate implementations, using Image`KMeansClustering and Image`KMedoidsClustering.


Not the answer you're looking for? Browse other questions tagged or ask your own question.