DataPreprocessor

Trait DataPreprocessor 

Source
pub trait DataPreprocessor: Send + Sync {
    // Required methods
    fn fit(&mut self, X: &ArrayD<f64>) -> Result<()>;
    fn transform(&self, X: &ArrayD<f64>) -> Result<ArrayD<f64>>;
    fn get_params(&self) -> HashMap<String, f64>;
    fn set_params(&mut self, params: HashMap<String, f64>) -> Result<()>;

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

Data preprocessing trait

Required Methods§

Source

fn fit(&mut self, X: &ArrayD<f64>) -> Result<()>

Fit preprocessor to data

Source

fn transform(&self, X: &ArrayD<f64>) -> Result<ArrayD<f64>>

Transform data

Source

fn get_params(&self) -> HashMap<String, f64>

Get preprocessing parameters

Source

fn set_params(&mut self, params: HashMap<String, f64>) -> Result<()>

Set preprocessing parameters

Provided Methods§

Source

fn fit_transform(&mut self, X: &ArrayD<f64>) -> Result<ArrayD<f64>>

Fit and transform in one step

Implementors§