Table Of Contents

Previous topic

neurospin.clustering.bootstrap_hc

Next topic

neurospin.clustering.gmm

This Page

neurospin.clustering.clustering

Module: neurospin.clustering.clustering

Clustering routines. Author: Bertrand Thirion (INRIA Saclay, Orsay, France), 2004-2008.

nipy.neurospin.clustering.clustering.kmeans(X, nbclusters=2, Labels=None, maxiter=300, delta=0.0001, verbose=0)
Centers, Labels, J = Cmeans(X,nbclusters,Labels,maxiter,delta)
cmeans clustering algorithm

INPUT : - A data array X, supposed to be written as (n*p)

where n = number of features, p =number of dimensions
  • nbclusters (int), the number of desired clusters
  • Labels=None n array of predefined Labels. if None or inadequate a random initilization is performed.
  • maxiter(int, =300 by default), the maximum number of iterations before convergence
  • delta(double, =0.0001 by default),
the relative increment in the results before declaring convergence - verbose=0: verboseity mode

OUPUT : - Centers: array of size nbclusters*p, the centroids of

the resulting clusters
  • Labels : arroy of size n, the discrete labels of the input items;
  • J the final value of the criterion