[−][src]Struct linfa_clustering::KMeansHyperParams
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 thetolerance
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]
fn clone(&self) -> KMeansHyperParams
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl PartialEq<KMeansHyperParams> for KMeansHyperParams
[src]
fn eq(&self, other: &KMeansHyperParams) -> bool
[src]
fn ne(&self, other: &KMeansHyperParams) -> bool
[src]
impl Debug for KMeansHyperParams
[src]
impl StructuralPartialEq for KMeansHyperParams
[src]
impl Serialize for KMeansHyperParams
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl<'de> Deserialize<'de> for KMeansHyperParams
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
Auto Trait Implementations
impl Send for KMeansHyperParams
impl Sync for KMeansHyperParams
impl Unpin for KMeansHyperParams
impl UnwindSafe for KMeansHyperParams
impl RefUnwindSafe for KMeansHyperParams
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,