pub trait Hook: Send + Sync {
// Provided methods
fn before_fit(
&mut self,
x: &Array2<f64>,
context: &mut HookContext,
) -> Result<(), SklearsError> { ... }
fn after_fit(
&mut self,
x: &Array2<f64>,
context: &mut HookContext,
) -> Result<(), SklearsError> { ... }
fn before_transform(
&mut self,
x: &Array2<f64>,
context: &mut HookContext,
) -> Result<(), SklearsError> { ... }
fn after_transform(
&mut self,
x: &Array2<f64>,
output: &Array2<f64>,
context: &mut HookContext,
) -> Result<(), SklearsError> { ... }
fn on_error(&mut self, error: &SklearsError, context: &mut HookContext) { ... }
fn name(&self) -> &str { ... }
}Expand description
Hook that can be called at various stages of the pipeline
Provided Methods§
Sourcefn before_fit(
&mut self,
x: &Array2<f64>,
context: &mut HookContext,
) -> Result<(), SklearsError>
fn before_fit( &mut self, x: &Array2<f64>, context: &mut HookContext, ) -> Result<(), SklearsError>
Called before fit
Sourcefn after_fit(
&mut self,
x: &Array2<f64>,
context: &mut HookContext,
) -> Result<(), SklearsError>
fn after_fit( &mut self, x: &Array2<f64>, context: &mut HookContext, ) -> Result<(), SklearsError>
Called after fit
Sourcefn before_transform(
&mut self,
x: &Array2<f64>,
context: &mut HookContext,
) -> Result<(), SklearsError>
fn before_transform( &mut self, x: &Array2<f64>, context: &mut HookContext, ) -> Result<(), SklearsError>
Called before transform
Sourcefn after_transform(
&mut self,
x: &Array2<f64>,
output: &Array2<f64>,
context: &mut HookContext,
) -> Result<(), SklearsError>
fn after_transform( &mut self, x: &Array2<f64>, output: &Array2<f64>, context: &mut HookContext, ) -> Result<(), SklearsError>
Called after transform
Sourcefn on_error(&mut self, error: &SklearsError, context: &mut HookContext)
fn on_error(&mut self, error: &SklearsError, context: &mut HookContext)
Called on error