pub struct KMeansConfigBuilder<'a, T: Primitive> { /* private fields */ }Implementations§
Source§impl<'a, T: Primitive> KMeansConfigBuilder<'a, T>
impl<'a, T: Primitive> KMeansConfigBuilder<'a, T>
Sourcepub fn init_done(self, init_done: &'a dyn Fn(&KMeansState<T>)) -> Self
pub fn init_done(self, init_done: &'a dyn Fn(&KMeansState<T>)) -> Self
Set the callback that should be called after the centroid initialization, before the iteration starts.
Sourcepub fn iteration_done(
self,
iteration_done: &'a dyn Fn(&KMeansState<T>, usize, T),
) -> Self
pub fn iteration_done( self, iteration_done: &'a dyn Fn(&KMeansState<T>, usize, T), ) -> Self
Set the callback that should be called after each iteration during a running k-means calculation.
Sourcepub fn random_generator<R: RngCore + 'static>(self, rnd: R) -> Self
pub fn random_generator<R: RngCore + 'static>(self, rnd: R) -> Self
Set the random number generator that should be used in the k-means calculation. Use a seeded generator for deterministically repeatable results.
Sourcepub fn abort_strategy(self, abort_strategy: AbortStrategy<T>) -> Self
pub fn abort_strategy(self, abort_strategy: AbortStrategy<T>) -> Self
Set the abort-strategy to use during a running k-means calculation. For more information,
see documentation of AbortStrategy.
§Default
AbortStrategy::NoImprovement { threshold: 0.0005 }
Sourcepub fn build(self) -> KMeansConfig<'a, T>
pub fn build(self) -> KMeansConfig<'a, T>
Return the internally built configuration structure.
Auto Trait Implementations§
impl<'a, T> Freeze for KMeansConfigBuilder<'a, T>where
T: Freeze,
impl<'a, T> !RefUnwindSafe for KMeansConfigBuilder<'a, T>
impl<'a, T> !Send for KMeansConfigBuilder<'a, T>
impl<'a, T> !Sync for KMeansConfigBuilder<'a, T>
impl<'a, T> Unpin for KMeansConfigBuilder<'a, T>where
T: Unpin,
impl<'a, T> !UnwindSafe for KMeansConfigBuilder<'a, T>
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> 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