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);
    fn joint_log_lik(&self, data: &Matrix<f64>, class_prior: &[f64]) -> 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)

Updates the distribution parameters.

fn joint_log_lik(&self, data: &Matrix<f64>, class_prior: &[f64]) -> 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