Struct smartcore::naive_bayes::bernoulli::BernoulliNBParameters
source · pub struct BernoulliNBParameters<T: Number> {
pub alpha: f64,
pub priors: Option<Vec<f64>>,
pub binarize: Option<T>,
}
Expand description
BernoulliNB
parameters. Use Default::default()
for default values.
Fields§
§alpha: f64
Additive (Laplace/Lidstone) smoothing parameter (0 for no smoothing).
priors: Option<Vec<f64>>
Prior probabilities of the classes. If specified the priors are not adjusted according to the data
binarize: Option<T>
Threshold for binarizing (mapping to booleans) of sample features. If None, input is presumed to already consist of binary vectors.
Implementations§
source§impl<T: Number + PartialOrd> BernoulliNBParameters<T>
impl<T: Number + PartialOrd> BernoulliNBParameters<T>
sourcepub fn with_alpha(self, alpha: f64) -> Self
pub fn with_alpha(self, alpha: f64) -> Self
Additive (Laplace/Lidstone) smoothing parameter (0 for no smoothing).
sourcepub fn with_priors(self, priors: Vec<f64>) -> Self
pub fn with_priors(self, priors: Vec<f64>) -> Self
Prior probabilities of the classes. If specified the priors are not adjusted according to the data
sourcepub fn with_binarize(self, binarize: T) -> Self
pub fn with_binarize(self, binarize: T) -> Self
Threshold for binarizing (mapping to booleans) of sample features. If None, input is presumed to already consist of binary vectors.
Trait Implementations§
source§impl<T: Clone + Number> Clone for BernoulliNBParameters<T>
impl<T: Clone + Number> Clone for BernoulliNBParameters<T>
source§fn clone(&self) -> BernoulliNBParameters<T>
fn clone(&self) -> BernoulliNBParameters<T>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<T: Number + PartialOrd> Default for BernoulliNBParameters<T>
impl<T: Number + PartialOrd> Default for BernoulliNBParameters<T>
source§impl<TX: Number + PartialOrd, TY: Number + Ord + Unsigned, X: Array2<TX>, Y: Array1<TY>> SupervisedEstimator<X, Y, BernoulliNBParameters<TX>> for BernoulliNB<TX, TY, X, Y>
impl<TX: Number + PartialOrd, TY: Number + Ord + Unsigned, X: Array2<TX>, Y: Array1<TY>> SupervisedEstimator<X, Y, BernoulliNBParameters<TX>> for BernoulliNB<TX, TY, X, Y>
Auto Trait Implementations§
impl<T> RefUnwindSafe for BernoulliNBParameters<T>where T: RefUnwindSafe,
impl<T> Send for BernoulliNBParameters<T>where T: Send,
impl<T> Sync for BernoulliNBParameters<T>where T: Sync,
impl<T> Unpin for BernoulliNBParameters<T>where T: Unpin,
impl<T> UnwindSafe for BernoulliNBParameters<T>where T: 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