Constructs a KMeans instance with default parameters: {k: 2, maxIterations: 20, initializationMode: "k-means||", initializationSteps: 2, epsilon: 1e-4, seed: random, distanceMeasure: "euclidean"}.
Constructs a KMeans instance with default parameters: {k: 2, maxIterations: 20, initializationMode: "k-means||", initializationSteps: 2, epsilon: 1e-4, seed: random, distanceMeasure: "euclidean"}.
The distance suite used by the algorithm.
The distance suite used by the algorithm.
The distance threshold within which we've consider centers to have converged.
The distance threshold within which we've consider centers to have converged.
The initialization algorithm.
The initialization algorithm. This can be either "random" or "k-means||".
Number of steps for the k-means|| initialization mode
Number of steps for the k-means|| initialization mode
Number of clusters to create (k).
Number of clusters to create (k).
It is possible for fewer than k clusters to be returned, for example, if there are fewer than k distinct points to cluster.
Maximum number of iterations allowed.
Maximum number of iterations allowed.
The random seed for cluster initialization.
The random seed for cluster initialization.
Train a K-means model on the given set of points; data
should be cached for high
performance, because this is an iterative algorithm.
Train a K-means model on the given set of points; data
should be cached for high
performance, because this is an iterative algorithm.
Set the distance suite used by the algorithm.
Set the distance suite used by the algorithm.
Set the distance threshold within which we've consider centers to have converged.
Set the distance threshold within which we've consider centers to have converged. If all centers move less than this Euclidean distance, we stop iterating one run.
Set the initial starting point, bypassing the random initialization or k-means|| The condition model.k == this.k must be met, failure results in an IllegalArgumentException.
Set the initial starting point, bypassing the random initialization or k-means|| The condition model.k == this.k must be met, failure results in an IllegalArgumentException.
Set the initialization algorithm.
Set the initialization algorithm. This can be either "random" to choose random points as initial cluster centers, or "k-means||" to use a parallel variant of k-means++ (Bahmani et al., Scalable K-Means++, VLDB 2012). Default: k-means||.
Set the number of steps for the k-means|| initialization mode.
Set the number of steps for the k-means|| initialization mode. This is an advanced setting -- the default of 2 is almost always enough. Default: 2.
Set the number of clusters to create (k).
Set the number of clusters to create (k).
It is possible for fewer than k clusters to be returned, for example, if there are fewer than k distinct points to cluster. Default: 2.
Set maximum number of iterations allowed.
Set maximum number of iterations allowed. Default: 20.
Set the random seed for cluster initialization.
Set the random seed for cluster initialization.
This function has no effect since Spark 2.0.0.
This function has no effect since Spark 2.0.0.
(Since version 2.1.0) This has no effect and always returns 1
This function has no effect since Spark 2.0.0.
This function has no effect since Spark 2.0.0.
(Since version 2.1.0) This has no effect
K-means clustering with a k-means++ like initialization mode (the k-means|| algorithm by Bahmani et al).
This is an iterative algorithm that will make multiple passes over the data, so any RDDs given to it should be cached by the user.