Deprecated
As of 3.2 (to be removed in 4.0),
use org. instead
| Modifier and Type | Class and Description |
|---|---|
| public static enum | KMeansPlusPlusClusterer.
Strategies to use for replacing an empty cluster. |
| Modifier and Type | Field and Description |
|---|---|
| private final KMeansPlusPlusClusterer. | emptyStrategy
Selected strategy for empty clusters. |
| private final Random | random
Random generator for choosing initial centers. |
| Access | Constructor and Description |
|---|---|
| public | KMeansPlusPlusClusterer(final Random
random generator to use for choosing initial centers random)Build a clusterer. |
| public | KMeansPlusPlusClusterer(final Random
random generator to use for choosing initial centers random, final KMeansPlusPlusClusterer.strategy to use for handling empty clusters that
may appear during algorithm iterations emptyStrategyBuild a clusterer. |
| Modifier and Type | Method and Description |
|---|---|
| private static < type of the points to cluster T extends Clusterable | Returns: the number of points assigned to different clusters as the iteration beforethe clusters, final Collection<T> Clusters to add the points tothe points to add to the given points, final int[] Clusterspoints assignments to clusters assignments)Adds the given points to the closest |
| private static < type of the points to cluster T extends Clusterable | Returns: the initial centersthe points to choose the initial centers from points, final int the number of centers to choose k, final Random random generator to use random)Use K-means++ to choose the initial centers. |
| public List | Returns: a list of clusters containing the pointsthe points to cluster points, final int the number of clusters to split the data into k, int number of trial runs numTrials, int the maximum number of iterations to run the algorithm
for at each trial run. If negative, no maximum will be used maxIterationsPerTrial)Runs the K-means++ clustering algorithm. |
| public List | Returns: a list of clusters containing the pointsthe points to cluster points, final int the number of clusters to split the data into k, final int the maximum number of iterations to run the algorithm
for. If negative, no maximum will be used maxIterations)Runs the K-means++ clustering algorithm. |
| private T | Returns: point farthest to its cluster centerthe clusters)Clusters to searchGet the point farthest to its cluster center |
| private static < type of the points to cluster T extends Clusterable | Returns: the index of the nearestCluster to the given pointthe clusters, final T Clusters to searchthe point to find the nearest point)Cluster forReturns the nearest |
| private T | Returns: a random point from the selected clusterthe clusters)Clusters to searchGet a random point from the |
| private T | Returns: a random point from the selected clusterthe clusters)Clusters to searchGet a random point from the |
| emptyStrategy | back to summary |
|---|---|
| private final KMeansPlusPlusClusterer. Selected strategy for empty clusters. | |
| random | back to summary |
|---|---|
| private final Random random Random generator for choosing initial centers. | |
| KMeansPlusPlusClusterer | back to summary |
|---|---|
| public KMeansPlusPlusClusterer(final Random random) Build a clusterer. The default strategy for handling empty clusters that may appear during algorithm iterations is to split the cluster with largest distance variance.
| |
| KMeansPlusPlusClusterer | back to summary |
|---|---|
| public KMeansPlusPlusClusterer(final Random random, final KMeansPlusPlusClusterer. Build a clusterer.
| |
| assignPointsToClusters | back to summary |
|---|---|
| private static <T extends Clusterable Adds the given points to the closest
| |
| chooseInitialCenters | back to summary |
|---|---|
| private static <T extends Clusterable Use K-means++ to choose the initial centers.
| |
| cluster | back to summary |
|---|---|
| public List Runs the K-means++ clustering algorithm.
| |
| cluster | back to summary |
|---|---|
| public List Runs the K-means++ clustering algorithm.
| |
| getFarthestPoint | back to summary |
|---|---|
| private T getFarthestPoint(final Collection<Cluster<T>> clusters) throws ConvergenceException Get the point farthest to its cluster center
| |
| getNearestCluster | back to summary |
|---|---|
| private static <T extends Clusterable Returns the nearest
| |
| getPointFromLargestNumberCluster | back to summary |
|---|---|
| private T getPointFromLargestNumberCluster(final Collection<Cluster<T>> clusters) throws ConvergenceException Get a random point from the
| |
| getPointFromLargestVarianceCluster | back to summary |
|---|---|
| private T getPointFromLargestVarianceCluster(final Collection<Cluster<T>> clusters) throws ConvergenceException Get a random point from the
| |
| Modifier and Type | Field and Description |
|---|---|
| public static final KMeansPlusPlusClusterer. | ERROR
Generate an error. |
| public static final KMeansPlusPlusClusterer. | FARTHEST_POINT
Create a cluster around the point farthest from its centroid. |
| public static final KMeansPlusPlusClusterer. | LARGEST_POINTS_NUMBER
Split the cluster with largest number of points. |
| public static final KMeansPlusPlusClusterer. | LARGEST_VARIANCE
Split the cluster with largest distance variance. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static KMeansPlusPlusClusterer. | |
| public static KMeansPlusPlusClusterer. |
| ERROR | back to summary |
|---|---|
| public static final KMeansPlusPlusClusterer. Generate an error. | |
| FARTHEST_POINT | back to summary |
|---|---|
| public static final KMeansPlusPlusClusterer. Create a cluster around the point farthest from its centroid. | |
| LARGEST_POINTS_NUMBER | back to summary |
|---|---|
| public static final KMeansPlusPlusClusterer. Split the cluster with largest number of points. | |
| LARGEST_VARIANCE | back to summary |
|---|---|
| public static final KMeansPlusPlusClusterer. Split the cluster with largest distance variance. | |
| EmptyClusterStrategy | back to summary |
|---|---|
| private EmptyClusterStrategy() | |
| valueOf | back to summary |
|---|---|
| public static KMeansPlusPlusClusterer. | |
| values | back to summary |
|---|---|
| public static KMeansPlusPlusClusterer. | |