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§
Sourcefn clone_box(&self) -> Box<dyn Transformer>
fn clone_box(&self) -> Box<dyn Transformer>
Returns a boxed clone of the transformer
Sourcefn as_any_mut(&mut self) -> &mut dyn Any
fn as_any_mut(&mut self) -> &mut dyn Any
Returns the transformer as mutable Any for downcasting