ClusteringComponents

ClusteringComponents[array]
gives an array in which each element at the lowest level of array is replaced by an integer index representing the cluster in which the element lies.

ClusteringComponents[array, n]
finds at most n clusters.

ClusteringComponents[array, n, level]
finds clusters at the specified level in array.

ClusteringComponents[image]
finds clusters of pixels with similar values in image.

ClusteringComponents[image, n]
finds at most n clusters in image.

Details and OptionsDetails and Options

ExamplesExamplesopen allclose all

Basic Examples (4)Basic Examples (4)

Label two clusters of values in a list:

In[1]:=
Click for copyable input
Out[1]=

Clustering transform of nested lists:

In[1]:=
Click for copyable input
Out[1]=

Cluster analysis of an MR image:

In[1]:=
Click for copyable input
Out[1]=

Find a color segmentation of a satellite image:

In[1]:=
Click for copyable input
Out[1]=
New in 8 | Last modified in 9
New to Mathematica? Find your learning path »
Have a question? Ask support »