Classifier

Trait Classifier 

Source
pub trait Classifier<Features, Label>
where Label: Clone,
{ // Required methods fn labels(&self) -> &[Label]; fn predict_proba<I>(&self, arr: I) -> Option<Array2<f64>> where I: Iterator<Item = Features>; // Provided method fn predict<I>(&self, arr: I) -> Option<Vec<Label>> where I: Iterator<Item = Features> { ... } }
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<I>(&self, arr: I) -> Option<Array2<f64>>
where I: Iterator<Item = Features>,

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<I>(&self, arr: I) -> Option<Vec<Label>>
where I: Iterator<Item = Features>,

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

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.

Implementors§

Source§

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