[][src]Struct linfa_clustering::KMeansHyperParams

pub struct KMeansHyperParams { /* fields omitted */ }

The set of hyperparameters that can be specified for the execution of the K-means algorithm.

Methods

impl KMeansHyperParams[src]

pub fn new(n_clusters: usize) -> KMeansHyperParamsBuilder[src]

new lets us configure our training algorithm parameters:

  • we will be looking for n_clusters in the training dataset;
  • 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;
  • 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.

n_clusters is mandatory.

Defaults are provided if optional parameters are not specified:

  • tolerance = 1e-4;
  • max_n_iterations = 300.

pub fn tolerance(&self) -> f64[src]

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 max_n_iterations(&self) -> u64[src]

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 n_clusters(&self) -> usize[src]

The number of clusters we will be looking for in the training dataset.

Trait Implementations

impl Clone for KMeansHyperParams[src]

impl PartialEq<KMeansHyperParams> for KMeansHyperParams[src]

impl Debug for KMeansHyperParams[src]

impl StructuralPartialEq for KMeansHyperParams[src]

impl Serialize for KMeansHyperParams[src]

impl<'de> Deserialize<'de> for KMeansHyperParams[src]

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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

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