Struct linfa_bayes::MultinomialNbParams
source · [−]pub struct MultinomialNbParams<F, L>(_);
Expand description
A hyper-parameter set during construction for a Multinomial Naive Bayes model.
The parameter set can be verified into a
MultinomialNbValidParams
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 MultinomialNb
for information on the model.
Parameters
Name | Default | Purpose | Range |
---|---|---|---|
alpha | 1 | Additive (Laplace/Lidstone) smoothing parameter (0 for no smoothing) | [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> MultinomialNbParams<F, L>
impl<F: Float, L> MultinomialNbParams<F, L>
sourcepub fn new() -> Self
pub fn new() -> Self
Create new MultinomialNbParams set with default values for its parameters
Trait Implementations
sourceimpl<F: Clone, L: Clone> Clone for MultinomialNbParams<F, L>
impl<F: Clone, L: Clone> Clone for MultinomialNbParams<F, L>
sourcefn clone(&self) -> MultinomialNbParams<F, L>
fn clone(&self) -> MultinomialNbParams<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 MultinomialNbParams<F, L>
impl<F: Debug, L: Debug> Debug for MultinomialNbParams<F, L>
sourceimpl<F: Float, L> Default for MultinomialNbParams<F, L>
impl<F: Float, L> Default for MultinomialNbParams<F, L>
sourceimpl<F: Float, L> ParamGuard for MultinomialNbParams<F, L>
impl<F: Float, L> ParamGuard for MultinomialNbParams<F, L>
type Checked = MultinomialNbValidParams<F, L>
type Checked = MultinomialNbValidParams<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<MultinomialNbParams<F, L>> for MultinomialNbParams<F, L>
impl<F: PartialEq, L: PartialEq> PartialEq<MultinomialNbParams<F, L>> for MultinomialNbParams<F, L>
sourcefn eq(&self, other: &MultinomialNbParams<F, L>) -> bool
fn eq(&self, other: &MultinomialNbParams<F, L>) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &MultinomialNbParams<F, L>) -> bool
fn ne(&self, other: &MultinomialNbParams<F, L>) -> bool
This method tests for !=
.
impl<F, L> StructuralPartialEq for MultinomialNbParams<F, L>
Auto Trait Implementations
impl<F, L> RefUnwindSafe for MultinomialNbParams<F, L> where
F: RefUnwindSafe,
L: RefUnwindSafe,
impl<F, L> Send for MultinomialNbParams<F, L> where
F: Send,
L: Send,
impl<F, L> Sync for MultinomialNbParams<F, L> where
F: Sync,
L: Sync,
impl<F, L> Unpin for MultinomialNbParams<F, L> where
F: Unpin,
L: Unpin,
impl<F, L> UnwindSafe for MultinomialNbParams<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