Trait rusty_machine::learning::naive_bayes::Distribution
[−]
[src]
pub trait Distribution { fn from_model_params(class_count: usize, features: usize) -> Self; fn update_params(&mut self,
data: &Matrix<f64>,
class: usize)
-> LearningResult<()>; fn joint_log_lik(&self,
data: &Matrix<f64>,
class_prior: &[f64])
-> LearningResult<Matrix<f64>>; }
Naive Bayes Distribution.
Required Methods
fn from_model_params(class_count: usize, features: usize) -> Self
Initialize the distribution parameters.
fn update_params(&mut self,
data: &Matrix<f64>,
class: usize)
-> LearningResult<()>
data: &Matrix<f64>,
class: usize)
-> LearningResult<()>
Updates the distribution parameters.
fn joint_log_lik(&self,
data: &Matrix<f64>,
class_prior: &[f64])
-> LearningResult<Matrix<f64>>
data: &Matrix<f64>,
class_prior: &[f64])
-> LearningResult<Matrix<f64>>
Compute the joint log likelihood of the data.
Returns a matrix with rows containing the probability that the input lies in each class.
Implementors
impl Distribution for Gaussian
impl Distribution for Bernoulli
impl Distribution for Multinomial