BUILT-IN MATHEMATICA SYMBOL

# FindClusters

FindClusters[{e1, e2, ...}]
partitions the into clusters of similar elements.

FindClusters[{e1->v1, e2->v2, ...}]
returns the corresponding to the in each cluster.

FindClusters[{e1, e2, ...}->{v1, v2, ...}]
gives the same result.

FindClusters[{e1, e2, ...}, n]
partitions the into exactly n clusters.

## Details and OptionsDetails and Options

• FindClusters[{e1, e2, ...}, DistanceFunction->f] treats pairs of elements as being less similar when their distances are larger.
• If the are vectors of numbers, FindClusters by default in effect uses the Euclidean distance function EuclideanDistance.
• If the are lists of True and False, FindClusters by default uses a distance function based on the normalized fraction of elements that disagree.
• If the are strings, FindClusters by default uses a distance function based on the number of point changes needed to get from one string to another.
• For images, FindClusters[{img1, img2, ...}, DistanceFunction->f] effectively uses DistanceFunction->(ImageDistance[#1, #2, DistanceFunction->f]&).
• A Method option can be used to specify different methods of clustering. Possible settings include:
•  "Agglomerate" find clustering hierarchically "Optimize" find clustering by local optimization

## ExamplesExamplesopen allclose all

### Basic Examples (3)Basic Examples (3)

Find clusters of nearby values:

 Out[1]=

Find exactly four clusters:

 Out[1]=

Represent clustered elements with the right-hand sides of each rule:

 Out[1]=