Enum linfa_clustering::KMeansInit [−][src]
#[non_exhaustive]
pub enum KMeansInit<F: Float> {
Random,
Precomputed(Array2<F>),
KMeansPlusPlus,
KMeansPara,
}
Expand description
Specifies centroid initialization algorithm for KMeans.
Variants (Non-exhaustive)
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Pick random points as centroids.
Precomputed(Array2<F>)
Precomputed list of centroids, represented as an array of (n_centroids, n_features).
Tuple Fields of Precomputed
0: Array2<F>
K-means++ algorithm. Using this over random initialization causes K-means to converge faster for almost all cases, since K-means++ produces better centroids.
K-means|| algorithm, a parallelized version of K-means++. Performs much better than K-means++ when the number of clusters is large (>100) while producing similar centroids, so use this for larger datasets. Details on the algorithm can be found here.
Trait Implementations
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
Auto Trait Implementations
impl<F> RefUnwindSafe for KMeansInit<F> where
F: RefUnwindSafe,
impl<F> Send for KMeansInit<F>
impl<F> Sync for KMeansInit<F>
impl<F> Unpin for KMeansInit<F>
impl<F> UnwindSafe for KMeansInit<F> where
F: RefUnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more