pub struct SmoteStrategy { /* private fields */ }
Expand description
SMOTE (Synthetic Minority Over-sampling Technique) implementation
Implementations§
Source§impl SmoteStrategy
impl SmoteStrategy
Sourcepub fn new(k_neighbors: usize) -> SmoteStrategy
pub fn new(k_neighbors: usize) -> SmoteStrategy
Create a new SMOTE strategy with default k=5 neighbors
Sourcepub fn default() -> SmoteStrategy
pub fn default() -> SmoteStrategy
Create with default configuration
Trait Implementations§
Source§impl Clone for SmoteStrategy
impl Clone for SmoteStrategy
Source§fn clone(&self) -> SmoteStrategy
fn clone(&self) -> SmoteStrategy
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for SmoteStrategy
impl Debug for SmoteStrategy
Source§impl ResamplingStrategy for SmoteStrategy
impl ResamplingStrategy for SmoteStrategy
Source§type Output = (ArrayBase<OwnedRepr<f64>, Dim<[usize; 2]>>, ArrayBase<OwnedRepr<i32>, Dim<[usize; 1]>>)
type Output = (ArrayBase<OwnedRepr<f64>, Dim<[usize; 2]>>, ArrayBase<OwnedRepr<i32>, Dim<[usize; 1]>>)
Output data type
Source§type Config = SmoteConfig
type Config = SmoteConfig
Configuration type for this strategy
Source§fn resample(
&self,
x: ArrayBase<ViewRepr<&f64>, Dim<[usize; 2]>>,
y: ArrayBase<ViewRepr<&i32>, Dim<[usize; 1]>>,
config: &<SmoteStrategy as ResamplingStrategy>::Config,
) -> Result<(ArrayBase<OwnedRepr<f64>, Dim<[usize; 2]>>, ArrayBase<OwnedRepr<i32>, Dim<[usize; 1]>>), ResamplingError>
fn resample( &self, x: ArrayBase<ViewRepr<&f64>, Dim<[usize; 2]>>, y: ArrayBase<ViewRepr<&i32>, Dim<[usize; 1]>>, config: &<SmoteStrategy as ResamplingStrategy>::Config, ) -> Result<(ArrayBase<OwnedRepr<f64>, Dim<[usize; 2]>>, ArrayBase<OwnedRepr<i32>, Dim<[usize; 1]>>), ResamplingError>
Resample the input data to balance class distribution
Source§fn performance_hints(&self) -> PerformanceHints
fn performance_hints(&self) -> PerformanceHints
Consciousness-aligned performance hints
Auto Trait Implementations§
impl Freeze for SmoteStrategy
impl RefUnwindSafe for SmoteStrategy
impl Send for SmoteStrategy
impl Sync for SmoteStrategy
impl Unpin for SmoteStrategy
impl UnwindSafe for SmoteStrategy
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more