Trait rusty_machine::learning::naive_bayes::Distribution
source · [−]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>>;
}
Expand description
Naive Bayes Distribution.
Required Methods
sourcefn from_model_params(class_count: usize, features: usize) -> Self
fn from_model_params(class_count: usize, features: usize) -> Self
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.
Returns a matrix with rows containing the probability that the input lies in each class.