Trait linfa::traits::Fit

source ·
pub trait Fit<R: Records, T, E: Error + From<Error>> {
    type Object;

    // Required method
    fn fit(&self, dataset: &DatasetBase<R, T>) -> Result<Self::Object, E>;
}
Expand description

Fittable algorithms

A fittable algorithm takes a dataset and creates a concept of some kind about it. For example in KMeans this would be the mean values for each class, or in SVM the separating hyperplane. It returns a model, which can be used to predict targets for new data.

Required Associated Types§

Required Methods§

source

fn fit(&self, dataset: &DatasetBase<R, T>) -> Result<Self::Object, E>

Implementors§

source§

impl<R: Records, T, E, P: ParamGuard> Fit<R, T, E> for P
where P::Checked: Fit<R, T, E>, E: Error + From<Error> + From<P::Error>,

Performs checking step and calls fit on the checked hyperparameters. If checking failed, the checking error is converted to the original error type of Fit and returned.

§

type Object = <<P as ParamGuard>::Checked as Fit<R, T, E>>::Object