pub trait Fit<X, Y, State = Untrained> {
type Fitted: Send + Sync;
// Required method
fn fit(self, x: &X, y: &Y) -> Result<Self::Fitted, SklearsError>;
// Provided method
fn fit_with_validation(
self,
x: &X,
y: &Y,
_x_val: Option<&X>,
_y_val: Option<&Y>,
) -> Result<(Self::Fitted, FitMetrics), SklearsError>
where Self: Sized { ... }
}Expand description
Enhanced trait for models that can be fitted to data
Required Associated Types§
Required Methods§
Provided Methods§
Sourcefn fit_with_validation(
self,
x: &X,
y: &Y,
_x_val: Option<&X>,
_y_val: Option<&Y>,
) -> Result<(Self::Fitted, FitMetrics), SklearsError>where
Self: Sized,
fn fit_with_validation(
self,
x: &X,
y: &Y,
_x_val: Option<&X>,
_y_val: Option<&Y>,
) -> Result<(Self::Fitted, FitMetrics), SklearsError>where
Self: Sized,
Fit with custom validation and early stopping