Hook

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§

Source

fn before_fit( &mut self, x: &Array2<f64>, context: &mut HookContext, ) -> Result<(), SklearsError>

Called before fit

Source

fn after_fit( &mut self, x: &Array2<f64>, context: &mut HookContext, ) -> Result<(), SklearsError>

Called after fit

Source

fn before_transform( &mut self, x: &Array2<f64>, context: &mut HookContext, ) -> Result<(), SklearsError>

Called before transform

Source

fn after_transform( &mut self, x: &Array2<f64>, output: &Array2<f64>, context: &mut HookContext, ) -> Result<(), SklearsError>

Called after transform

Source

fn on_error(&mut self, error: &SklearsError, context: &mut HookContext)

Called on error

Source

fn name(&self) -> &str

Get hook name

Implementors§