Skip to main content

FeatureExtractor

Trait FeatureExtractor 

Source
pub trait FeatureExtractor<const N: usize> {
    type Input;

    // Required methods
    fn schema(&self) -> &FeatureSchema<N>;
    fn extract(
        &mut self,
        input: Self::Input,
        writer: &mut FeatureVectorWriter<N>,
    ) -> Result<FeatureVector<N>, AnalyticsError>;
}
Expand description

Feature extractor contract.

Required Associated Types§

Source

type Input

Input consumed by the extractor.

Required Methods§

Source

fn schema(&self) -> &FeatureSchema<N>

Returns extractor schema.

Source

fn extract( &mut self, input: Self::Input, writer: &mut FeatureVectorWriter<N>, ) -> Result<FeatureVector<N>, AnalyticsError>

Extracts a feature vector into a caller-owned writer.

§Errors

Returns AnalyticsError when the input cannot be converted into a valid vector.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§