WOLFRAM

generates a ClassifierFunction[] by partitioning data into clusters of similar elements.

ClusterClassify[data,n]

generates a ClassifierFunction[] with n clusters.

Details and Options

Examples

open allclose all

Basic Examples  (3)Summary of the most common use cases

Train the ClassifierFunction on some numerical data:

Out[1]=1

Use the classifier function to classify a new unlabeled example:

Out[2]=2

Obtain classification probabilities for this example:

Out[3]=3

Classify multiple examples:

Out[4]=4

Plot the probabilities for the two different classes in the interval {-5,5}:

Out[5]=5

Train the ClassifierFunction on some colors by requiring the number of classes to be 5:

Out[1]=1
Out[2]=2

Use the ClassifierFunction on some unlabeled data:

Out[3]=3

Gather the elements by their class number:

Out[4]=4

Train the ClassifierFunction on some strings:

Out[2]=2
Out[3]=3

Gather the elements by their class number:

Out[4]=4

Scope  (11)Survey of the scope of standard use cases

Classify real numbers:

Out[2]=2
Out[3]=3

Classify vectors:

Out[2]=2
Out[3]=3

Classify Boolean vectors:

Out[1]=1
Out[2]=2

Use the classifier to assign clusters to a new Boolean True, False vector:

Out[3]=3

Use the classifier to assign clusters to a Boolean 1, 0 vector:

Out[4]=4

Look at their probabilities:

Out[5]=5

Classify images:

Out[2]=2
Out[3]=3

Use the classifier to cluster new images:

Out[5]=5

Classify 3D images:

Out[1]=1
Out[2]=2
Out[3]=3

Classify colors:

Out[1]=1
Out[2]=2
Out[3]=3

Classify strings:

Out[2]=2

Use the classifier to cluster new strings:

Out[4]=4

Classify heterogeneous data:

Out[1]=1
Out[2]=2
Out[3]=3

Classify times:

Out[1]=1
Out[2]=2

Use the classifier to cluster the data:

Out[3]=3

Classify random reals:

Out[2]=2

Look at the classifier information:

Out[3]=3

Get a description for the specific method used:

Out[4]=4

Generate random points in the plane and visualize them:

Out[1]=1

Classify the data:

Out[2]=2

Classify new random points in the place:

Visualize the resulting clustering:

Out[4]=4

Classify the same test data using IndeterminateThreshold:

Visualize the resulting clustering including the Indeterminate cluster:

Out[6]=6

Options  (10)Common values & functionality for each option

CriterionFunction  (1)

Generate some separated data and visualize it:

Out[1]=1

Construct a classifier function using the Automatic CriterionFunction:

Out[2]=2

Construct a classifier function using the CalinskiHarabasz index as CriterionFunction:

Out[3]=3

Compare the two clusterings of the data:

Out[4]=4
Out[5]=5

FeatureExtractor  (1)

Create a ClassifierFunction from a list of images and classify new examples:

Out[2]=2
Out[3]=3

Create a custom FeatureExtractor to extract features:

Out[4]=4
Out[5]=5
Out[6]=6

FeatureNames  (1)

Generate a classifier function and give a name to each feature:

Out[1]=1

Use the association format to assign cluster to a new example:

Out[2]=2

The list format can still be used:

Out[3]=3

FeatureTypes  (1)

Generate a classifier function assuming numerical and nominal feature types:

Out[1]=1

Generate a classifier function assuming nominal feature types instead:

Out[2]=2

Compare the result on new examples:

Out[3]=3

Method  (2)

Generate some data using uniform distributions:

Out[1]=1

Classify the data:

Out[2]=2

Use Information to obtain a method description:

Out[3]=3

Look at the clustered data:

Out[4]=4

Classify the data using k-means:

Out[5]=5

Look at the clustered data:

Out[6]=6

Generate a large dataset using multinormal distributions and visualize it:

Out[1]=1

Use ClusterClassify to find clusters by specifying the method to use and look at the AbsoluteTiming:

Out[2]=2

Look at the resulting clustering:

Out[3]=3

Use ClusterClassify to find clusters without specifying the method to use and look at the AbsoluteTiming:

Out[4]=4

MissingValueSynthesis  (1)

Generate a large dataset using multinormal distributions and visualize it:

Out[1]=1

Use ClusterClassify to find clusters:

Out[2]=2

Get the top cluster probabilities for a point with missing data:

