T
- type of the points to clusterKMeansPlusPlusClusterer
instead@Deprecated public class KMeansPlusPlusClusterer<T extends Clusterable<T>> extends Object
Modifier and Type | Class and Description |
---|---|
static class |
KMeansPlusPlusClusterer.EmptyClusterStrategy
Deprecated.
Strategies to use for replacing an empty cluster.
|
Constructor and Description |
---|
KMeansPlusPlusClusterer(Random random)
Deprecated.
Build a clusterer.
|
KMeansPlusPlusClusterer(Random random,
KMeansPlusPlusClusterer.EmptyClusterStrategy emptyStrategy)
Deprecated.
Build a clusterer.
|
Modifier and Type | Method and Description |
---|---|
List<Cluster<T>> |
cluster(Collection<T> points,
int k,
int maxIterations)
Deprecated.
Runs the K-means++ clustering algorithm.
|
List<Cluster<T>> |
cluster(Collection<T> points,
int k,
int numTrials,
int maxIterationsPerTrial)
Deprecated.
Runs the K-means++ clustering algorithm.
|
public KMeansPlusPlusClusterer(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(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 List<Cluster<T>> cluster(Collection<T> points, int k, int numTrials, int maxIterationsPerTrial) throws MathIllegalArgumentException, ConvergenceException
points
- the points to clusterk
- the number of clusters to split the data intonumTrials
- number of trial runsmaxIterationsPerTrial
- the maximum number of iterations to run the algorithm
for at each trial run. If negative, no maximum will be usedMathIllegalArgumentException
- if the data points are null or the number
of clusters is larger than the number of data pointsConvergenceException
- if an empty cluster is encountered and the
emptyStrategy
is set to ERROR
public List<Cluster<T>> cluster(Collection<T> points, int k, int maxIterations) throws MathIllegalArgumentException, ConvergenceException
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 usedMathIllegalArgumentException
- if the data points are null or the number
of clusters is larger than the number of data pointsConvergenceException
- if an empty cluster is encountered and the
emptyStrategy
is set to ERROR
Copyright © 2003–2016 The Apache Software Foundation. All rights reserved.