org.apache.commons.math.stat.clustering
Class KMeansPlusPlusClusterer<T extends Clusterable<T>>
java.lang.Object
org.apache.commons.math.stat.clustering.KMeansPlusPlusClusterer<T>
- Type Parameters:
T
- type of the points to cluster
public class KMeansPlusPlusClusterer<T extends Clusterable<T>>
- extends Object
Clustering algorithm based on David Arthur and Sergei Vassilvitski k-means++ algorithm.
- Since:
- 2.0
- Version:
- $Revision: 771076 $ $Date: 2009-05-03 12:28:48 -0400 (Sun, 03 May 2009) $
- See Also:
- K-means++ (wikipedia)
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
KMeansPlusPlusClusterer
public KMeansPlusPlusClusterer(Random random)
- Build a clusterer.
- Parameters:
random
- random generator to use for choosing initial centers
cluster
public List<Cluster<T>> cluster(Collection<T> points,
int k,
int maxIterations)
- Runs the K-means++ clustering algorithm.
- Parameters:
points
- the points to clusterk
- the number of clusters to split the data intomaxIterations
- the maximum number of iterations to run the algorithm
for. If negative, no maximum will be used
- Returns:
- a list of clusters containing the points
Copyright © 2003-2009 Apache Software Foundation. All Rights Reserved.