pub struct GaussianNaiveBayes { /* private fields */ }Expand description
Gaussian naive Bayes: each class models every feature as an independent normal distribution
(the “naive” independence assumption), and a point goes to the class with the highest posterior
P(class) Π P(x_j | class). Fast, needs little data, and surprisingly strong when features are
roughly independent given the class. var_smoothing adds a fraction of the largest feature
variance to every variance, which keeps constant features from causing division by zero.
Implementations§
Source§impl GaussianNaiveBayes
impl GaussianNaiveBayes
pub fn new() -> Self
pub fn with_var_smoothing(self, smoothing: f64) -> Self
Sourcepub fn class_means(&self) -> &[Vec<f64>]
pub fn class_means(&self) -> &[Vec<f64>]
Per-class feature means ([class][feature]).
Trait Implementations§
Source§impl Classifier for GaussianNaiveBayes
impl Classifier for GaussianNaiveBayes
Source§impl Clone for GaussianNaiveBayes
impl Clone for GaussianNaiveBayes
Source§impl Debug for GaussianNaiveBayes
impl Debug for GaussianNaiveBayes
Auto Trait Implementations§
impl Freeze for GaussianNaiveBayes
impl RefUnwindSafe for GaussianNaiveBayes
impl Send for GaussianNaiveBayes
impl Sync for GaussianNaiveBayes
impl Unpin for GaussianNaiveBayes
impl UnsafeUnpin for GaussianNaiveBayes
impl UnwindSafe for GaussianNaiveBayes
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