Struct kmeans::KMeansConfigBuilder
source · 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> !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