T
- type of the points to clusterpublic class KMeansPlusPlusClusterer<T extends Clusterable<T>>
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
KMeansPlusPlusClusterer.EmptyClusterStrategy
Strategies to use for replacing an empty cluster.
|
Constructor and Description |
---|
KMeansPlusPlusClusterer(java.util.Random random)
Build a clusterer.
|
KMeansPlusPlusClusterer(java.util.Random random,
KMeansPlusPlusClusterer.EmptyClusterStrategy emptyStrategy)
Build a clusterer.
|
Modifier and Type | Method and Description |
---|---|
java.util.List<Cluster<T>> |
cluster(java.util.Collection<T> points,
int k,
int maxIterations)
Runs the K-means++ clustering algorithm.
|
public KMeansPlusPlusClusterer(java.util.Random random)
The default strategy for handling empty clusters that may appear during algorithm iterations is to split the cluster with largest distance variance.
random
- random generator to use for choosing initial centerspublic KMeansPlusPlusClusterer(java.util.Random random, KMeansPlusPlusClusterer.EmptyClusterStrategy emptyStrategy)
random
- random generator to use for choosing initial centersemptyStrategy
- strategy to use for handling empty clusters that
may appear during algorithm iterationspublic java.util.List<Cluster<T>> cluster(java.util.Collection<T> points, int k, int maxIterations)
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 usedCopyright © 2010 - 2020 Adobe. All Rights Reserved