Transformer

Trait Transformer 

Source
pub trait Transformer: Send + Sync {
    // Required methods
    fn fit(&mut self, x: &Array2<f64>) -> Result<()>;
    fn transform(&self, x: &Array2<f64>) -> Result<Array2<f64>>;
    fn clone_box(&self) -> Box<dyn Transformer>;
    fn as_any(&self) -> &dyn Any;
    fn as_any_mut(&mut self) -> &mut dyn Any;

    // Provided method
    fn fit_transform(&mut self, x: &Array2<f64>) -> Result<Array2<f64>> { ... }
}
Expand description

Trait for all transformers that can be used in pipelines

Required Methods§

Source

fn fit(&mut self, x: &Array2<f64>) -> Result<()>

Fits the transformer to the input data

Source

fn transform(&self, x: &Array2<f64>) -> Result<Array2<f64>>

Transforms the input data

Source

fn clone_box(&self) -> Box<dyn Transformer>

Returns a boxed clone of the transformer

Source

fn as_any(&self) -> &dyn Any

Returns the transformer as Any for downcasting

Source

fn as_any_mut(&mut self) -> &mut dyn Any

Returns the transformer as mutable Any for downcasting

Provided Methods§

Source

fn fit_transform(&mut self, x: &Array2<f64>) -> Result<Array2<f64>>

Fits and transforms the data in one step

Implementors§