Out[3]=3

Set the missing value synthesis to replace each missing variable with its estimated most likely value given known values (which is the default behavior):

Out[4]=4

Replace missing variables with random samples conditioned on known values:

Out[5]=5

Get the distribution of likely clusters for the point by replacing missing variables repeatedly with the random sampling strategy:

Out[6]=6

PerformanceGoal  (1)

Generate a uniformly distributed dataset and visualize it:

Out[1]=1

Obtain a classifier from this data, with an emphasis on training speed:

Out[2]=2

Assign clusters to some randomly generated data and look at the AbsoluteTiming:

Out[4]=4

Obtain a classifier from this data, with an emphasis on the speed:

Out[5]=5

Assign clusters to some randomly generated data and look at the AbsoluteTiming compared to the one above:

Out[6]=6

Visualize the two clusterings for the test data and note how the setting "TrainingSpeed" gives better results:

Out[7]=7
Out[8]=8

RandomSeeding  (1)

Train several classifiers on random colors:

Out[1]=1

Compute the classifiers on a new color and observe that the result is always the same:

Out[3]=3

Train several classifiers on the same colors by using different values of the RandomSeeding option:

Compute the classifiers on and observe how the classifier differs:

Out[5]=5

Weights  (1)

Generate some separated data containing outliers:

Out[2]=2

Clusterize the data:

Out[3]=3

Use the classifier function to classify the outlier together with another point:

Out[4]=4

Clusterize the data, adding a big weight on the outlier:

Out[5]=5

Use the classifier function to classify the same points:

Out[6]=6

Applications  (3)Sample problems that can be solved with this function

Train several classifiers on a small, uniformly distributed dataset:

Divide a triangle into segments by using the classifiers on a large number of uniformly distributed random points:

Out[8]=8

Generate some normally distributed data:

Out[1]=1

Clusterize the data without specifying the number of classes:

Out[2]=2
Out[3]=3

Clusterize the data, specifying the number of classes:

Out[4]=4
Out[5]=5

Find dominant colors in an image:

Cluster the data given by the array of pixel values of the image:

Use the classifier to assign clusters to each pixel:

Use the classifier function to find four dominant colors:

Out[4]=4

Use the classifier to get binary masks for each dominant color:

Out[5]=5
Wolfram Research (2016), ClusterClassify, Wolfram Language function, https://reference.wolfram.com/language/ref/ClusterClassify.html (updated 2020).
Wolfram Research (2016), ClusterClassify, Wolfram Language function, https://reference.wolfram.com/language/ref/ClusterClassify.html (updated 2020).

Text

Wolfram Research (2016), ClusterClassify, Wolfram Language function, https://reference.wolfram.com/language/ref/ClusterClassify.html (updated 2020).

Wolfram Research (2016), ClusterClassify, Wolfram Language function, https://reference.wolfram.com/language/ref/ClusterClassify.html (updated 2020).

CMS

Wolfram Language. 2016. "ClusterClassify." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2020. https://reference.wolfram.com/language/ref/ClusterClassify.html.

Wolfram Language. 2016. "ClusterClassify." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2020. https://reference.wolfram.com/language/ref/ClusterClassify.html.

APA

Wolfram Language. (2016). ClusterClassify. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ClusterClassify.html

Wolfram Language. (2016). ClusterClassify. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ClusterClassify.html

BibTeX

@misc{reference.wolfram_2025_clusterclassify, author="Wolfram Research", title="{ClusterClassify}", year="2020", howpublished="\url{https://reference.wolfram.com/language/ref/ClusterClassify.html}", note=[Accessed: 19-June-2025 ]}

@misc{reference.wolfram_2025_clusterclassify, author="Wolfram Research", title="{ClusterClassify}", year="2020", howpublished="\url{https://reference.wolfram.com/language/ref/ClusterClassify.html}", note=[Accessed: 19-June-2025 ]}

BibLaTeX

@online{reference.wolfram_2025_clusterclassify, organization={Wolfram Research}, title={ClusterClassify}, year={2020}, url={https://reference.wolfram.com/language/ref/ClusterClassify.html}, note=[Accessed: 19-June-2025 ]}

@online{reference.wolfram_2025_clusterclassify, organization={Wolfram Research}, title={ClusterClassify}, year={2020}, url={https://reference.wolfram.com/language/ref/ClusterClassify.html}, note=[Accessed: 19-June-2025 ]}