Enum linfa_clustering::KMeansInit
source · [−]#[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
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
sourceimpl<F: Clone + Float> Clone for KMeansInit<F>
impl<F: Clone + Float> Clone for KMeansInit<F>
sourcefn clone(&self) -> KMeansInit<F>
fn clone(&self) -> KMeansInit<F>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<F: Debug + Float> Debug for KMeansInit<F>
impl<F: Debug + Float> Debug for KMeansInit<F>
sourceimpl<F: PartialEq + Float> PartialEq<KMeansInit<F>> for KMeansInit<F>
impl<F: PartialEq + Float> PartialEq<KMeansInit<F>> for KMeansInit<F>
sourcefn eq(&self, other: &KMeansInit<F>) -> bool
fn eq(&self, other: &KMeansInit<F>) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &KMeansInit<F>) -> bool
fn ne(&self, other: &KMeansInit<F>) -> bool
This method tests for !=
.
impl<F: Float> StructuralPartialEq for KMeansInit<F>
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more