Struct linfa_clustering::GmmParams
source · pub struct GmmParams<F: Float, R: Rng>(/* private fields */);
Expand description
The set of hyperparameters that can be specified for the execution of the GMM algorithm.
Implementations§
source§impl<F: Float, R: Rng + Clone> GmmParams<F, R>
impl<F: Float, R: Rng + Clone> GmmParams<F, R>
pub fn new_with_rng(n_clusters: usize, rng: R) -> 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§
source§impl<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
source§fn 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
source§fn check(self) -> Result<Self::Checked, GmmError>
fn check(self) -> Result<Self::Checked, GmmError>
Checks the hyperparameters and returns the checked hyperparameters if successful
source§fn check_unwrap(self) -> Self::Checkedwhere
Self: Sized,
fn check_unwrap(self) -> Self::Checkedwhere Self: Sized,
Calls
check()
and unwraps the resultsource§impl<F: PartialEq + Float, R: PartialEq + Rng> PartialEq for GmmParams<F, R>
impl<F: PartialEq + Float, R: PartialEq + Rng> PartialEq for GmmParams<F, R>
impl<F: Float, R: Rng> StructuralPartialEq for GmmParams<F, R>
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 R: Unpin,
impl<F, R> UnwindSafe for GmmParams<F, R>where F: UnwindSafe, R: UnwindSafe,
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