Struct linfa_bayes::GaussianNbParams
source · [−]pub struct GaussianNbParams<F, L>(_);
Expand description
A hyper-parameter set during construction for a Gaussian Naive Bayes model.
The parameter set can be verified into a
GaussianNbValidParams
by calling
ParamGuard::check. It is also possible to directly fit a model with
Fit::fit or
FitWith::fit_with which implicitely verifies the parameter set
prior to the model estimation and forwards any error.
See GaussianNb
for information on the model.
Parameters
Name | Default | Purpose | Range |
---|---|---|---|
var_smoothing | 1e-9 | Stabilize variance calculation if ratios are small in update step | [0, inf) |
Errors
The following errors can come from invalid hyper-parameters:
Returns InvalidSmoothing
if the smoothing
parameter is negative.
Implementations
sourceimpl<F: Float, L> GaussianNbParams<F, L>
impl<F: Float, L> GaussianNbParams<F, L>
sourcepub fn new() -> Self
pub fn new() -> Self
Create new GaussianNbParams set with default values for its parameters
sourcepub fn var_smoothing(self, var_smoothing: F) -> Self
pub fn var_smoothing(self, var_smoothing: F) -> Self
Specifies the portion of the largest variance of all the features that is added to the variance for calculation stability
Trait Implementations
sourceimpl<F: Clone, L: Clone> Clone for GaussianNbParams<F, L>
impl<F: Clone, L: Clone> Clone for GaussianNbParams<F, L>
sourcefn clone(&self) -> GaussianNbParams<F, L>
fn clone(&self) -> GaussianNbParams<F, L>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<F: Debug, L: Debug> Debug for GaussianNbParams<F, L>
impl<F: Debug, L: Debug> Debug for GaussianNbParams<F, L>
sourceimpl<F: Float, L> Default for GaussianNbParams<F, L>
impl<F: Float, L> Default for GaussianNbParams<F, L>
sourceimpl<F: Float, L> ParamGuard for GaussianNbParams<F, L>
impl<F: Float, L> ParamGuard for GaussianNbParams<F, L>
type Checked = GaussianNbValidParams<F, L>
type Checked = GaussianNbValidParams<F, L>
The checked hyperparameters
type Error = NaiveBayesError
type Error = NaiveBayesError
Error type resulting from failed hyperparameter checking
sourcefn check_ref(&self) -> Result<&Self::Checked, Self::Error>
fn check_ref(&self) -> Result<&Self::Checked, Self::Error>
Checks the hyperparameters and returns a reference to the checked hyperparameters if successful Read more
sourcefn check(self) -> Result<Self::Checked, Self::Error>
fn check(self) -> Result<Self::Checked, Self::Error>
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
sourceimpl<F: PartialEq, L: PartialEq> PartialEq<GaussianNbParams<F, L>> for GaussianNbParams<F, L>
impl<F: PartialEq, L: PartialEq> PartialEq<GaussianNbParams<F, L>> for GaussianNbParams<F, L>
sourcefn eq(&self, other: &GaussianNbParams<F, L>) -> bool
fn eq(&self, other: &GaussianNbParams<F, L>) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &GaussianNbParams<F, L>) -> bool
fn ne(&self, other: &GaussianNbParams<F, L>) -> bool
This method tests for !=
.
impl<F, L> StructuralPartialEq for GaussianNbParams<F, L>
Auto Trait Implementations
impl<F, L> RefUnwindSafe for GaussianNbParams<F, L> where
F: RefUnwindSafe,
L: RefUnwindSafe,
impl<F, L> Send for GaussianNbParams<F, L> where
F: Send,
L: Send,
impl<F, L> Sync for GaussianNbParams<F, L> where
F: Sync,
L: Sync,
impl<F, L> Unpin for GaussianNbParams<F, L> where
F: Unpin,
L: Unpin,
impl<F, L> UnwindSafe for GaussianNbParams<F, L> where
F: UnwindSafe,
L: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more