Trait ResamplingStrategy

Source
pub trait ResamplingStrategy: Send + Sync {
    type Input;
    type Output;
    type Config;

    // Required method
    fn resample(
        &self,
        x: ArrayBase<ViewRepr<&f64>, Dim<[usize; 2]>>,
        y: ArrayBase<ViewRepr<&i32>, Dim<[usize; 1]>>,
        config: &Self::Config,
    ) -> Result<(ArrayBase<OwnedRepr<f64>, Dim<[usize; 2]>>, ArrayBase<OwnedRepr<i32>, Dim<[usize; 1]>>), ResamplingError>;

    // Provided method
    fn performance_hints(&self) -> PerformanceHints { ... }
}
Expand description

Zero-cost abstraction for resampling strategies

Required Associated Types§

Source

type Input

Input data type

Source

type Output

Output data type

Source

type Config

Configuration type for this strategy

Required Methods§

Source

fn resample( &self, x: ArrayBase<ViewRepr<&f64>, Dim<[usize; 2]>>, y: ArrayBase<ViewRepr<&i32>, Dim<[usize; 1]>>, config: &Self::Config, ) -> Result<(ArrayBase<OwnedRepr<f64>, Dim<[usize; 2]>>, ArrayBase<OwnedRepr<i32>, Dim<[usize; 1]>>), ResamplingError>

Resample the input data to balance class distribution

Provided Methods§

Source

fn performance_hints(&self) -> PerformanceHints

Consciousness-aligned performance hints

Implementors§