Struct linfa_clustering::GmmParams
source · [−]Expand description
The set of hyperparameters that can be specified for the execution of the GMM algorithm.
Implementations
sourceimpl<F: Float> GmmParams<F, Isaac64Rng>
impl<F: Float> GmmParams<F, Isaac64Rng>
pub fn new(n_clusters: usize) -> GmmParams<F, Isaac64Rng>
sourceimpl<F: Float, R: Rng + Clone> GmmParams<F, R>
impl<F: Float, R: Rng + Clone> GmmParams<F, R>
sourcepub fn covariance_type(self, covar_type: GmmCovarType) -> Self
pub fn covariance_type(self, covar_type: GmmCovarType) -> Self
Set the covariance type.
sourcepub fn tolerance(self, tolerance: F) -> Self
pub fn tolerance(self, tolerance: F) -> Self
Set the convergence threshold. EM iterations will stop when the lower bound average gain is below this threshold.
sourcepub fn reg_covariance(self, reg_covar: F) -> Self
pub fn reg_covariance(self, reg_covar: F) -> Self
Non-negative regularization added to the diagonal of covariance. Allows to assure that the covariance matrices are all positive.
sourcepub fn n_runs(self, n_runs: u64) -> Self
pub fn n_runs(self, n_runs: u64) -> Self
Set the number of initializations to perform. The best results are kept.
sourcepub fn max_n_iterations(self, max_n_iter: u64) -> Self
pub fn max_n_iterations(self, max_n_iter: u64) -> Self
Set the number of EM iterations to perform.
sourcepub fn init_method(self, init_method: GmmInitMethod) -> Self
pub fn init_method(self, init_method: GmmInitMethod) -> Self
Set the method used to initialize the weights, the means and the precisions.
pub fn with_rng<R2: Rng + Clone>(self, rng: R2) -> GmmParams<F, R2>
Trait Implementations
sourceimpl<F: Float, R: Rng> ParamGuard for GmmParams<F, R>
impl<F: Float, R: Rng> ParamGuard for GmmParams<F, R>
type Checked = GmmValidParams<F, R>
type Checked = GmmValidParams<F, R>
The checked hyperparameters
sourcefn check_ref(&self) -> Result<&Self::Checked, GmmError>
fn check_ref(&self) -> Result<&Self::Checked, GmmError>
Checks the hyperparameters and returns a reference to the checked hyperparameters if successful Read more
sourcefn check(self) -> Result<Self::Checked, GmmError>
fn check(self) -> Result<Self::Checked, GmmError>
Checks the hyperparameters and returns the checked hyperparameters if successful
sourcefn check_unwrap(self) -> Self::Checked
fn check_unwrap(self) -> Self::Checked
Calls check()
and unwraps the result
Auto Trait Implementations
impl<F, R> RefUnwindSafe for GmmParams<F, R> where
F: RefUnwindSafe,
R: RefUnwindSafe,
impl<F, R> Send for GmmParams<F, R> where
R: Send,
impl<F, R> Sync for GmmParams<F, R> where
R: Sync,
impl<F, R> Unpin for GmmParams<F, R> where
F: Unpin,
R: Unpin,
impl<F, R> UnwindSafe for GmmParams<F, R> where
F: UnwindSafe,
R: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more