#[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.
Random
Pick random points as centroids.
Precomputed(Array2<F>)
Precomputed list of centroids, represented as an array of (n_centroids, n_features).
KMeansPlusPlus
K-means++ algorithm. Using this over random initialization causes K-means to converge faster for almost all cases, since K-means++ produces better centroids.
KMeansPara
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§
Source§impl<F: Clone + Float> Clone for KMeansInit<F>
impl<F: Clone + Float> Clone for KMeansInit<F>
Source§fn clone(&self) -> KMeansInit<F>
fn clone(&self) -> KMeansInit<F>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreimpl<F: Float> StructuralPartialEq for KMeansInit<F>
Auto Trait Implementations§
impl<F> Freeze for KMeansInit<F>
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§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more