Warning: This documentation is for scikits.learn version 0.7.1. — Latest stable version

Contents

6.8.4. scikits.learn.cluster.AffinityPropagation

class scikits.learn.cluster.AffinityPropagation(damping=0.5, max_iter=200, convit=30, copy=True)

Perform Affinity Propagation Clustering of data

Parameters :

damping : float, optional

Damping factor

max_iter : int, optional

Maximum number of iterations

convit : int, optional

Number of iterations with no change in the number of estimated clusters that stops the convergence.

copy: boolean, optional :

Make a copy of input data. True by default.

Notes

See examples/plot_affinity_propagation.py for an example.

Reference:

Brendan J. Frey and Delbert Dueck, “Clustering by Passing Messages Between Data Points”, Science Feb. 2007

The algorithmic complexity of affinity propagation is quadratic in the number of points.

Attributes

cluster_centers_indices_ array, [n_clusters] Indices of cluster centers
labels_ array, [n_samples] Labels of each point

Methods

fit: Compute the clustering
__init__(damping=0.5, max_iter=200, convit=30, copy=True)
fit(S, p=None, **params)

compute MeanShift

Parameters :

S: array [n_points, n_points] :

Matrix of similarities between points

p: array [n_points,] or float, optional :

Preferences for each point

damping : float, optional

Damping factor

copy: boolean, optional :

If copy is False, the affinity matrix is modified inplace by the algorithm, for memory efficiency