This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.

# ClusteringComponents

 ClusteringComponents[array]gives an array in which each element of array is replaced by an integer index representing the cluster in which the element lies. ClusteringComponentsfinds at most n clusters. ClusteringComponentsfinds clusters at the specified level in array. ClusteringComponents[image]finds clusters of pixels with similar values in image. ClusteringComponentsfinds at most n clusters in image.
• Other distance functions can be specified by setting the DistanceFunction option. Possible settings are:
 ManhattanDistance Manhattan or "city block" distance EuclideanDistance Euclidean distance SquaredEuclideanDistance squared Euclidean distance NormalizedSquaredEuclideanDistance normalized squared Euclidean distance CosineDistance angular cosine distance CorrelationDistance correlation coefficient distance
• 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 "KMeans" -means clustering algorithm "PAM" find clustering by partitioning around medoids
• ClusteringComponents accepts a option that is used to control the creation of the initial set of seeds.
Label two clusters of values in a list:
Clustering transform of nested lists:
Cluster analysis of an MR image:
Find a color segmentation of a satellite image:
Label two clusters of values in a list:
 Out[1]=

Clustering transform of nested lists:
 Out[1]=

Cluster analysis of an MR image:
 Out[1]=

Find a color segmentation of a satellite image:
 Out[1]=
 Scope   (6)
Clusters of values in a matrix:
Find color clusters in an image:
Find clusters at list level 2:
Find clusters at list level 1:
Find duplicates by specifying a large number of clusters:
Labeling clusters in a matrix:
 Applications   (1)
Color segmentation of a microscopic image, after smoothing with a Perona-Malik filter:
New in 8