T - type of the points to clusterpublic class MultiKMeansPlusPlusClusterer<T extends Clusterable> extends Clusterer<T>
| Modifier and Type | Field and Description |
|---|---|
private KMeansPlusPlusClusterer<T> |
clusterer
The underlying k-means clusterer.
|
private ClusterEvaluator<T> |
evaluator
The cluster evaluator to use.
|
private int |
numTrials
The number of trial runs.
|
| Constructor and Description |
|---|
MultiKMeansPlusPlusClusterer(KMeansPlusPlusClusterer<T> clusterer,
int numTrials)
Build a clusterer.
|
MultiKMeansPlusPlusClusterer(KMeansPlusPlusClusterer<T> clusterer,
int numTrials,
ClusterEvaluator<T> evaluator)
Build a clusterer.
|
| Modifier and Type | Method and Description |
|---|---|
java.util.List<CentroidCluster<T>> |
cluster(java.util.Collection<T> points)
Runs the K-means++ clustering algorithm.
|
KMeansPlusPlusClusterer<T> |
getClusterer()
Returns the embedded k-means clusterer used by this instance.
|
ClusterEvaluator<T> |
getClusterEvaluator()
Returns the
ClusterEvaluator used to determine the "best" clustering. |
int |
getNumTrials()
Returns the number of trials this instance will do.
|
distance, getDistanceMeasureprivate final KMeansPlusPlusClusterer<T extends Clusterable> clusterer
private final int numTrials
private final ClusterEvaluator<T extends Clusterable> evaluator
public MultiKMeansPlusPlusClusterer(KMeansPlusPlusClusterer<T> clusterer, int numTrials)
clusterer - the k-means clusterer to usenumTrials - number of trial runspublic MultiKMeansPlusPlusClusterer(KMeansPlusPlusClusterer<T> clusterer, int numTrials, ClusterEvaluator<T> evaluator)
clusterer - the k-means clusterer to usenumTrials - number of trial runsevaluator - the cluster evaluator to usepublic KMeansPlusPlusClusterer<T> getClusterer()
public int getNumTrials()
public ClusterEvaluator<T> getClusterEvaluator()
ClusterEvaluator used to determine the "best" clustering.ClusterEvaluatorpublic java.util.List<CentroidCluster<T>> cluster(java.util.Collection<T> points) throws MathIllegalArgumentException, ConvergenceException
cluster in class Clusterer<T extends Clusterable>points - the points to clusterMathIllegalArgumentException - 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
underlying KMeansPlusPlusClusterer has its
KMeansPlusPlusClusterer.EmptyClusterStrategy is set to ERROR.Copyright (c) 2003-2015 Apache Software Foundation