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>
Source§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 resultimpl<F: Float, R: Rng> StructuralPartialEq for GmmParams<F, R>
Auto Trait Implementations§
impl<F, R> Freeze for GmmParams<F, R>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more