[][src]Struct linfa_clustering::KMeansHyperParamsBuilder

pub struct KMeansHyperParamsBuilder { /* fields omitted */ }

An helper struct used to construct a set of valid hyperparameters for the K-means algorithm (using the builder pattern).

Methods

impl KMeansHyperParamsBuilder[src]

pub fn max_n_iterations(self, max_n_iterations: u64) -> Self[src]

Set the value of max_n_iterations.

We exit the training loop when the number of training iterations exceeds max_n_iterations even if the tolerance convergence condition has not been met.

pub fn tolerance(self, tolerance: f64) -> Self[src]

Set the value of tolerance.

The training is considered complete if the euclidean distance between the old set of centroids and the new set of centroids after a training iteration is lower or equal than tolerance.

pub fn build(self) -> KMeansHyperParams[src]

Return an instance of KMeansHyperParams after having performed validation checks on all the specified hyperparamters.

Panics if any of the validation checks fails.

Auto Trait Implementations

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,