Struct rusty_machine::learning::naive_bayes::Bernoulli
source · [−]pub struct Bernoulli { /* private fields */ }
Expand description
The Bernoulli Naive Bayes model distribution.
Defines:
p(x|Ck) = ∏i pkxi (1-p)k1-xi
Implementations
Trait Implementations
sourceimpl Distribution for Bernoulli
impl Distribution for Bernoulli
sourcefn from_model_params(class_count: usize, features: usize) -> Bernoulli
fn from_model_params(class_count: usize, features: usize) -> Bernoulli
Initialize the distribution parameters.
sourcefn update_params(
&mut self,
data: &Matrix<f64>,
class: usize
) -> LearningResult<()>
fn update_params(
&mut self,
data: &Matrix<f64>,
class: usize
) -> LearningResult<()>
Updates the distribution parameters.
sourcefn joint_log_lik(
&self,
data: &Matrix<f64>,
class_prior: &[f64]
) -> LearningResult<Matrix<f64>>
fn joint_log_lik(
&self,
data: &Matrix<f64>,
class_prior: &[f64]
) -> LearningResult<Matrix<f64>>
Compute the joint log likelihood of the data. Read more
Auto Trait Implementations
impl RefUnwindSafe for Bernoulli
impl Send for Bernoulli
impl Sync for Bernoulli
impl Unpin for Bernoulli
impl UnwindSafe for Bernoulli
Blanket Implementations
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstablefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more