| 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 int | k
The number of clusters. |
| private final int | maxIterations
The maximum number of iterations. |
| private final RandomGenerator | random
Random generator for choosing initial centers. |
| Access | Constructor and Description |
|---|---|
| public | |
| public | KMeansPlusPlusClusterer(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)Build a clusterer. |
| public | KMeansPlusPlusClusterer(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, final DistanceMeasure the distance measure to use measure)Build a clusterer. |
| public | KMeansPlusPlusClusterer(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, final DistanceMeasure the distance measure to use measure, final RandomGenerator random generator to use for choosing initial centers random)Build a clusterer. |
| public | KMeansPlusPlusClusterer(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, final DistanceMeasure the distance measure to use measure, final RandomGenerator 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 int | 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 Clusterable | Returns: the computed centroid for the set of pointsthe set of points points, final int the point dimension dimension)Computes the centroid for a set of points. |
| private List | Returns: the initial centersthe points to choose the initial centers from points)Use K-means++ to choose the initial centers. |
| public List | Returns: a list of clusters containing the pointsthe points to cluster points)Implements abstract org. Runs the K-means++ clustering algorithm. |
| public KMeansPlusPlusClusterer. | Returns: theEmptyClusterStrategyReturns the |
| private T | Returns: point farthest to its cluster centerthe clusters)Clusters to searchGet the point farthest to its cluster center |
| public int | |
| public int | Returns: the maximum number of iterations, or -1 if no maximum is setReturns the maximum number of iterations this instance will use. |
| private int | 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 |
| public RandomGenerator | Returns: the random generatorReturns the random generator this instance will use. |
| emptyStrategy | back to summary |
|---|---|
| private final KMeansPlusPlusClusterer. Selected strategy for empty clusters. | |
| k | back to summary |
|---|---|
| private final int k The number of clusters. | |
| maxIterations | back to summary |
|---|---|
| private final int maxIterations The maximum number of iterations. | |
| random | back to summary |
|---|---|
| private final RandomGenerator random Random generator for choosing initial centers. | |
| KMeansPlusPlusClusterer | back to summary |
|---|---|
| public KMeansPlusPlusClusterer(final int k) 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. The euclidean distance will be used as default distance measure.
| |
| KMeansPlusPlusClusterer | back to summary |
|---|---|
| public KMeansPlusPlusClusterer(final int k, final int maxIterations) 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. The euclidean distance will be used as default distance measure.
| |
| KMeansPlusPlusClusterer | back to summary |
|---|---|
| public KMeansPlusPlusClusterer(final int k, final int maxIterations, final DistanceMeasure measure) 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 int k, final int maxIterations, final DistanceMeasure measure, final RandomGenerator 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 int k, final int maxIterations, final DistanceMeasure measure, final RandomGenerator random, final KMeansPlusPlusClusterer. Build a clusterer.
| |
| assignPointsToClusters | back to summary |
|---|---|
| private int assignPointsToClusters(final List<CentroidCluster<T>> clusters, final Collection<T> points, final int[] assignments) Adds the given points to the closest
| |
| centroidOf | back to summary |
|---|---|
| private Clusterable centroidOf(final Collection<T> points, final int dimension) Computes the centroid for a set of points.
| |
| chooseInitialCenters | back to summary |
|---|---|
| private List Use K-means++ to choose the initial centers.
| |
| cluster | back to summary |
|---|---|
| public List Implements abstract org. Runs the K-means++ clustering algorithm.
| |
| getEmptyClusterStrategy | back to summary |
|---|---|
| public KMeansPlusPlusClusterer. Returns the | |
| getFarthestPoint | back to summary |
|---|---|
| private T getFarthestPoint(final Collection<CentroidCluster<T>> clusters) throws ConvergenceException Get the point farthest to its cluster center
| |
| getK | back to summary |
|---|---|
| public int getK() Return the number of clusters this instance will use.
| |
| getMaxIterations | back to summary |
|---|---|
| public int getMaxIterations() Returns the maximum number of iterations this instance will use.
| |
| getNearestCluster | back to summary |
|---|---|
| private int getNearestCluster(final Collection<CentroidCluster<T>> clusters, final T point) Returns the nearest
| |
| getPointFromLargestNumberCluster | back to summary |
|---|---|
| private T getPointFromLargestNumberCluster(final Collection<? extends Cluster<T>> clusters) throws ConvergenceException Get a random point from the
| |
| getPointFromLargestVarianceCluster | back to summary |
|---|---|
| private T getPointFromLargestVarianceCluster(final Collection<CentroidCluster<T>> clusters) throws ConvergenceException Get a random point from the
| |
| getRandomGenerator | back to summary |
|---|---|
| public RandomGenerator getRandomGenerator() Returns the random generator this instance will use.
| |
| 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. | |