pub trait Trainable<X, Y> {
    // Required method
    fn fit(
        &mut self,
        x: &ArrayView2<'_, X>,
        y: &ArrayView1<'_, Y>
    ) -> Result<(), String>;
}
Expand description

Trait for objects that can be trained

Required Methods§

source

fn fit( &mut self, x: &ArrayView2<'_, X>, y: &ArrayView1<'_, Y> ) -> Result<(), String>

Trains the SVMClassifier on the provided training data.

Arguments
  • x - A 2D array of training data features.
  • y - A 1D array of training data labels.
Returns

A Result containing an error string if training fails, or Ok if training succeeds.

Implementors§

source§

impl Trainable<f32, bool> for SVMClassifier<f32, bool>

source§

impl<X, Y> Trainable<X, Y> for BayesClassifier<X, Y>where X: Float, Y: Label,

source§

impl<X, Y> Trainable<X, Y> for RandomForestClassifier<X, Y>where X: Number + FloatNumber + PartialOrd, Y: Number + Ord,

source§

impl<X, Y, C1, C2> Trainable<X, Y> for CombinedClassifier<X, Y, C1, C2>where X: Float, Y: Label, C1: Classifier<X, Y>, C2: Classifier<X, Y>,