pub trait NaiveBayes<'a, F, L>where
F: Float,
L: Label + Ord,{
// Required method
fn joint_log_likelihood(
&self,
x: ArrayView2<'_, F>,
) -> HashMap<&L, Array1<F>>;
// Provided methods
fn predict_log_proba(&self, x: ArrayView2<'_, F>) -> (Array2<F>, Vec<&L>) { ... }
fn predict_proba(&self, x: ArrayView2<'_, F>) -> (Array2<F>, Vec<&L>) { ... }
}
Required Methods§
Sourcefn joint_log_likelihood(&self, x: ArrayView2<'_, F>) -> HashMap<&L, Array1<F>>
fn joint_log_likelihood(&self, x: ArrayView2<'_, F>) -> HashMap<&L, Array1<F>>
Compute the unnormalized posterior log probabilities. The result is returned as an HashMap indexing log probabilities for each samples (eg x rows) by classes (eg jll[class] -> (n_samples,) array)
Provided Methods§
Sourcefn predict_log_proba(&self, x: ArrayView2<'_, F>) -> (Array2<F>, Vec<&L>)
fn predict_log_proba(&self, x: ArrayView2<'_, F>) -> (Array2<F>, Vec<&L>)
Compute log-probability estimates for each sample wrt classes. The columns corresponds to classes in sorted order returned as the second output.
Sourcefn predict_proba(&self, x: ArrayView2<'_, F>) -> (Array2<F>, Vec<&L>)
fn predict_proba(&self, x: ArrayView2<'_, F>) -> (Array2<F>, Vec<&L>)
Compute probability estimates for each sample wrt classes. The columns corresponds to classes in sorted order returned as the second output.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.