Trait Classifier

Source
pub trait Classifier<Features, Label>
where Label: Clone,
{ // Required methods fn labels(&self) -> &[Label]; fn predict_proba(&self, arr: &Features) -> Option<Array2<f64>>; // Provided method fn predict(&self, arr: &Features) -> Option<Vec<Label>> { ... } }
Expand description

Trait to interface with a fitted classification model

Required Methods§

Source

fn labels(&self) -> &[Label]

Labels on which the model is fitted.

Source

fn predict_proba(&self, arr: &Features) -> Option<Array2<f64>>

Estimates likelihood of each class per record. Rows correspond to each record, columns are in the same order as label function.

Provided Methods§

Source

fn predict(&self, arr: &Features) -> Option<Vec<Label>>

Provided function which returns the most likely class per record based on the results of predict_proba().

Implementors§

Source§

impl<Label: Clone> Classifier<ArrayBase<OwnedRepr<f64>, Dim<[usize; 2]>>, Label> for GaussianNB<Label>