mlpack.mean_shift

mean_shift(...)
Mean Shift Clustering

>>> from mlpack import mean_shift

This program performs mean shift clustering on the given dataset, storing the learned cluster assignments either as a column of labels in the input dataset or separately.

The input dataset should be specified with the 'input' parameter, and the radius used for search can be specified with the 'radius' parameter. The maximum number of iterations before algorithm termination is controlled with the 'max_iterations' parameter.

The output labels may be saved with the 'output' output parameter and the centroids of each cluster may be saved with the 'centroid' output parameter.

For example, to run mean shift clustering on the dataset 'data' and store the centroids to 'centroids', the following command may be used:

>>> mean_shift(input=data)
>>> centroids = output['centroid']

input options

output options

The return value from the binding is a dict containing the following elements: