DecompositionAlgorithm

Trait DecompositionAlgorithm 

Source
pub trait DecompositionAlgorithm: Send + Sync {
    // Required methods
    fn name(&self) -> &str;
    fn description(&self) -> &str;
    fn capabilities(&self) -> AlgorithmCapabilities;
    fn validate_params(&self, params: &DecompositionParams) -> Result<()>;
    fn fit(
        &mut self,
        data: &Array2<Float>,
        params: &DecompositionParams,
    ) -> Result<()>;
    fn transform(&self, data: &Array2<Float>) -> Result<Array2<Float>>;
    fn get_components(&self) -> Result<DecompositionComponents>;
    fn is_fitted(&self) -> bool;
    fn clone_algorithm(&self) -> Box<dyn DecompositionAlgorithm>;
    fn as_any(&self) -> &dyn Any;

    // Provided method
    fn inverse_transform(&self, _data: &Array2<Float>) -> Result<Array2<Float>> { ... }
}
Expand description

Core trait for decomposition algorithms

Required Methods§

Source

fn name(&self) -> &str

Get algorithm name

Source

fn description(&self) -> &str

Get algorithm description

Source

fn capabilities(&self) -> AlgorithmCapabilities

Get algorithm capabilities

Source

fn validate_params(&self, params: &DecompositionParams) -> Result<()>

Validate input parameters

Source

fn fit( &mut self, data: &Array2<Float>, params: &DecompositionParams, ) -> Result<()>

Fit the decomposition algorithm

Source

fn transform(&self, data: &Array2<Float>) -> Result<Array2<Float>>

Transform data using fitted algorithm

Source

fn get_components(&self) -> Result<DecompositionComponents>

Get decomposition results/components

Source

fn is_fitted(&self) -> bool

Check if algorithm is fitted

Source

fn clone_algorithm(&self) -> Box<dyn DecompositionAlgorithm>

Clone the algorithm (for plugin system)

Source

fn as_any(&self) -> &dyn Any

Get algorithm as Any for downcasting

Provided Methods§

Source

fn inverse_transform(&self, _data: &Array2<Float>) -> Result<Array2<Float>>

Inverse transform if supported

Implementors§