pub trait FitWith<'a, R: Records, T, E: Error + From<Error>> {
type ObjectIn: 'a;
type ObjectOut: 'a;
fn fit_with(
&self,
model: Self::ObjectIn,
dataset: &'a DatasetBase<R, T>
) -> Result<Self::ObjectOut, E>;
}
Expand description
Incremental algorithms
An incremental algorithm takes a former model and dataset and returns a new model with updated
parameters. If the former model is None
, then the function acts like Fit::fit
and
initializes the model first.
Associated Types
Required methods
Implementors
sourceimpl<'a, F: Float, O: 'a> FitWith<'a, ArrayBase<OwnedRepr<F>, Dim<[usize; 2]>>, ArrayBase<OwnedRepr<bool>, Dim<[usize; 1]>>, PlattError> for PlattValidParams<F, O> where
O: PredictInplace<Array2<F>, Array1<F>>,
impl<'a, F: Float, O: 'a> FitWith<'a, ArrayBase<OwnedRepr<F>, Dim<[usize; 2]>>, ArrayBase<OwnedRepr<bool>, Dim<[usize; 1]>>, PlattError> for PlattValidParams<F, O> where
O: PredictInplace<Array2<F>, Array1<F>>,
sourceimpl<'a, R: Records, T, E, P: ParamGuard> FitWith<'a, R, T, E> for P where
P::Checked: FitWith<'a, R, T, E>,
E: Error + From<Error> + From<P::Error>,
impl<'a, R: Records, T, E, P: ParamGuard> FitWith<'a, R, T, E> for P where
P::Checked: FitWith<'a, R, T, E>,
E: Error + From<Error> + From<P::Error>,
Performs checking step and calls fit_with
on the checked hyperparameters. If checking failed,
the checking error is converted to the original error type of FitWith
and returned.